[petsc-users] Logging object creation and destruction counts

Wells, David drwells at email.unc.edu
Mon Nov 20 07:00:00 CST 2023


Hi everyone,

I just upgraded to PETSc 3.20 and read up on the new logging infrastructure - its a very nice improvement over the old version.

I have some code which checks that every construction has a corresponding destruction via


PetscStageLog  stageLog;
ierr = PetscLogGetStageLog(&stageLog);
for (int i = 0; i < stageLog->stageInfo->classLog->numClasses; ++i)
      {
        if (stageLog->stageInfo->classLog->classInfo[i].destructions !=
            stageLog->stageInfo->classLog->classInfo[i].creations)
          {
            crash();
          }
      }


This no longer works and I can't figure out how to port it. In particular, it looks like I need to get a PetscLogEvent number for creation and another for destruction to retrieve the relevant PetscEventPerfInfo objects per-class - is there some straightforward way to do that for every registered PETSc class?

Best,
David Wells
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20231120/ed56d8ce/attachment.html>


More information about the petsc-users mailing list