[petsc-dev] CheckPointer

Dave May dave.mayhem23 at gmail.com
Wed Sep 11 11:08:50 CDT 2013


Yes, being able to optionally turn off the full memory checking (either run
time or via a configuration flag) in MatSetValues() would be good enough.
Presumably when the full error checking wasn't being used, the error
checking should revert to using the old style memory checking (e.g. ptr != 0)
as was used in version 3.2 (and maybe 3.3, I cannot recall).

Cheers,
  Dave




On 11 September 2013 18:01, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> Dave May <dave.mayhem23 at gmail.com> 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".
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130911/186f4132/attachment.html>


More information about the petsc-dev mailing list