dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #25571
Re: [noreply@xxxxxxxxxxxxx: [Branch ~dolfin-core/dolfin/trunk] Rev 6641: Add parameter: "use_petsc_signal_handler", which enables/disable PETSc system signals]
I've changed it just in case something weird happens.
--
Anders
On Thu, Mar 15, 2012 at 11:44:17AM +0100, Johan Hake wrote:
> Looks like it is implicit. At least it works :)
>
> No problem to make it explicit.
>
> Johan
>
> On Thu, Mar 15, 2012 at 10:27 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> > Is the cast to bool automatic if you add ! in front of the call?
> >
> > I would otherwise think one needs to do
> >
> > const bool use_petsc_signal_handler = parameters["use_petsc_signal_handler"];
> > if (use_petsc_signal_handler)
> > {
> >
> >
> > }
> >
> >
> >
> > ---------- Forwarded message ----------
> > From: noreply@xxxxxxxxxxxxx
> > To: Anders Logg <logg@xxxxxxxxx>
> > Cc:
> > Date: Thu, 15 Mar 2012 09:16:14 -0000
> > Subject: [Branch ~dolfin-core/dolfin/trunk] Rev 6641: Add parameter: "use_petsc_signal_handler", which enables/disable PETSc system signals
> > ------------------------------------------------------------
> > revno: 6641
> > committer: Johan Hake <hake.dev@xxxxxxxxx>
> > branch nick: work-trunk
> > timestamp: Thu 2012-03-15 10:13:48 +0100
> > message:
> > Add parameter: "use_petsc_signal_handler", which enables/disable PETSc system signals
> > modified:
> > ChangeLog
> > dolfin/common/SubSystemsManager.cpp
> > dolfin/parameter/GlobalParameters.h
> >
> >
> >
> > Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
> > To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/trunk/+edit-subscription
> >
> > === modified file 'ChangeLog'
> > --- ChangeLog 2012-03-09 12:45:08 +0000
> > +++ ChangeLog 2012-03-15 09:13:48 +0000
> > @@ -1,4 +1,5 @@
> > 1.1.0 [not yet released]
> > + - Add parameter: "use_petsc_signal_handler", which enables/disable PETSc system signals
> > - Avoid unnessesary resize of result vector for A*b
> > - MPI functionality for distributing values between neighbours
> > - SystemAssembler now works in parallel with topological/geometric boundary search
> >
> > === modified file 'dolfin/common/SubSystemsManager.cpp'
> > --- dolfin/common/SubSystemsManager.cpp 2011-11-15 14:39:52 +0000
> > +++ dolfin/common/SubSystemsManager.cpp 2012-03-15 09:13:48 +0000
> > @@ -35,6 +35,7 @@
> >
> > #include <libxml/parser.h>
> > #include <dolfin/common/constants.h>
> > +#include <dolfin/parameter/GlobalParameters.h>
> > #include <dolfin/log/dolfin_log.h>
> > #include "SubSystemsManager.h"
> >
> > @@ -162,6 +163,10 @@
> > SlepcInitialize(&argc, &argv, PETSC_NULL, PETSC_NULL);
> > #endif
> >
> > + // Avoid using default PETSc signal handler
> > + if (!parameters["use_petsc_signal_handler"])
> > + PetscPopSignalHandler();
> > +
> > singleton().petsc_initialized = true;
> >
> > // Determine if PETSc initialised MPI (and is therefore responsible for MPI finalization)
> >
> > === modified file 'dolfin/parameter/GlobalParameters.h'
> > --- dolfin/parameter/GlobalParameters.h 2011-11-18 10:45:16 +0000
> > +++ dolfin/parameter/GlobalParameters.h 2012-03-15 09:13:48 +0000
> > @@ -16,7 +16,7 @@
> > // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
> > //
> > // First added: 2009-07-02
> > -// Last changed: 2011-10-21
> > +// Last changed: 2012-03-12
> >
> > #ifndef __GLOBAL_PARAMETERS_H
> > #define __GLOBAL_PARAMETERS_H
> > @@ -96,6 +96,8 @@
> > #ifdef HAS_PETSC
> > allowed_backends.insert("PETSc");
> > default_backend = "PETSc";
> > + p.add("use_petsc_signal_handler", false);
> > +
> > #endif
> > #ifdef HAS_TRILINOS
> > allowed_backends.insert("Epetra");
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~dolfin
> > Post to : dolfin@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~dolfin
> > More help : https://help.launchpad.net/ListHelp
> >
References