xref: /petsc/include/petsclogdeprecated.h (revision 6d8694c4fbab79f9439f1ad13c0386ba7ee1ca4b)
1 #pragma once
2 
3 #include <petsclog.h>
4 
5 /* MANSEC = Sys */
6 /* SUBMANSEC = Log */
7 
8 /* These data structures are no longer used by any non-deprecated PETSc interface functions */
9 
10 typedef struct {
11   char        *name;
12   PetscClassId classid;
13 } PetscClassRegInfo;
14 
15 typedef struct _n_PetscClassRegLog *PetscClassRegLog;
16 struct _n_PetscClassRegLog {
17   int                numClasses;
18   int                maxClasses;
19   PetscClassRegInfo *classInfo;
20 };
21 
22 typedef struct {
23   PetscClassId   id;
24   int            creations;
25   int            destructions;
26   PetscLogDouble mem;
27   PetscLogDouble descMem;
28 } PetscClassPerfInfo;
29 
30 typedef struct _n_PetscClassPerfLog *PetscClassPerfLog;
31 struct _n_PetscClassPerfLog {
32   int                 numClasses;
33   int                 maxClasses;
34   PetscClassPerfInfo *classInfo;
35 };
36 
37 typedef struct {
38   char        *name;
39   PetscClassId classid;
40   PetscBool    collective;
41 #if defined(PETSC_HAVE_TAU_PERFSTUBS)
42   void *timer;
43 #endif
44 #if defined(PETSC_HAVE_MPE)
45   int mpe_id_begin;
46   int mpe_id_end;
47 #endif
48 } PetscEventRegInfo;
49 
50 typedef struct _n_PetscEventRegLog *PetscEventRegLog;
51 struct _n_PetscEventRegLog {
52   int                numEvents;
53   int                maxEvents;
54   PetscEventRegInfo *eventInfo; /* The registration information for each event */
55 };
56 
57 typedef struct _n_PetscEventPerfLog *PetscEventPerfLog;
58 struct _n_PetscEventPerfLog {
59   int                 numEvents;
60   int                 maxEvents;
61   PetscEventPerfInfo *eventInfo;
62 };
63 
64 typedef struct _PetscStageInfo {
65   char              *name;
66   PetscBool          used;
67   PetscEventPerfInfo perfInfo;
68   PetscClassPerfLog  classLog;
69 #if defined(PETSC_HAVE_TAU_PERFSTUBS)
70   void *timer;
71 #endif
72 } PetscStageInfo;
73 
74 typedef struct _n_PetscStageLog *PetscStageLog;
75 struct _n_PetscStageLog {
76   int              numStages;
77   int              maxStages;
78   PetscIntStack    stack;
79   int              curStage;
80   PetscStageInfo  *stageInfo;
81   PetscEventRegLog eventLog;
82   PetscClassRegLog classLog;
83 };
84 
85 PETSC_DEPRECATED_OBJECT(3, 20, 0, "PetscLogGetState()", "PetscStageLog is no longer used.") PETSC_UNUSED static PetscStageLog petsc_stageLog = PETSC_NULLPTR;
86 
87 /*@C
88   PetscLogGetStageLog - Deprecated.
89 
90   Level: deprecated
91 
92   Note:
93   PETSc performance logging and profiling is now split up between the logging state (`PetscLogState`) and the log handler (`PetscLogHandler`).
94   The global logging state is obtained with `PetscLogGetState()`; many log handlers may be used at once (`PetscLogHandlerStart()`) and the default log handler is not directly accessible.
95 
96 .seealso: [](ch_profiling), `PetscLogEventGetPerfInfo()`
97 @*/
PetscLogGetStageLog(PetscStageLog * s)98 PETSC_DEPRECATED_FUNCTION(3, 20, 0, "PetscLogGetState()", "PetscStageLog is no longer used.") static inline PetscErrorCode PetscLogGetStageLog(PetscStageLog *s)
99 {
100   *s = PETSC_NULLPTR;
101   return PETSC_SUCCESS;
102 }
103 
104 /*@C
105   PetscStageLogGetCurrent - Deprecated
106 
107   Level: deprecated
108 
109 .seealso: [](ch_profiling)
110 @*/
PetscStageLogGetCurrent(PetscStageLog a,int * b)111 PETSC_DEPRECATED_FUNCTION(3, 20, 0, "PetscLogStateGetCurrentStage()", "PetscStageLog is no longer used.") static inline PetscErrorCode PetscStageLogGetCurrent(PetscStageLog a, int *b)
112 {
113   (void)a;
114   *b = -1;
115   return PETSC_SUCCESS;
116 }
117 
118 /*@C
119   PetscStageLogGetEventPerfLog - Deprecated
120 
121   Level: deprecated
122 
123   Note:
124   PETSc performance logging and profiling is now split up between the logging state (`PetscLogState`) and the log handler (`PetscLogHandler`).
125   The global logging state is obtained with `PetscLogGetState()`; many log handlers may be used at once (`PetscLogHandlerStart()`) and the default log handler is not directly accessible.
126 
127 .seealso: [](ch_profiling)
128 @*/
PetscStageLogGetEventPerfLog(PetscStageLog a,int b,PetscEventPerfLog * c)129 PETSC_DEPRECATED_FUNCTION(3, 20, 0, "PetscLogStateEventGetInfo()", "PetscStageLog is no longer used.") static inline PetscErrorCode PetscStageLogGetEventPerfLog(PetscStageLog a, int b, PetscEventPerfLog *c)
130 {
131   (void)a;
132   (void)b;
133   *c = PETSC_NULLPTR;
134   return PETSC_SUCCESS;
135 }
136 
137 PETSC_DEPRECATED_OBJECT(3, 20, 0, "PetscLogLegacyCallbacksBegin()", ) PETSC_UNUSED static PetscErrorCode (*PetscLogPLB)(PetscLogEvent, int, PetscObject, PetscObject, PetscObject, PetscObject) = PETSC_NULLPTR;
138 PETSC_DEPRECATED_OBJECT(3, 20, 0, "PetscLogLegacyCallbacksBegin()", ) PETSC_UNUSED static PetscErrorCode (*PetscLogPLE)(PetscLogEvent, int, PetscObject, PetscObject, PetscObject, PetscObject) = PETSC_NULLPTR;
139 PETSC_DEPRECATED_OBJECT(3, 20, 0, "PetscLogLegacyCallbacksBegin()", ) PETSC_UNUSED static PetscErrorCode (*PetscLogPHC)(PetscObject)                                                            = PETSC_NULLPTR;
140 PETSC_DEPRECATED_OBJECT(3, 20, 0, "PetscLogLegacyCallbacksBegin()", ) PETSC_UNUSED static PetscErrorCode (*PetscLogPHD)(PetscObject)                                                            = PETSC_NULLPTR;
141 
PetscLogPushCurrentEvent_Internal(PetscLogEvent e)142 PETSC_DEPRECATED_FUNCTION(3, 20, 0, "nothing", "PETSc does not guarantee a stack property of logging events.") static inline PetscErrorCode PetscLogPushCurrentEvent_Internal(PetscLogEvent e)
143 {
144   (void)e;
145   return PETSC_SUCCESS;
146 }
147 
PetscLogPopCurrentEvent_Internal(void)148 PETSC_DEPRECATED_FUNCTION(3, 20, 0, "nothing", "PETSc does not guarantee a stack property of logging events.") static inline PetscErrorCode PetscLogPopCurrentEvent_Internal(void)
149 {
150   return PETSC_SUCCESS;
151 }
152 
153 /*@C
154   PetscLogAllBegin - Equivalent to `PetscLogDefaultBegin()`.
155 
156   Logically Collective on `PETSC_COMM_WORLD`
157 
158   Level: deprecated
159 
160   Note:
161   In previous versions, PETSc's documentation stated that `PetscLogAllBegin()` "Turns on extensive logging of objects and events," which was not actually true.
162   The actual way to turn on extensive logging of objects and events was, and remains, to call `PetscLogActions()` and `PetscLogObjects()`.
163 
164 .seealso: [](ch_profiling), `PetscLogDump()`, `PetscLogDefaultBegin()`, `PetscLogActions()`, `PetscLogObjects()`
165 @*/
PetscLogAllBegin(void)166 PETSC_DEPRECATED_FUNCTION(3, 20, 0, "PetscLogDefaultBegin()", ) static inline PetscErrorCode PetscLogAllBegin(void)
167 {
168   return PetscLogDefaultBegin();
169 }
170 
171 /*@C
172   PetscLogSet - Deprecated.
173 
174   Level: deprecated
175 
176   Note:
177   PETSc performance logging and profiling is now split up between the logging state (`PetscLogState`) and the log handler (`PetscLogHandler`).
178   The global logging state is obtained with `PetscLogGetState()`; many log handlers may be used at once (`PetscLogHandlerStart()`) and the default log handler is not directly accessible.
179 
180 .seealso: [](ch_profiling), `PetscLogEventGetPerfInfo()`
181 @*/
182 PETSC_DEPRECATED_FUNCTION(3, 20, 0, "PetscLogLegacyCallbacksBegin()", )
PetscLogSet(PetscErrorCode (* a)(int,int,PetscObject,PetscObject,PetscObject,PetscObject),PetscErrorCode (* b)(int,int,PetscObject,PetscObject,PetscObject,PetscObject))183 static inline PetscErrorCode PetscLogSet(PetscErrorCode (*a)(int, int, PetscObject, PetscObject, PetscObject, PetscObject), PetscErrorCode (*b)(int, int, PetscObject, PetscObject, PetscObject, PetscObject))
184 {
185   return PetscLogLegacyCallbacksBegin(a, b, PETSC_NULLPTR, PETSC_NULLPTR);
186 }
187