I was wondering why there is different behaviour between
  PetscLogEventGetId()
and
  PetscLogStageGetId()

PetscLogEventGetId() returns -1 if the event isn't found,
whilst  PetscLogStageGetId() throws an error if the stage isn't found.

My use case is that within one of my custom preconditioners, I wanted
to call PetscLogStageRegister() during the creation phase, but obviously
I can only register the stage once. To enable multiple instances of the
preconditioner to exist, I need to ensure that the stage is only registered
once.
Hence I would like to check for the existence of the stage prior to calling
the register function.

Is there currently a way to check for the existence of a registered stage?


Cheers
  Dave

Reply via email to