I have an application using PETSc. For performance monitoring under (near) production runs, I'd like to log a small number of various values. Some generated by PETSc, some not.
Now I wonder: How can I read the time value out of PetscEventPerfInfo
to write it into my file? I can't find a documentation entry about PetscEventPerfInfo
, so I'm not sure whether I'm not supposed to touch it in any way.
However, I found the following method which basically reveals the structure of PetscEventPerfInfo
:
PetscErrorCode EventPerfInfoClear(PetscEventPerfInfo *eventInfo)
{
PetscFunctionBegin;
eventInfo->id = -1;
eventInfo->active = PETSC_TRUE;
eventInfo->visible = PETSC_TRUE;
eventInfo->depth = 0;
eventInfo->count = 0;
eventInfo->flops = 0.0;
eventInfo->flops2 = 0.0;
eventInfo->flopsTmp = 0.0;
eventInfo->time = 0.0;
eventInfo->time2 = 0.0;
eventInfo->timeTmp = 0.0;
eventInfo->numMessages = 0.0;
eventInfo->messageLength = 0.0;
eventInfo->numReductions = 0.0;
PetscFunctionReturn(0);
}
I have a strong guess that it's just eventInfo->time
, but I'm absolutely not sure whether it's save to read it oder whether there's an "official" way to read from that structure.
So, what should I do if I just want to read the time value into a variable for further usage?