xref: /petsc/src/sys/utils/arch.c (revision 4e278199b78715991f5c71ebbd945c1489263e6c)
1 
2 #include <petscsys.h>         /*I  "petscsys.h"  I*/
3 
4 /*@C
5      PetscGetArchType - Returns the $PETSC_ARCH that was used for this configuration of PETSc
6 
7      Not Collective
8 
9      Input Parameter:
10 .    slen - length of string buffer
11 
12      Output Parameter:
13 .    str - string area to contain architecture name, should be at least
14            10 characters long. Name is truncated if string is not long enough.
15 
16      Level: developer
17 
18    Fortran Version:
19    In Fortran this routine has the format
20 
21 $       character*(10) str
22 $       call PetscGetArchType(str,ierr)
23 
24    Notes:
25     This name is arbitrary and need not correspond to the physical hardware or the software running on the system.
26 
27 .seealso: PetscGetUserName(),PetscGetHostName()
28 @*/
29 PetscErrorCode  PetscGetArchType(char str[],size_t slen)
30 {
31   PetscErrorCode ierr;
32 
33   PetscFunctionBegin;
34 #if defined(PETSC_ARCH)
35   ierr = PetscStrncpy(str,PETSC_ARCH,slen-1);CHKERRQ(ierr);
36   str[slen-1] = 0;
37 #else
38 #error "$PETSC_ARCH/include/petscconf.h is missing PETSC_ARCH"
39 #endif
40   PetscFunctionReturn(0);
41 }
42 
43