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