1 /* $Id: sys.h,v 1.21 1996/08/05 03:50:20 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 PetscSortDoubleWithPermutation(int,double*,int*); 19 extern int PetscSortDouble(int,double*); 20 21 extern int PetscSetDisplay(); 22 extern int PetscGetDisplay(char *,int); 23 24 #define PETSCRANDOM_COOKIE PETSC_COOKIE+19 25 26 typedef enum { RANDOM_DEFAULT, RANDOM_DEFAULT_REAL, 27 RANDOM_DEFAULT_IMAGINARY } PetscRandomType; 28 29 typedef struct _PetscRandom* PetscRandom; 30 31 extern int PetscRandomCreate(MPI_Comm,PetscRandomType,PetscRandom*); 32 extern int PetscRandomGetValue(PetscRandom,Scalar*); 33 extern int PetscRandomDestroy(PetscRandom); 34 35 extern int PetscGetFullPath(char*,char*,int); 36 extern int PetscGetRelativePath(char*,char*,int); 37 extern int PetscGetWorkingDirectory(char *, int); 38 extern int PetscGetRealPath(char *,char*); 39 extern int PetscGetHomeDirectory(int,char*); 40 extern int PetscRemoveHomeDirectory(char*); 41 42 typedef enum { BINARY_INT, BINARY_DOUBLE, BINARY_SHORT, BINARY_FLOAT, 43 BINARY_CHAR } PetscBinaryType; 44 #define BINARY_SCALAR BINARY_DOUBLE /* not correct if compiled with complex */ 45 extern int PetscBinaryRead(int,void*,int,PetscBinaryType); 46 extern int PetscBinaryWrite(int,void*,int,PetscBinaryType,int); 47 48 extern int PetscSetDebugger(char *,int,char *); 49 extern int PetscAttachDebugger(); 50 51 #endif 52 53