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