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