1 /* $Id: sys.h,v 1.20 1996/08/04 23:14:42 bsmith Exp bsmith $ */ 2 /* 3 Provides access to a small number of system related and general utility routines. 4 */ 5 #if !defined(__SYS_PACKAGE) 6 #define __SYS_PACKAGE 7 8 #include "petsc.h" 9 10 extern int PetscGetArchType(char *,int); 11 extern int PetscGetHostName(char *,int); 12 extern int PetscGetUserName(char *,int); 13 14 extern char *PetscGetDate(); 15 16 extern int PetscSortInt(int,int*); 17 extern int PetscSortIntWithPermutation(int,int*,int*); 18 extern int PetscSortDouble(int,double*); 19 20 extern int PetscSetDisplay(); 21 extern int PetscGetDisplay(char *,int); 22 23 #define PETSCRANDOM_COOKIE PETSC_COOKIE+19 24 25 typedef enum { RANDOM_DEFAULT, RANDOM_DEFAULT_REAL, 26 RANDOM_DEFAULT_IMAGINARY } PetscRandomType; 27 28 typedef struct _PetscRandom* PetscRandom; 29 30 extern int PetscRandomCreate(MPI_Comm,PetscRandomType,PetscRandom*); 31 extern int PetscRandomGetValue(PetscRandom,Scalar*); 32 extern int PetscRandomDestroy(PetscRandom); 33 34 extern int PetscGetFullPath(char*,char*,int); 35 extern int PetscGetRelativePath(char*,char*,int); 36 extern int PetscGetWorkingDirectory(char *, int); 37 extern int PetscGetRealPath(char *,char*); 38 extern int PetscGetHomeDirectory(int,char*); 39 extern int PetscRemoveHomeDirectory(char*); 40 41 typedef enum { BINARY_INT, BINARY_DOUBLE, BINARY_SHORT, BINARY_FLOAT, 42 BINARY_CHAR } PetscBinaryType; 43 #define BINARY_SCALAR BINARY_DOUBLE /* not correct if compiled with complex */ 44 extern int PetscBinaryRead(int,void*,int,PetscBinaryType); 45 extern int PetscBinaryWrite(int,void*,int,PetscBinaryType,int); 46 47 extern int PetscSetDebugger(char *,int,char *); 48 extern int PetscAttachDebugger(); 49 50 #endif 51 52