[petsc-users] Program spends a large amount of time in PetscStrcmp and PetscCheckPointer - Why?

Jed Brown jed at jedbrown.org
Thu Jan 21 07:04:19 CST 2021


Jacob Faibussowitsch <jacob.fai at gmail.com> 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.


More information about the petsc-users mailing list