| b665b14e | 18-Jul-2023 |
Toby Isaac <toby.isaac@gmail.com> |
Profiling: Switch logging over to the new PetscLogHandler infrastructure
- Move data structures only needed by the default logger now (Action, Object) to logdefault.c
- Create petsclogdeprecated.
Profiling: Switch logging over to the new PetscLogHandler infrastructure
- Move data structures only needed by the default logger now (Action, Object) to logdefault.c
- Create petsclogdeprecated.h and petsc/private/logimpldeprecated.h for publicly visible symbols that are now deprecated. Yes, lots of symbols in petsc/private/logimpl.h were not only visible but had docstrings.
- The macros PetscLogEventBegin(), PetscLogEventEnd(), PetscLogEventSync(), PetscLogObjectCreate(), and PetscLogObjectDestroy() now looks through the log handlers in PetscLogHandlers, sees if they have they appropriate callbacks (Exposed in PetscLogHandlerHot), and calls them. Up to 4 log handlers can run simultaneously.
- All queries about the registered things now go through petsc_log_state.
- Output functions dispatch to the appropriate PetscLogHandler
- There is no need for xmllogevent.c, xmlviewer.c, eventlog.c, classlog.c, and stagelog.c anymore. Some orphaned functions (PetscLogSetThreshold(), PetscLogEventSetDof(), PetscLogEventSetError(), PetscASend(), PetscARecv(), PetscAReduce())
- PetscFEOpenCLLogResidual() did some intrusive things related to the old logging infrastruture: the private header for the default log handler is now imported into feopencl.c so that it can do equivalent things with the new infrastructure.
- PetscLogPauseCurrentEvent_Internal() is replaced with PetscLogEventsPause()
Deprecated symbols include:
- All functions related to PetscStageLog and the resizable array structs that it contained.
- The legacy EventBegin()/EventEnd() callbacks.
- PetscLogAllBegin(), which actually reported less information than PetscLogDefaultBegin() because it was not kept up-to-date with regards to GPU profiling.
show more ...
|
| 176456b8 | 13-Jul-2023 |
Toby Isaac <toby.isaac@gmail.com> |
Profiling: Add interface for getting unqiue global logging names
It has been implicit since the beginning that, in default logging interface, stages, events, and classes have to be registered in the
Profiling: Add interface for getting unqiue global logging names
It has been implicit since the beginning that, in default logging interface, stages, events, and classes have to be registered in the same order on every process. This is harder to accomplish with nested logging, where new events and stages may be created on the fly.
This change uses the newly created PetscLogState interface to assign each event/stage/class a globally unique id based on its name. Essentially, each process in turn tells the other processes the names of things that haven't been assigned ids yet, and they all agree on their new ids. The global ids are used to construct global <-> local maps.
In the easy case of all processes having the same things named in the same order, the process stops after they all confirm that they have the same names in the same order.
This communication pattern is straight-forward and does not attempt to be efficient, but log viewing lots and lots of MPI_Allreduces, so the cost of this will not be noticeable.
show more ...
|