Dave May <[email protected]> writes: > Hey Jed, > > The overhead is big. > Here are some numbers I generated which prompted Matt's email. > > All the total run times reported are almost entirely associated with matrix > assembly. > All builds used --with-debugging=yes > > Time (sec): 6.285e+00 [petsc v3.2] > Time (sec): 1.966e+02 [petsc v3.4] > Time (sec): 8.960e+00 [petsc v3.4 with a hacked checkptr.c which > skips the checking] > > Calls to MatSetValue 5955066 > Calls to MatSetValues 11910132
Would removing the check only in MatSetValues be good enough? Probably a better alternative to my earlier suggestion would be PetscCheckPointerPushFastRegion() all the normal checks, possibly nested PetscCheckPointerPopFastRegion() Those would be inline functions that just increment and decrement a global counter and PetscCheckPointer would only do the expensive check when the counter was equal to 0. And we can still have the run-time parameter that checks "always" or "never".
pgpxSwqh2cqG9.pgp
Description: PGP signature
