Program spends a large amount of time in PetscStrcmp and PetscCheckPointer - Why?
Hei, I noticed while benchmarking and profiling that my program spends ~2800 s in PetscStrcmp and ~2300 s in PetscCheckPointer (for a total runtime of 21000 s) when running it on four threads. I do not recall using those functions actively, especially for PetscStrcmp. The first function which is doing something useful (i.e. I know where it is in use) is zgemv_, with 574 s total runtime. Why are those functions called, and where are they necessary? Thanks! Regards, Roland Richter
PetscCheckPointer (for a total runtime of 21000 s) when running it on four threads. I do not recall using those functions actively, especially for PetscStrcmp.
PetscCheckPointer() is one of a chain of sanity-check functions called in the preambles to most petsc functions — see PetscValidIntPointer() for example — when PETSc is configured with debugging turned on. You can turn this off even for debugging builds by running with the option: -check_pointer_intensity 0 PetscStrcmp() is similarly used in these preambles to check that two PETSc objects are of the same type (since the type is stored as a string), see PetscObjectTypeCompare(), usually called from PetscValidHeaderSpecific() or PetscCheckTypeNames(). Best regards, Jacob Faibussowitsch (Jacob Fai - booss - oh - vitch) Cell: (312) 694-3391
On Jan 21, 2021, at 07:09, Roland Richter <[email protected]> wrote:
Hei,
I noticed while benchmarking and profiling that my program spends ~2800 s in PetscStrcmp and ~2300 s in PetscCheckPointer (for a total runtime of 21000 s) when running it on four threads. I do not recall using those functions actively, especially for PetscStrcmp. The first function which is doing something useful (i.e. I know where it is in use) is zgemv_, with 574 s total runtime. Why are those functions called, and where are they necessary?
Thanks!
Regards,
Roland Richter
Jacob Faibussowitsch <[email protected]> writes:
PetscCheckPointer (for a total runtime of 21000 s) when running it on four threads. I do not recall using those functions actively, especially for PetscStrcmp.
PetscCheckPointer() is one of a chain of sanity-check functions called in the preambles to most petsc functions — see PetscValidIntPointer() for example — when PETSc is configured with debugging turned on. You can turn this off even for debugging builds by running with the option: -check_pointer_intensity 0
Indeed, though you should really configure --with-debugging=0 when you care about performance (usually with a different value of PETSC_ARCH so you can switch back and forth easily). It makes a huge difference, and not just because of these aggressive debug-mode checks. There are big warning banners if you use -log_view (which has profiling information) with a debugging build.
participants (3)
-
Jacob Faibussowitsch -
Jed Brown -
Roland Richter