119ef957cSToby Isaac #include <petscviewer.h>
219ef957cSToby Isaac #include <petsc/private/logimpl.h> /*I "petscsys.h" I*/
319ef957cSToby Isaac #include <petsc/private/loghandlerimpl.h>
4dff009beSToby Isaac #include <petsc/private/petscimpl.h>
519ef957cSToby Isaac
619ef957cSToby Isaac /*@
719ef957cSToby Isaac PetscLogHandlerCreate - Create a log handler for profiling events and stages. PETSc
819ef957cSToby Isaac provides several implementations of `PetscLogHandler` that interface to different ways to
919ef957cSToby Isaac summarize or visualize profiling data: see `PetscLogHandlerType` for a list.
1019ef957cSToby Isaac
1119ef957cSToby Isaac Collective
1219ef957cSToby Isaac
1319ef957cSToby Isaac Input Parameter:
1419ef957cSToby Isaac . comm - the communicator for synchronizing and viewing events with this handler
1519ef957cSToby Isaac
1619ef957cSToby Isaac Output Parameter:
1719ef957cSToby Isaac . handler - the `PetscLogHandler`
1819ef957cSToby Isaac
1919ef957cSToby Isaac Level: developer
2019ef957cSToby Isaac
2119ef957cSToby Isaac Notes:
2219ef957cSToby Isaac This does not put the handler in use in PETSc's global logging system: use `PetscLogHandlerStart()` after creation.
2319ef957cSToby Isaac
2419ef957cSToby Isaac See `PetscLogHandler` for example usage.
2519ef957cSToby Isaac
2619ef957cSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogHandlerSetType()`, `PetscLogHandlerStart()`, `PetscLogHandlerStop()`
2719ef957cSToby Isaac @*/
PetscLogHandlerCreate(MPI_Comm comm,PetscLogHandler * handler)2819ef957cSToby Isaac PetscErrorCode PetscLogHandlerCreate(MPI_Comm comm, PetscLogHandler *handler)
2919ef957cSToby Isaac {
3019ef957cSToby Isaac PetscLogHandler h;
3119ef957cSToby Isaac
3219ef957cSToby Isaac PetscFunctionBegin;
3319ef957cSToby Isaac *handler = NULL;
3419ef957cSToby Isaac PetscCall(PetscLogHandlerPackageInitialize());
3519ef957cSToby Isaac // We do not use PetscHeaderCreate() here because having PetscLogObjectCreate() run for PetscLogHandler would be very fragile
3619ef957cSToby Isaac PetscCall(PetscNew(&h));
378434afd1SBarry Smith PetscCall(PetscHeaderCreate_Private((PetscObject)(h), PETSCLOGHANDLER_CLASSID, "PetscLogHandler", "Profile events, stages, and objects", "Profiling", comm, (PetscObjectDestroyFn *)PetscLogHandlerDestroy, (PetscObjectViewFn *)PetscLogHandlerView));
3819ef957cSToby Isaac *handler = h;
3919ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
4019ef957cSToby Isaac }
4119ef957cSToby Isaac
4219ef957cSToby Isaac /*@
4319ef957cSToby Isaac PetscLogHandlerDestroy - Destroy a `PetscLogHandler`
4419ef957cSToby Isaac
4519ef957cSToby Isaac Logically collective
4619ef957cSToby Isaac
4719ef957cSToby Isaac Input Parameter:
4819ef957cSToby Isaac . handler - handler to be destroyed
4919ef957cSToby Isaac
5019ef957cSToby Isaac Level: developer
5119ef957cSToby Isaac
5219ef957cSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogHandlerCreate()`
5319ef957cSToby Isaac @*/
PetscLogHandlerDestroy(PetscLogHandler * handler)5419ef957cSToby Isaac PetscErrorCode PetscLogHandlerDestroy(PetscLogHandler *handler)
5519ef957cSToby Isaac {
5619ef957cSToby Isaac PetscLogHandler h;
5719ef957cSToby Isaac
5819ef957cSToby Isaac PetscFunctionBegin;
5919ef957cSToby Isaac if (!*handler) PetscFunctionReturn(PETSC_SUCCESS);
6019ef957cSToby Isaac h = *handler;
6119ef957cSToby Isaac *handler = NULL;
6219ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
6319ef957cSToby Isaac if (--((PetscObject)h)->refct > 0) PetscFunctionReturn(PETSC_SUCCESS);
6419ef957cSToby Isaac PetscTryTypeMethod(h, destroy);
6519ef957cSToby Isaac PetscCall(PetscLogStateDestroy(&h->state));
6619ef957cSToby Isaac // We do not use PetscHeaderDestroy() because having PetscLogObjectDestroy() run for PetscLgoHandler would be very fragile
6719ef957cSToby Isaac PetscCall(PetscHeaderDestroy_Private((PetscObject)(h), PETSC_FALSE));
6819ef957cSToby Isaac PetscCall(PetscFree(h));
6919ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
7019ef957cSToby Isaac }
7119ef957cSToby Isaac
7219ef957cSToby Isaac /*@
7319ef957cSToby Isaac PetscLogHandlerSetState - Set the logging state that provides the stream of events and stages for a log handler.
7419ef957cSToby Isaac
7519ef957cSToby Isaac Logically collective
7619ef957cSToby Isaac
7719ef957cSToby Isaac Input Parameters:
7819ef957cSToby Isaac + h - the `PetscLogHandler`
7919ef957cSToby Isaac - state - the `PetscLogState`
8019ef957cSToby Isaac
8119ef957cSToby Isaac Level: developer
8219ef957cSToby Isaac
83b665b14eSToby Isaac Note:
84b665b14eSToby Isaac Most users well not need to set a state explicitly: the global logging state (`PetscLogGetState()`) is set when calling `PetscLogHandlerStart()`
85b665b14eSToby Isaac
86b665b14eSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogState`, `PetscLogEventBegin()`, `PetscLogHandlerStart()`
8719ef957cSToby Isaac @*/
PetscLogHandlerSetState(PetscLogHandler h,PetscLogState state)8819ef957cSToby Isaac PetscErrorCode PetscLogHandlerSetState(PetscLogHandler h, PetscLogState state)
8919ef957cSToby Isaac {
9019ef957cSToby Isaac PetscFunctionBegin;
9119ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
9219ef957cSToby Isaac if (state) {
9319ef957cSToby Isaac PetscAssertPointer(state, 2);
9419ef957cSToby Isaac state->refct++;
9519ef957cSToby Isaac }
9619ef957cSToby Isaac PetscCall(PetscLogStateDestroy(&h->state));
9719ef957cSToby Isaac h->state = state;
9819ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
9919ef957cSToby Isaac }
10019ef957cSToby Isaac
10119ef957cSToby Isaac /*@
10219ef957cSToby Isaac PetscLogHandlerGetState - Get the logging state that provides the stream of events and stages for a log handler.
10319ef957cSToby Isaac
10419ef957cSToby Isaac Logically collective
10519ef957cSToby Isaac
10619ef957cSToby Isaac Input Parameter:
10719ef957cSToby Isaac . h - the `PetscLogHandler`
10819ef957cSToby Isaac
10919ef957cSToby Isaac Output Parameter:
11019ef957cSToby Isaac . state - the `PetscLogState`
11119ef957cSToby Isaac
11219ef957cSToby Isaac Level: developer
11319ef957cSToby Isaac
114b665b14eSToby Isaac Note:
115b665b14eSToby Isaac For a log handler started with `PetscLogHandlerStart()`, this will be the PETSc global logging state (`PetscLogGetState()`)
116b665b14eSToby Isaac
117b665b14eSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogState`, `PetscLogEventBegin()`, `PetscLogHandlerStart()`
11819ef957cSToby Isaac @*/
PetscLogHandlerGetState(PetscLogHandler h,PetscLogState * state)11919ef957cSToby Isaac PetscErrorCode PetscLogHandlerGetState(PetscLogHandler h, PetscLogState *state)
12019ef957cSToby Isaac {
12119ef957cSToby Isaac PetscFunctionBegin;
12219ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
12319ef957cSToby Isaac PetscAssertPointer(state, 2);
12419ef957cSToby Isaac *state = h->state;
12519ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
12619ef957cSToby Isaac }
12719ef957cSToby Isaac
12819ef957cSToby Isaac /*@
12919ef957cSToby Isaac PetscLogHandlerEventBegin - Record the beginning of an event in a log handler
13019ef957cSToby Isaac
13119ef957cSToby Isaac Not collective
13219ef957cSToby Isaac
13319ef957cSToby Isaac Input Parameters:
13419ef957cSToby Isaac + h - the `PetscLogHandler`
13519ef957cSToby Isaac . e - a registered `PetscLogEvent`
13619ef957cSToby Isaac . o1 - `PetscObject` associated with the event (may be `NULL`)
13719ef957cSToby Isaac . o2 - `PetscObject` associated with the event (may be `NULL`)
13819ef957cSToby Isaac . o3 - `PetscObject` associated with the event (may be `NULL`)
13919ef957cSToby Isaac - o4 - `PetscObject` associated with the event (may be `NULL`)
14019ef957cSToby Isaac
14119ef957cSToby Isaac Level: developer
14219ef957cSToby Isaac
143b665b14eSToby Isaac Note:
144b665b14eSToby Isaac Most users will use `PetscLogEventBegin()`, which will call this function for all handlers registered with `PetscLogHandlerStart()`
145b665b14eSToby Isaac
146b665b14eSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogEventBegin()`, `PetscLogEventEnd()`, `PetscLogEventSync()`, `PetscLogHandlerEventEnd()`, `PetscLogHandlerEventSync()`
14719ef957cSToby Isaac @*/
PetscLogHandlerEventBegin(PetscLogHandler h,PetscLogEvent e,PetscObject o1,PetscObject o2,PetscObject o3,PetscObject o4)14819ef957cSToby Isaac PetscErrorCode PetscLogHandlerEventBegin(PetscLogHandler h, PetscLogEvent e, PetscObject o1, PetscObject o2, PetscObject o3, PetscObject o4)
14919ef957cSToby Isaac {
15019ef957cSToby Isaac PetscFunctionBegin;
15119ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
15219ef957cSToby Isaac PetscTryTypeMethod(h, eventbegin, e, o1, o2, o3, o4);
15319ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
15419ef957cSToby Isaac }
15519ef957cSToby Isaac
15619ef957cSToby Isaac /*@
15719ef957cSToby Isaac PetscLogHandlerEventEnd - Record the end of an event in a log handler
15819ef957cSToby Isaac
15919ef957cSToby Isaac Not collective
16019ef957cSToby Isaac
16119ef957cSToby Isaac Input Parameters:
16219ef957cSToby Isaac + h - the `PetscLogHandler`
16319ef957cSToby Isaac . e - a registered `PetscLogEvent`
16419ef957cSToby Isaac . o1 - `PetscObject` associated with the event (may be `NULL`)
16519ef957cSToby Isaac . o2 - `PetscObject` associated with the event (may be `NULL`)
16619ef957cSToby Isaac . o3 - `PetscObject` associated with the event (may be `NULL`)
16719ef957cSToby Isaac - o4 - `PetscObject` associated with the event (may be `NULL`)
16819ef957cSToby Isaac
16919ef957cSToby Isaac Level: developer
17019ef957cSToby Isaac
171b665b14eSToby Isaac Note:
172b665b14eSToby Isaac Most users will use `PetscLogEventEnd()`, which will call this function for all handlers registered with `PetscLogHandlerStart()`
173b665b14eSToby Isaac
174b665b14eSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogEventBegin()`, `PetscLogEventEnd()`, `PetscLogEventSync()`, `PetscLogHandlerEventBegin()`, `PetscLogHandlerEventSync()`
17519ef957cSToby Isaac @*/
PetscLogHandlerEventEnd(PetscLogHandler h,PetscLogEvent e,PetscObject o1,PetscObject o2,PetscObject o3,PetscObject o4)17619ef957cSToby Isaac PetscErrorCode PetscLogHandlerEventEnd(PetscLogHandler h, PetscLogEvent e, PetscObject o1, PetscObject o2, PetscObject o3, PetscObject o4)
17719ef957cSToby Isaac {
17819ef957cSToby Isaac PetscFunctionBegin;
17919ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
18019ef957cSToby Isaac PetscTryTypeMethod(h, eventend, e, o1, o2, o3, o4);
18119ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
18219ef957cSToby Isaac }
18319ef957cSToby Isaac
18419ef957cSToby Isaac /*@
18519ef957cSToby Isaac PetscLogHandlerEventSync - Synchronize a logging event
18619ef957cSToby Isaac
1878f14a041SBarry Smith Collective
18819ef957cSToby Isaac
18919ef957cSToby Isaac Input Parameters:
19019ef957cSToby Isaac + h - the `PetscLogHandler`
19119ef957cSToby Isaac . e - a registered `PetscLogEvent`
19219ef957cSToby Isaac - comm - the communicator over which to synchronize `e`
19319ef957cSToby Isaac
19419ef957cSToby Isaac Level: developer
19519ef957cSToby Isaac
196b665b14eSToby Isaac Note:
197b665b14eSToby Isaac Most users will use `PetscLogEventSync()`, which will call this function for all handlers registered with `PetscLogHandlerStart()`
198b665b14eSToby Isaac
199b665b14eSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogEventBegin()`, `PetscLogEventEnd()`, `PetscLogEventSync()`, `PetscLogHandlerEventBegin()`, `PetscLogHandlerEventEnd()`
20019ef957cSToby Isaac @*/
PetscLogHandlerEventSync(PetscLogHandler h,PetscLogEvent e,MPI_Comm comm)20119ef957cSToby Isaac PetscErrorCode PetscLogHandlerEventSync(PetscLogHandler h, PetscLogEvent e, MPI_Comm comm)
20219ef957cSToby Isaac {
20319ef957cSToby Isaac MPI_Comm h_comm;
20419ef957cSToby Isaac PetscMPIInt size;
20519ef957cSToby Isaac
20619ef957cSToby Isaac PetscFunctionBegin;
20719ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
20819ef957cSToby Isaac PetscCall(PetscObjectGetComm((PetscObject)h, &h_comm));
20919ef957cSToby Isaac PetscCallMPI(MPI_Comm_size(comm, &size));
21019ef957cSToby Isaac if (comm == MPI_COMM_NULL || size == 1) PetscFunctionReturn(PETSC_SUCCESS); // nothing to sync
21119ef957cSToby Isaac if (PetscDefined(USE_DEBUG)) {
21219ef957cSToby Isaac PetscMPIInt h_comm_world, compare;
21319ef957cSToby Isaac PetscCallMPI(MPI_Comm_compare(h_comm, PETSC_COMM_WORLD, &h_comm_world));
21419ef957cSToby Isaac PetscCallMPI(MPI_Comm_compare(h_comm, comm, &compare));
21519ef957cSToby Isaac // only synchronze if h->comm and comm have the same processes or h->comm is PETSC_COMM_WORLD
21619ef957cSToby Isaac PetscCheck(h_comm_world != MPI_UNEQUAL || compare != MPI_UNEQUAL, comm, PETSC_ERR_SUP, "PetscLogHandlerSync does not support arbitrary mismatched communicators");
21719ef957cSToby Isaac }
21819ef957cSToby Isaac PetscTryTypeMethod(h, eventsync, e, comm);
21919ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
22019ef957cSToby Isaac }
22119ef957cSToby Isaac
22219ef957cSToby Isaac /*@
22319ef957cSToby Isaac PetscLogHandlerObjectCreate - Record the creation of an object in a log handler.
22419ef957cSToby Isaac
22519ef957cSToby Isaac Not collective
22619ef957cSToby Isaac
22719ef957cSToby Isaac Input Parameters:
22819ef957cSToby Isaac + h - the `PetscLogHandler`
22919ef957cSToby Isaac - obj - a newly created `PetscObject`
23019ef957cSToby Isaac
23119ef957cSToby Isaac Level: developer
23219ef957cSToby Isaac
233b665b14eSToby Isaac Notes:
234b665b14eSToby Isaac Most users will use `PetscLogObjectCreate()`, which will call this function for all handlers registered with `PetscLogHandlerStart()`.
235b665b14eSToby Isaac
236b665b14eSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogObjectCreate()`, `PetscLogObjectDestroy()`, `PetscLogHandlerObjectDestroy()`
23719ef957cSToby Isaac @*/
PetscLogHandlerObjectCreate(PetscLogHandler h,PetscObject obj)23819ef957cSToby Isaac PetscErrorCode PetscLogHandlerObjectCreate(PetscLogHandler h, PetscObject obj)
23919ef957cSToby Isaac {
24019ef957cSToby Isaac PetscFunctionBegin;
24119ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
24219ef957cSToby Isaac PetscTryTypeMethod(h, objectcreate, obj);
24319ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
24419ef957cSToby Isaac }
24519ef957cSToby Isaac
24619ef957cSToby Isaac /*@
24719ef957cSToby Isaac PetscLogHandlerObjectDestroy - Record the destruction of an object in a log handler.
24819ef957cSToby Isaac
24919ef957cSToby Isaac Not collective
25019ef957cSToby Isaac
25119ef957cSToby Isaac Input Parameters:
25219ef957cSToby Isaac + h - the `PetscLogHandler`
25319ef957cSToby Isaac - obj - a newly created `PetscObject`
25419ef957cSToby Isaac
25519ef957cSToby Isaac Level: developer
25619ef957cSToby Isaac
257b665b14eSToby Isaac Notes:
258b665b14eSToby Isaac Most users will use `PetscLogObjectDestroy()`, which will call this function for all handlers registered with `PetscLogHandlerStart()`.
259b665b14eSToby Isaac
260b665b14eSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogObjectCreate()`, `PetscLogObjectDestroy()`, `PetscLogHandlerObjectCreate()`
26119ef957cSToby Isaac @*/
PetscLogHandlerObjectDestroy(PetscLogHandler h,PetscObject obj)26219ef957cSToby Isaac PetscErrorCode PetscLogHandlerObjectDestroy(PetscLogHandler h, PetscObject obj)
26319ef957cSToby Isaac {
26419ef957cSToby Isaac PetscFunctionBegin;
26519ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
26619ef957cSToby Isaac PetscTryTypeMethod(h, objectdestroy, obj);
26719ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
26819ef957cSToby Isaac }
26919ef957cSToby Isaac
27019ef957cSToby Isaac /*@
27119ef957cSToby Isaac PetscLogHandlerStagePush - Begin a new logging stage in a log handler.
27219ef957cSToby Isaac
27319ef957cSToby Isaac Not collective
27419ef957cSToby Isaac
27519ef957cSToby Isaac Input Parameters:
27619ef957cSToby Isaac + h - the `PetscLogHandler`
27719ef957cSToby Isaac - stage - a registered `PetscLogStage`
27819ef957cSToby Isaac
27919ef957cSToby Isaac Level: developer
28019ef957cSToby Isaac
28119ef957cSToby Isaac Notes:
282b665b14eSToby Isaac Most users will use `PetscLogStagePush()`, which will call this function for all handlers registered with `PetscLogHandlerStart()`.
283b665b14eSToby Isaac
28419ef957cSToby Isaac This function is called right before the stage is pushed for the handler's `PetscLogState`, so `PetscLogStateGetCurrentStage()`
28519ef957cSToby Isaac can be used to see what the previous stage was.
28619ef957cSToby Isaac
287b665b14eSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogStagePush()`, `PetscLogStagePop()`, `PetscLogHandlerStagePop()`
28819ef957cSToby Isaac @*/
PetscLogHandlerStagePush(PetscLogHandler h,PetscLogStage stage)28919ef957cSToby Isaac PetscErrorCode PetscLogHandlerStagePush(PetscLogHandler h, PetscLogStage stage)
29019ef957cSToby Isaac {
29119ef957cSToby Isaac PetscFunctionBegin;
29219ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
29319ef957cSToby Isaac PetscTryTypeMethod(h, stagepush, stage);
29419ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
29519ef957cSToby Isaac }
29619ef957cSToby Isaac
29719ef957cSToby Isaac /*@
29819ef957cSToby Isaac PetscLogHandlerStagePop - End the current logging stage in a log handler.
29919ef957cSToby Isaac
30019ef957cSToby Isaac Not collective
30119ef957cSToby Isaac
30219ef957cSToby Isaac Input Parameters:
30319ef957cSToby Isaac + h - the `PetscLogHandler`
30419ef957cSToby Isaac - stage - a registered `PetscLogStage`
30519ef957cSToby Isaac
30619ef957cSToby Isaac Level: developer
30719ef957cSToby Isaac
30819ef957cSToby Isaac Notes:
309b665b14eSToby Isaac Most users will use `PetscLogStagePop()`, which will call this function for all handlers registered with `PetscLogHandlerStart()`.
310b665b14eSToby Isaac
31119ef957cSToby Isaac This function is called right after the stage is popped for the handler's `PetscLogState`, so `PetscLogStateGetCurrentStage()`
31219ef957cSToby Isaac can be used to see what the next stage will be.
31319ef957cSToby Isaac
314b665b14eSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogStagePush()`, `PetscLogStagePop()`, `PetscLogHandlerStagePush()`
31519ef957cSToby Isaac @*/
PetscLogHandlerStagePop(PetscLogHandler h,PetscLogStage stage)31619ef957cSToby Isaac PetscErrorCode PetscLogHandlerStagePop(PetscLogHandler h, PetscLogStage stage)
31719ef957cSToby Isaac {
31819ef957cSToby Isaac PetscFunctionBegin;
31919ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
32019ef957cSToby Isaac PetscTryTypeMethod(h, stagepop, stage);
32119ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
32219ef957cSToby Isaac }
32319ef957cSToby Isaac
32419ef957cSToby Isaac /*@
32519ef957cSToby Isaac PetscLogHandlerView - View the data recorded in a log handler.
32619ef957cSToby Isaac
32719ef957cSToby Isaac Collective
32819ef957cSToby Isaac
32919ef957cSToby Isaac Input Parameters:
33019ef957cSToby Isaac + h - the `PetscLogHandler`
33119ef957cSToby Isaac - viewer - the `PetscViewer`
33219ef957cSToby Isaac
33319ef957cSToby Isaac Level: developer
33419ef957cSToby Isaac
33519ef957cSToby Isaac .seealso: [](ch_profiling), `PetscLogHandler`, `PetscLogView()`
33619ef957cSToby Isaac @*/
PetscLogHandlerView(PetscLogHandler h,PetscViewer viewer)33719ef957cSToby Isaac PetscErrorCode PetscLogHandlerView(PetscLogHandler h, PetscViewer viewer)
33819ef957cSToby Isaac {
33919ef957cSToby Isaac PetscFunctionBegin;
34019ef957cSToby Isaac PetscValidHeaderSpecific(h, PETSCLOGHANDLER_CLASSID, 1);
34119ef957cSToby Isaac PetscValidHeaderSpecific(viewer, PETSC_VIEWER_CLASSID, 2);
34219ef957cSToby Isaac PetscTryTypeMethod(h, view, viewer);
34319ef957cSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
34419ef957cSToby Isaac }
345dff009beSToby Isaac
346dff009beSToby Isaac /*@C
347dff009beSToby Isaac PetscLogHandlerGetEventPerfInfo - Get a direct reference to the `PetscEventPerfInfo` of a stage and event
348dff009beSToby Isaac
349a3b724e8SBarry Smith Not collective, No Fortran Support
350dff009beSToby Isaac
351dff009beSToby Isaac Input Parameters:
352dff009beSToby Isaac + handler - a `PetscLogHandler`
353dff009beSToby Isaac . stage - a `PetscLogStage` (or `PETSC_DEFAULT` for the current stage)
354dff009beSToby Isaac - event - a `PetscLogEvent`
355dff009beSToby Isaac
356dff009beSToby Isaac Output Parameter:
357dff009beSToby Isaac . event_info - a pointer to a performance log for `event` during `stage` (or `NULL` if this handler does not use
358dff009beSToby Isaac `PetscEventPerfInfo` to record performance data); writing to `event_info` will change the record in
359dff009beSToby Isaac `handler`
360dff009beSToby Isaac
361dff009beSToby Isaac Level: developer
362dff009beSToby Isaac
363dff009beSToby Isaac .seealso: [](ch_profiling), `PetscLogEventGetPerfInfo()`, `PETSCLOGHANDLERDEFAULT`
364dff009beSToby Isaac @*/
PetscLogHandlerGetEventPerfInfo(PetscLogHandler handler,PetscLogStage stage,PetscLogEvent event,PetscEventPerfInfo ** event_info)365dff009beSToby Isaac PetscErrorCode PetscLogHandlerGetEventPerfInfo(PetscLogHandler handler, PetscLogStage stage, PetscLogEvent event, PetscEventPerfInfo **event_info)
366dff009beSToby Isaac {
367dff009beSToby Isaac PetscFunctionBegin;
368dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
369dff009beSToby Isaac PetscAssertPointer(event_info, 4);
370dff009beSToby Isaac *event_info = NULL;
371dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerGetEventPerfInfo_C", (PetscLogHandler, PetscLogStage, PetscLogEvent, PetscEventPerfInfo **), (handler, stage, event, event_info));
372dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
373dff009beSToby Isaac }
374dff009beSToby Isaac
3758b08f494SToby Isaac /*@C
3768b08f494SToby Isaac PetscLogHandlerGetStagePerfInfo - Get a direct reference to the `PetscEventPerfInfo` of a stage
3778b08f494SToby Isaac
378a3b724e8SBarry Smith Not collective, No Fortran Support
3798b08f494SToby Isaac
3808b08f494SToby Isaac Input Parameters:
3818b08f494SToby Isaac + handler - a `PetscLogHandler`
3828b08f494SToby Isaac - stage - a `PetscLogStage` (or `PETSC_DEFAULT` for the current stage)
3838b08f494SToby Isaac
3848b08f494SToby Isaac Output Parameter:
3858b08f494SToby Isaac . stage_info - a pointer to a performance log for `stage` (or `NULL` if this handler does not use `PetscEventPerfInfo`
3868b08f494SToby Isaac to record performance data); writing to `stage_info` will change the record in `handler`
3878b08f494SToby Isaac
3888b08f494SToby Isaac Level: developer
3898b08f494SToby Isaac
3908b08f494SToby Isaac .seealso: [](ch_profiling), `PetscLogEventGetPerfInfo()`, `PETSCLOGHANDLERDEFAULT`
3918b08f494SToby Isaac @*/
PetscLogHandlerGetStagePerfInfo(PetscLogHandler handler,PetscLogStage stage,PetscEventPerfInfo ** stage_info)3928b08f494SToby Isaac PetscErrorCode PetscLogHandlerGetStagePerfInfo(PetscLogHandler handler, PetscLogStage stage, PetscEventPerfInfo **stage_info)
3938b08f494SToby Isaac {
3948b08f494SToby Isaac PetscFunctionBegin;
3958b08f494SToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
3968b08f494SToby Isaac PetscAssertPointer(stage_info, 3);
3978b08f494SToby Isaac *stage_info = NULL;
3988b08f494SToby Isaac PetscTryMethod(handler, "PetscLogHandlerGetStagePerfInfo_C", (PetscLogHandler, PetscLogStage, PetscEventPerfInfo **), (handler, stage, stage_info));
3998b08f494SToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
4008b08f494SToby Isaac }
4018b08f494SToby Isaac
402dff009beSToby Isaac /*@
403dff009beSToby Isaac PetscLogHandlerSetLogActions - Determines whether actions are logged for a log handler.
404dff009beSToby Isaac
405dff009beSToby Isaac Not Collective
406dff009beSToby Isaac
407dff009beSToby Isaac Input Parameters:
408dff009beSToby Isaac + handler - a `PetscLogHandler`
409dff009beSToby Isaac - flag - `PETSC_TRUE` if actions are to be logged (ignored if `handler` does not log actions)
410dff009beSToby Isaac
411dff009beSToby Isaac Level: developer
412dff009beSToby Isaac
413dff009beSToby Isaac Notes:
414dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
415dff009beSToby Isaac `PetscLogSetLogActions()` to call this function for the default log handler that is connected to the global
416dff009beSToby Isaac logging state (`PetscLogGetState()`).
417dff009beSToby Isaac
418dff009beSToby Isaac Logging of actions continues to consume more memory as the program runs. Long running programs should consider
419dff009beSToby Isaac turning this feature off.
420dff009beSToby Isaac
421dff009beSToby Isaac .seealso: [](ch_profiling), `PetscLogSetLogActions()`, `PetscLogStagePush()`, `PetscLogStagePop()`, `PetscLogGetDefaultHandler()`
422dff009beSToby Isaac @*/
PetscLogHandlerSetLogActions(PetscLogHandler handler,PetscBool flag)423dff009beSToby Isaac PetscErrorCode PetscLogHandlerSetLogActions(PetscLogHandler handler, PetscBool flag)
424dff009beSToby Isaac {
425dff009beSToby Isaac PetscFunctionBegin;
426dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
427dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerSetLogActions_C", (PetscLogHandler, PetscBool), (handler, flag));
428dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
429dff009beSToby Isaac }
430dff009beSToby Isaac
431dff009beSToby Isaac /*@
432dff009beSToby Isaac PetscLogHandlerSetLogObjects - Determines whether objects are logged for a log handler.
433dff009beSToby Isaac
434dff009beSToby Isaac Not Collective
435dff009beSToby Isaac
436dff009beSToby Isaac Input Parameters:
437dff009beSToby Isaac + handler - a `PetscLogHandler`
438dff009beSToby Isaac - flag - `PETSC_TRUE` if objects are to be logged (ignored if `handler` does not log objects)
439dff009beSToby Isaac
440dff009beSToby Isaac Level: developer
441dff009beSToby Isaac
442dff009beSToby Isaac Notes:
443dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
444dff009beSToby Isaac `PetscLogSetLogObjects()` to call this function for the default log handler that is connected to the global
445dff009beSToby Isaac logging state (`PetscLogGetState()`).
446dff009beSToby Isaac
447dff009beSToby Isaac Logging of objects continues to consume more memory as the program runs. Long running programs should consider
448dff009beSToby Isaac turning this feature off.
449dff009beSToby Isaac
450dff009beSToby Isaac .seealso: [](ch_profiling), `PetscLogSetLogObjects()`, `PetscLogStagePush()`, `PetscLogStagePop()`, `PetscLogGetDefaultHandler()`
451dff009beSToby Isaac @*/
PetscLogHandlerSetLogObjects(PetscLogHandler handler,PetscBool flag)452dff009beSToby Isaac PetscErrorCode PetscLogHandlerSetLogObjects(PetscLogHandler handler, PetscBool flag)
453dff009beSToby Isaac {
454dff009beSToby Isaac PetscFunctionBegin;
455dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
456dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerSetLogObjects_C", (PetscLogHandler, PetscBool), (handler, flag));
457dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
458dff009beSToby Isaac }
459dff009beSToby Isaac
PetscLogHandlerLogObjectState_Internal(PetscLogHandler handler,PetscObject obj,const char format[],va_list argp)460dff009beSToby Isaac PetscErrorCode PetscLogHandlerLogObjectState_Internal(PetscLogHandler handler, PetscObject obj, const char format[], va_list argp)
461dff009beSToby Isaac {
462dff009beSToby Isaac PetscFunctionBegin;
463dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerLogObjectState_C", (PetscLogHandler, PetscObject, const char *, va_list), (handler, obj, format, argp));
464dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
465dff009beSToby Isaac }
466dff009beSToby Isaac
467dff009beSToby Isaac /*@C
468dff009beSToby Isaac PetscLogHandlerLogObjectState - Record information about an object with the default log handler
469dff009beSToby Isaac
470a3b724e8SBarry Smith Not Collective, No Fortran Support
471dff009beSToby Isaac
472dff009beSToby Isaac Input Parameters:
473dff009beSToby Isaac + handler - a `PetscLogHandler`
474dff009beSToby Isaac . obj - the `PetscObject`
475dff009beSToby Isaac . format - a printf-style format string
476dff009beSToby Isaac - ... - printf arguments to format
477dff009beSToby Isaac
478dff009beSToby Isaac Level: developer
479dff009beSToby Isaac
480dff009beSToby Isaac Note:
481dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
482dff009beSToby Isaac `PetscLogObjectState()` to call this function for the default log handler that is connected to the global
483dff009beSToby Isaac logging state (`PetscLogGetState()`).
484dff009beSToby Isaac
485*54c05997SPierre Jolivet .seealso: [](ch_profiling), `PetscLogObjectState`, `PetscLogObjectCreate()`, `PetscLogObjectDestroy()`, `PetscLogGetDefaultHandler()`
486dff009beSToby Isaac @*/
PetscLogHandlerLogObjectState(PetscLogHandler handler,PetscObject obj,const char format[],...)487dff009beSToby Isaac PetscErrorCode PetscLogHandlerLogObjectState(PetscLogHandler handler, PetscObject obj, const char format[], ...)
488dff009beSToby Isaac {
489dff009beSToby Isaac va_list argp;
490dff009beSToby Isaac
491dff009beSToby Isaac PetscFunctionBegin;
492dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
493dff009beSToby Isaac PetscValidHeader(obj, 2);
494dff009beSToby Isaac PetscAssertPointer(format, 3);
495dff009beSToby Isaac va_start(argp, format);
496dff009beSToby Isaac PetscCall(PetscLogHandlerLogObjectState_Internal(handler, obj, format, argp));
497dff009beSToby Isaac va_end(argp);
498dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
499dff009beSToby Isaac }
500dff009beSToby Isaac
501dff009beSToby Isaac /*@
502dff009beSToby Isaac PetscLogHandlerGetNumObjects - Get the number of objects that were logged with a log handler
503dff009beSToby Isaac
504dff009beSToby Isaac Not Collective
505dff009beSToby Isaac
506dff009beSToby Isaac Input Parameter:
507dff009beSToby Isaac . handler - a `PetscLogHandler`
508dff009beSToby Isaac
509dff009beSToby Isaac Output Parameter:
510dff009beSToby Isaac . num_objects - the number of objects whose creations and destructions were logged with `handler`
511dff009beSToby Isaac (`PetscLogHandlerObjectCreate()` / `PetscLogHandlerObjectDestroy()`), or -1
512dff009beSToby Isaac if the handler does not keep track of this number.
513dff009beSToby Isaac
514dff009beSToby Isaac Level: developer
515dff009beSToby Isaac
516dff009beSToby Isaac Note:
517dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not.
518dff009beSToby Isaac
519dff009beSToby Isaac .seealso: [](ch_profiling)
520dff009beSToby Isaac @*/
PetscLogHandlerGetNumObjects(PetscLogHandler handler,PetscInt * num_objects)521dff009beSToby Isaac PetscErrorCode PetscLogHandlerGetNumObjects(PetscLogHandler handler, PetscInt *num_objects)
522dff009beSToby Isaac {
523dff009beSToby Isaac PetscFunctionBegin;
524dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
525dff009beSToby Isaac PetscAssertPointer(num_objects, 2);
526dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerGetNumObjects_C", (PetscLogHandler, PetscInt *), (handler, num_objects));
527dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
528dff009beSToby Isaac }
529dff009beSToby Isaac
530dff009beSToby Isaac /*@
531dff009beSToby Isaac PetscLogHandlerEventDeactivatePush - Temporarily deactivate a logging event for a log handler
532dff009beSToby Isaac
533dff009beSToby Isaac Not collective
534dff009beSToby Isaac
535dff009beSToby Isaac Input Parameters:
536dff009beSToby Isaac + handler - a `PetscLogHandler`
537dff009beSToby Isaac . stage - a `PetscLogStage` (or `PETSC_DEFAULT` for the current stage)
538dff009beSToby Isaac - event - a `PetscLogEvent`
539dff009beSToby Isaac
540dff009beSToby Isaac Level: developer
541dff009beSToby Isaac
542dff009beSToby Isaac Note:
543dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
544dff009beSToby Isaac `PetscLogEventDeactivatePush()` to call this function for the default log handler that is connected to the global
545dff009beSToby Isaac logging state (`PetscLogGetState()`).
546dff009beSToby Isaac
547dff009beSToby Isaac .seealso: [](ch_profiling), `PetscLogHandlerEventDeactivatePop()`
548dff009beSToby Isaac @*/
PetscLogHandlerEventDeactivatePush(PetscLogHandler handler,PetscLogStage stage,PetscLogEvent event)549dff009beSToby Isaac PetscErrorCode PetscLogHandlerEventDeactivatePush(PetscLogHandler handler, PetscLogStage stage, PetscLogEvent event)
550dff009beSToby Isaac {
551dff009beSToby Isaac PetscFunctionBegin;
552dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
553dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerEventDeactivatePush_C", (PetscLogHandler, PetscLogStage, PetscLogEvent), (handler, stage, event));
554dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
555dff009beSToby Isaac }
556dff009beSToby Isaac
557dff009beSToby Isaac /*@
558dff009beSToby Isaac PetscLogHandlerEventDeactivatePop - Undo temporary deactivation a logging event for a log handler
559dff009beSToby Isaac
560dff009beSToby Isaac Not collective
561dff009beSToby Isaac
562dff009beSToby Isaac Input Parameters:
563dff009beSToby Isaac + handler - a `PetscLogHandler`
564dff009beSToby Isaac . stage - a `PetscLogStage` (or `PETSC_DEFAULT` for the current stage)
565dff009beSToby Isaac - event - a `PetscLogEvent`
566dff009beSToby Isaac
567dff009beSToby Isaac Level: developer
568dff009beSToby Isaac
569dff009beSToby Isaac Note:
570dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
571dff009beSToby Isaac `PetscLogEventDeactivatePop()` to call this function for the default log handler that is connected to the global
572dff009beSToby Isaac logging state (`PetscLogGetState()`).
573dff009beSToby Isaac
574dff009beSToby Isaac .seealso: [](ch_profiling), `PetscLogHandlerEventDeactivatePush()`
575dff009beSToby Isaac @*/
PetscLogHandlerEventDeactivatePop(PetscLogHandler handler,PetscLogStage stage,PetscLogEvent event)576dff009beSToby Isaac PetscErrorCode PetscLogHandlerEventDeactivatePop(PetscLogHandler handler, PetscLogStage stage, PetscLogEvent event)
577dff009beSToby Isaac {
578dff009beSToby Isaac PetscFunctionBegin;
579dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
580dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerEventDeactivatePop_C", (PetscLogHandler, PetscLogStage, PetscLogEvent), (handler, stage, event));
581dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
582dff009beSToby Isaac }
583dff009beSToby Isaac
584dff009beSToby Isaac /*@
585dff009beSToby Isaac PetscLogHandlerEventsPause - Put event logging into "paused" mode (see `PetscLogEventsPause()` for details.) for a log handler
586dff009beSToby Isaac
587dff009beSToby Isaac Not collective
588dff009beSToby Isaac
589dff009beSToby Isaac Input Parameter:
590dff009beSToby Isaac . handler - a `PetscLogHandler`
591dff009beSToby Isaac
592dff009beSToby Isaac Level: developer
593dff009beSToby Isaac
594dff009beSToby Isaac Note:
595dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
596dff009beSToby Isaac `PetscLogEventsPause()` to call this function for the default log handler that is connected to the global
597dff009beSToby Isaac logging state (`PetscLogGetState()`).
598dff009beSToby Isaac
599dff009beSToby Isaac .seealso: [](ch_profiling), `PetscLogHandlerEventsResume()`
600dff009beSToby Isaac @*/
PetscLogHandlerEventsPause(PetscLogHandler handler)601dff009beSToby Isaac PetscErrorCode PetscLogHandlerEventsPause(PetscLogHandler handler)
602dff009beSToby Isaac {
603dff009beSToby Isaac PetscFunctionBegin;
604dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
605dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerEventsPause_C", (PetscLogHandler), (handler));
606dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
607dff009beSToby Isaac }
608dff009beSToby Isaac
609dff009beSToby Isaac /*@
610dff009beSToby Isaac PetscLogHandlerEventsResume - Resume event logging that had been put into "paused" mode (see `PetscLogEventsPause()` for details.) for a log handler
611dff009beSToby Isaac
612dff009beSToby Isaac Not collective
613dff009beSToby Isaac
614dff009beSToby Isaac Input Parameter:
615dff009beSToby Isaac . handler - a `PetscLogHandler`
616dff009beSToby Isaac
617dff009beSToby Isaac Level: developer
618dff009beSToby Isaac
619dff009beSToby Isaac Note:
620dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
621dff009beSToby Isaac `PetscLogEventsResume()` to call this function for the default log handler that is connected to the global
622dff009beSToby Isaac logging state (`PetscLogGetState()`).
623dff009beSToby Isaac
624dff009beSToby Isaac .seealso: [](ch_profiling), `PetscLogHandlerEventsPause()`
625dff009beSToby Isaac @*/
PetscLogHandlerEventsResume(PetscLogHandler handler)626dff009beSToby Isaac PetscErrorCode PetscLogHandlerEventsResume(PetscLogHandler handler)
627dff009beSToby Isaac {
628dff009beSToby Isaac PetscFunctionBegin;
629dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
630dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerEventsResume_C", (PetscLogHandler), (handler));
631dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
632dff009beSToby Isaac }
633dff009beSToby Isaac
634dff009beSToby Isaac /*@
635dff009beSToby Isaac PetscLogHandlerDump - Dump the records of a log handler to file
636dff009beSToby Isaac
637dff009beSToby Isaac Not collective
638dff009beSToby Isaac
639dff009beSToby Isaac Input Parameters:
640dff009beSToby Isaac + handler - a `PetscLogHandler`
641dff009beSToby Isaac - sname - the name of the file to dump log data to
642dff009beSToby Isaac
643dff009beSToby Isaac Level: developer
644dff009beSToby Isaac
645dff009beSToby Isaac Note:
646dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
647dff009beSToby Isaac `PetscLogDump()` to call this function for the default log handler that is connected to the global
648dff009beSToby Isaac logging state (`PetscLogGetState()`).
649dff009beSToby Isaac
650dff009beSToby Isaac .seealso: [](ch_profiling)
651dff009beSToby Isaac @*/
PetscLogHandlerDump(PetscLogHandler handler,const char sname[])652dff009beSToby Isaac PetscErrorCode PetscLogHandlerDump(PetscLogHandler handler, const char sname[])
653dff009beSToby Isaac {
654dff009beSToby Isaac PetscFunctionBegin;
655dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerDump_C", (PetscLogHandler, const char *), (handler, sname));
656dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
657dff009beSToby Isaac }
658dff009beSToby Isaac
659dff009beSToby Isaac /*@
660baca6076SPierre Jolivet PetscLogHandlerStageSetVisible - Set the visibility of logging stage in `PetscLogHandlerView()` for a log handler
661dff009beSToby Isaac
662dff009beSToby Isaac Not collective
663dff009beSToby Isaac
664dff009beSToby Isaac Input Parameters:
665dff009beSToby Isaac + handler - a `PetscLogHandler`
666dff009beSToby Isaac . stage - a `PetscLogStage`
667dff009beSToby Isaac - isVisible - the visibility flag, `PETSC_TRUE` to print, else `PETSC_FALSE` (defaults to `PETSC_TRUE`)
668dff009beSToby Isaac
669dff009beSToby Isaac Level: developer
670dff009beSToby Isaac
671dff009beSToby Isaac Note:
672dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
673dff009beSToby Isaac `PetscLogStageSetVisible()` to call this function for the default log handler that is connected to the global
674dff009beSToby Isaac logging state (`PetscLogGetState()`).
675dff009beSToby Isaac
676dff009beSToby Isaac .seealso: [](ch_profiling), `PetscLogHandlerStageGetVisible()`
677dff009beSToby Isaac @*/
PetscLogHandlerStageSetVisible(PetscLogHandler handler,PetscLogStage stage,PetscBool isVisible)678dff009beSToby Isaac PetscErrorCode PetscLogHandlerStageSetVisible(PetscLogHandler handler, PetscLogStage stage, PetscBool isVisible)
679dff009beSToby Isaac {
680dff009beSToby Isaac PetscFunctionBegin;
681dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
682dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerStageSetVisible_C", (PetscLogHandler, PetscLogStage, PetscBool), (handler, stage, isVisible));
683dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
684dff009beSToby Isaac }
685dff009beSToby Isaac
686dff009beSToby Isaac /*@
687baca6076SPierre Jolivet PetscLogHandlerStageGetVisible - Get the visibility of logging stage in `PetscLogHandlerView()` for a log handler
688dff009beSToby Isaac
689dff009beSToby Isaac Not collective
690dff009beSToby Isaac
691dff009beSToby Isaac Input Parameters:
692dff009beSToby Isaac + handler - a `PetscLogHandler`
693dff009beSToby Isaac - stage - a `PetscLogStage`
694dff009beSToby Isaac
695dff009beSToby Isaac Output Parameter:
696dff009beSToby Isaac . isVisible - the visibility flag, `PETSC_TRUE` to print, else `PETSC_FALSE` (defaults to `PETSC_TRUE`)
697dff009beSToby Isaac
698dff009beSToby Isaac Level: developer
699dff009beSToby Isaac
700dff009beSToby Isaac Note:
701dff009beSToby Isaac The default log handler `PETSCLOGHANDLERDEFAULT` implements this function, but others generally do not. You can use
702dff009beSToby Isaac `PetscLogStageGetVisible()` to call this function for the default log handler that is connected to the global
703dff009beSToby Isaac logging state (`PetscLogGetState()`).
704dff009beSToby Isaac
705dff009beSToby Isaac .seealso: [](ch_profiling), `PetscLogHandlerStageSetVisible()`
706dff009beSToby Isaac @*/
PetscLogHandlerStageGetVisible(PetscLogHandler handler,PetscLogStage stage,PetscBool * isVisible)707dff009beSToby Isaac PetscErrorCode PetscLogHandlerStageGetVisible(PetscLogHandler handler, PetscLogStage stage, PetscBool *isVisible)
708dff009beSToby Isaac {
709dff009beSToby Isaac PetscFunctionBegin;
710dff009beSToby Isaac PetscValidHeaderSpecific(handler, PETSCLOGHANDLER_CLASSID, 1);
711dff009beSToby Isaac PetscTryMethod(handler, "PetscLogHandlerStageGetVisible_C", (PetscLogHandler, PetscLogStage, PetscBool *), (handler, stage, isVisible));
712dff009beSToby Isaac PetscFunctionReturn(PETSC_SUCCESS);
713dff009beSToby Isaac }
714