← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Several Python assembly optimizations and new options:

 

On Tue, Jun 03, 2008 at 11:23:41PM +0200, Martin Sandve Alnæs wrote:
> 2008/6/3 Anders Logg <logg@xxxxxxxxx>:
> > On Sun, Jun 01, 2008 at 12:21:37AM +0200, Johan Hake wrote:
> >> On Saturday 31 May 2008 23:10:05 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:   4271:8431a991a0be07ead18512308cf293a309d4b2a5
> >> > tag:         tip
> >> > user:        Anders Logg <logg@xxxxxxxxx>
> >> > date:        Sat May 31 23:09:58 2008 +0200
> >> > files:       demo/mesh/ale/cpp/main.cpp demo/mesh/ale/python/demo.py
> >> > dolfin/parameter/DefaultParameters.h site-packages/dolfin/assemble.py
> >> > description:
> >> > Several Python assembly optimizations and new options:
> >> > The following options are now available:
> >> >
> >> >   dolfin_set("optimize form", True)              # Use optimization -O2
> >> > when compiling generated code dolfin_set("optimize use dof map cache",
> >> > True) # Store dof maps in cache for reuse dolfin_set("optimize use tensor
> >> > cache", True)  # Store tensors in cache for reuse
> >> >
> >> >   dolfin_set("optimize", True)                   # All of the above
> >> >
> >> > Each one of these may make a significant difference for the
> >> > speed of assembly from Python, in particular for repeated
> >> > assembly.
> >> >
> >> > With these options set, the difference in speed between assembly
> >> > in C++ and Python using the JIT compiler is negligible. (For forms
> >> > which don't depend on functions that are evaluated in Python.)
> >>
> >> Nice features!
> >>
> >> It would be nice to be able to use inlined and just in time compiled c++
> >> functions, avoiding the time consuming python callback functions.
> >>
> >> Johan
> >
> > This is possible (Martin does it), but I don't know how.
> >
> > Martin, is it be easy to do this directly from DOLFIN (with FFC) or
> > does it depend on SyFi?
> >
> 
> It's easy with some helper functions I have, I can show you tomorrow.
> It only depends on dolfin::Function (i.e. dolfin.cpp_Function) and Instant.

ok, nice. Maybe we can add the helper functions to assemble.py.

-- 
Anders


Follow ups

References