xref: /petsc/src/sys/utils/arch.c (revision 0f55b88d1ac75fa99e70a53aff055236a607e7f1)
1 
2 #include <petscsys.h>         /*I  "petscsys.h"  I*/
3 
4 #undef __FUNCT__
5 #define __FUNCT__ "PetscGetArchType"
6 /*@C
7      PetscGetArchType - Returns a standardized architecture type for the machine
8      that is executing this routine.
9 
10      Not Collective
11 
12      Input Parameter:
13 .    slen - length of string buffer
14 
15      Output Parameter:
16 .    str - string area to contain architecture name, should be at least
17            10 characters long. Name is truncated if string is not long enough.
18 
19      Level: developer
20 
21      Concepts: machine type
22      Concepts: architecture
23 
24 @*/
25 PetscErrorCode  PetscGetArchType(char str[],size_t slen)
26 {
27   PetscErrorCode ierr;
28 
29   PetscFunctionBegin;
30 #if defined(PETSC_ARCH)
31   ierr = PetscStrncpy(str,PETSC_ARCH,slen-1);CHKERRQ(ierr);
32   str[slen-1] = 0;
33 #else
34 #error "$PETSC_ARCH/include/petscconf.h is missing PETSC_ARCH"
35 #endif
36   PetscFunctionReturn(0);
37 }
38 
39