dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #15033
Re: [HG DOLFIN] Add a 'mpi_jit_decorator' function which generalizes the paralell jit
On Friday 28 August 2009 22:35:08 Anders Logg wrote:
> On Wed, Aug 19, 2009 at 01:41:50PM +0200, DOLFIN wrote:
> > One or more new changesets pushed to the primary dolfin repository.
> > A short summary of the last three changesets is included below.
> >
> > changeset: 6801:d3897056b4c92df1a2decddb8481f01011468683
> > tag: tip
> > user: "Johan Hake <hake@xxxxxxxxx>"
> > date: Wed Aug 19 13:41:45 2009 +0200
> > files: site-packages/dolfin/compile_extension_module.py
> > site-packages/dolfin/jit.py description:
> > Add a "mpi_jit_decorator" function which generalizes the paralell jit
> > compilation algorithm.
> >
> > It utilize a nice feature in Python: decorators
> > To apply it to a jit_compiler just import the decorator and decorate
> > your jit function:
> >
> > @mpi_jit_decorator
> > def some_jit_compiler(some):
> > ....
>
> Pretty cool, but why the threads? I don't understand why that should
> be needed.
If we want a message that tells the user that a form will be jit compiled on
the first process, only when it actually is compiling, I couldn't find another
non-intrusive way to implement it.
The same process that starts the compiling needs to find out if an actual
compilation has started. This is done using a thread. It starts it, wait a
while 0.2 s I think, using the join function), check if the thread is alive.
If the thread is alive, assume it is compiling and issue a message. If the
thread is not alive we assume the module is picked up from cache, and we
proceed without issuing a message. Also note that if the cache is used, the
present thread will finish the join statement before the 0.2 s.
Johan
> --
> Anders
>
> > changeset: 6800:2dc2719112892bcc48fa70c4622872a0cc251243
> > user: Johannes Ring <johannr@xxxxxxxxx>
> > date: Wed Aug 19 13:31:10 2009 +0200
> > files: test/memory/test.py
> > description:
> > Remove reaction demo when running Valgrind (buildbot times out).
> >
> >
> > changeset: 6799:60d081f9053d3db8215f9150914b1d79af03b83b
> > user: "Johan Hake <hake@xxxxxxxxx>"
> > date: Wed Aug 19 13:11:37 2009 +0200
> > files: dolfin/main/MPI.cpp
> > description:
> > Fixed unimplemented dolfin::MPI::barrier()
> >
> > ----------------------------------------------------------------------
> > For more details, visit http://www.fenics.org/hg/dolfin
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
Follow ups
References