[petsc-dev] What is wrong with CHKERRQ() after PetscInitialize()?

Jed Brown jedbrown at mcs.anl.gov
Mon Sep 17 21:00:13 CDT 2012


On Mon, Sep 17, 2012 at 8:44 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

> > In any case, maybe we can say that it is safe to CHKERRQ after
> PetscInitialize because there is no code path by which it could fail?
> PetscInitialize itself starts calling CHKERRQ for everything after this
> part.
>
>     Is that correct?


I think it's fine except that the user hasn't had a chance to call
PetscPushErrorHandler() and PetscPushSignalHandler(). Maybe we should make
that safe to call before PetscInitialize()? That would just require using
raw malloc() instead of PetscNew to allocate the frame. Could even put a
flag in the frame and allocate with PetscMalloc once PETSc has been
initialized.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120917/303098bf/attachment.html>


More information about the petsc-dev mailing list