Actual source code: logimpl.h
1: #include <petscsys.h>
2: #include <petsctime.h>
4: /* A simple stack */
5: struct _n_PetscIntStack {
6: int top; /* The top of the stack */
7: int max; /* The maximum stack size */
8: int *stack; /* The storage */
9: };
11: /* The structure for action logging */
12: #define CREATE 0
13: #define DESTROY 1
14: #define ACTIONBEGIN 2
15: #define ACTIONEND 3
16: typedef struct _Action {
17: int action; /* The type of execution */
18: PetscLogEvent event; /* The event number */
19: PetscClassId classid; /* The event class id */
20: PetscLogDouble time; /* The time of occurence */
21: PetscLogDouble flops; /* The cumlative flops */
22: PetscLogDouble mem; /* The current memory usage */
23: PetscLogDouble maxmem; /* The maximum memory usage */
24: int id1, id2, id3; /* The ids of associated objects */
25: } Action;
27: /* The structure for object logging */
28: typedef struct _Object {
29: PetscObject obj; /* The associated PetscObject */
30: int parent; /* The parent id */
31: PetscLogDouble mem; /* The memory associated with the object */
32: char name[64]; /* The object name */
33: char info[64]; /* The information string */
34: } Object;
36: /* Action and object logging variables */
51: #ifdef PETSC_USE_LOG
53: /* Runtime functions */
59: /* Creation and destruction functions */
64: /* General functions */
68: /* Registration functions */
70: /* Query functions */
73: /* Activaton functions */
79: /* Logging functions */
87: /* Creation and destruction functions */
93: /* General functions */
96: /* Registration functions */
98: /* Query functions */
100: /* Logging functions */
104: /* Creation and destruction functions */
107: /* Registration functions */
109: /* Runtime functions */
124: #endif /* PETSC_USE_LOG */