xref: /petsc/include/petscsys.h (revision e80fee0d83fca2e79359165ac082b818fca7907f)
1 /* $Id: sys.h,v 1.34 1998/03/23 21:27:32 bsmith Exp bsmith $ */
2 /*
3     Provides access to 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 extern int  PetscGetProgramName(char *,int);
14 extern int  PetscSetProgramName(char *);
15 
16 extern char *PetscGetDate(void);
17 
18 extern int  PetscSortInt(int,int*);
19 extern int  PetscSortIntWithPermutation(int,int*,int*);
20 extern int  PetscSortDouble(int,double*);
21 extern int  PetscSortDoubleWithPermutation(int,double*,int*);
22 
23 extern int  PetscSetDisplay(void);
24 extern int  PetscGetDisplay(char *,int);
25 
26 #define PETSCRANDOM_COOKIE PETSC_COOKIE+19
27 
28 typedef enum { RANDOM_DEFAULT, RANDOM_DEFAULT_REAL,
29                RANDOM_DEFAULT_IMAGINARY } PetscRandomType;
30 
31 typedef struct _p_PetscRandom*   PetscRandom;
32 
33 extern int PetscRandomCreate(MPI_Comm,PetscRandomType,PetscRandom*);
34 extern int PetscRandomGetValue(PetscRandom,Scalar*);
35 extern int PetscRandomSetInterval(PetscRandom,Scalar,Scalar);
36 extern int PetscRandomDestroy(PetscRandom);
37 
38 extern int PetscGetFullPath(char*,char*,int);
39 extern int PetscGetRelativePath(char*,char*,int);
40 extern int PetscGetWorkingDirectory(char *, int);
41 extern int PetscGetRealPath(char *,char*);
42 extern int PetscGetHomeDirectory(int,char*);
43 extern int PetscTestFile( char *, char,PetscTruth*);
44 extern int PetscBinaryRead(int,void*,int,PetscDataType);
45 extern int PetscBinaryWrite(int,void*,int,PetscDataType,int);
46 extern int PetscBinaryOpen(char *,int,int *);
47 extern int PetscBinaryClose(int);
48 
49 /*
50    In binary files variables are stored using the following lengths,
51   regardless of how they are stored in memory on any one particular
52   machine. Use these rather then sizeof() in computing sizes for
53   PetscBinarySeek().
54 */
55 #define BINARY_INT_SIZE    32
56 #define BINARY_FLOAT_SIZE  32
57 #define BINARY_CHAR_SIZE    8
58 #define BINARY_SHORT_SIZE  16
59 #define BINARY_DOUBLE_SIZE 64
60 #define BINARY_SCALAR_SIZE sizeof(Scalar)
61 
62 typedef enum {BINARY_SEEK_SET = 0, BINARY_SEEK_CUR = 1, BINARY_SEEK_END = 2} PetscBinarySeekType;
63 extern int PetscBinarySeek(int,int,PetscBinarySeekType);
64 
65 extern int PetscSetDebugger(char *,int,char *);
66 extern int PetscAttachDebugger(void);
67 
68 #endif
69 
70