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