Actual source code: arch.c

petsc-3.5.1 2014-07-24
Report Typos and Errors
  2: #include <petscsys.h>         /*I  "petscsys.h"  I*/

  6: /*@C
  7:      PetscGetArchType - Returns a standardized architecture type for the machine
  8:      that is executing this routine.

 10:      Not Collective

 12:      Input Parameter:
 13: .    slen - length of string buffer

 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.

 19:      Level: developer

 21:      Concepts: machine type
 22:      Concepts: architecture

 24:    Fortran Version:
 25:    In Fortran this routine has the format

 27: $       character*(10) str
 28: $       call PetscGetArchType(str,ierr)

 30: .seealso: PetscGetUserName(),PetscGetHostName()
 31: @*/
 32: PetscErrorCode  PetscGetArchType(char str[],size_t slen)
 33: {

 37: #if defined(PETSC_ARCH)
 38:   PetscStrncpy(str,PETSC_ARCH,slen-1);

 40:   str[slen-1] = 0;
 41: #else
 42: #error "$PETSC_ARCH/include/petscconf.h is missing PETSC_ARCH"
 43: #endif
 44:   return(0);
 45: }