← Back to team overview

dolfin team mailing list archive

Re: [HG] Fix compilation with --disable-petsc. (Should work now Ã…smund.)

 

On Thu, May 25, 2006 at 12:32:19PM +0200, Garth N. Wells wrote:
> 
> Quoting Anders Logg <logg@xxxxxxxxx>:
> 
> > On Thu, May 25, 2006 at 10:02:26AM +0200, Garth N. Wells wrote:
> > > What's the motivation behind allowing PETSc to be disabled? Is it to allow
> > the
> > > mesh library to be compiled without having PETSc installed? The problem
> > with
> > > disabling PETSc is that it removes 95% of DOLFIN functionality, and bearing
> > this
> > > in mind becomes intrusive in large parts of the code (a finite element
> > assembly
> > > library which has no sparse linear algerbra :) ). Almost every demo will be
> > full
> > > of ifdefs. A better approach would be to set an option to get the 5% that
> > is
> > > needed. Depending exactly what's needed I would suggest
> > > 
> > > 1) Adding something link "make mesh" to compile individual components that
> > are
> > > desried
> > > 
> > > 2) Adding some basic linear algerbra functionality for sparse matrices and
> > a
> > > linear solver. uBlas could be used for this. This way, everything will
> > work,
> > > just not optimally or in parallel and with a reduced set of features.
> > > 
> > > Garth
> > 
> > The motivation is that the DOLFIN mesh library (but not the linear
> > algebra and not the assembly) is used in PyCC, the Python Computing
> > Components framework developed at Simula. Not needing to download,
> > configure, compile and install PETSc saves a lot of work.
> > 
> 
> OK. I think that this holds also for people who just want to take a first look
> at DOLFIN and don't want to go through the rigmarole of installing PETSc. It
> doesn't affect me, but wouldn't "make mesh" be convenient and potentially much
> faster for people who just want to use the mesh library?

Yes, that's also an option but it would require us to rework the build
process. Maybe we should allow individual compilation of all the
different libraries:

    make la
    make ode
    make fem
    make mesh
    etc

This could be useful but it would require some work. Rumour has it
that we will soon be able to build DOLFIN with Scons (www.scons.org)
so maybe we can wait until then.

> > I like option 2 best. We could even use the current dense matrices and
> > vectors for this. The current assembly works entirely through
> > GenericMatrix so it should work fine to assemble and solve PDEs
> > without PETSc. What about trying to implement all interfaces in terms
> > of GenericMatrix? The demos can use Matrix/Vector. If DOLFIN is
> > compiled with PETSc support, then Matrix is a typedef of SparseMatrix
> > and otherwise it is a typedef of DenseMatrix. All the ifdefs should
> > only need to be in the linear algebra classes, the rest of the code
> > should not need to care.
> > 
> 
> OK, let's use GenericMatrix as much as possible. Problem with using dense
> matrices is that the demos might not work due to exesssive memory demands, and
> the solve will take forwever.  At the risk of extra complication, we could have
> the classes PETScSparseMatrix and uBlasSparseMatrix, and have a typedef that
> PETScSparseMatrix is a SparseMatrix if PETSc is enabled, otherwise a typedef
> that uBlasSparseMatrix is a SparseMatrix. Creating uBlasSparseMatrix will be
> simple as uBlas has a number of sparse matrix classes. We can than restict all
> the PETSc ifdef's to src/kernel/la.
> 
> Garth

Sounds good to me. So we would then have something like

    class PETScSparseMatrix : public GenericMatrix { private: Mat A; }
    class uBlasSparseMatrix : public GenericMatrix, public ublas::sparse_matrix_something<double> {}
    class uBlasDenseMatrix  : public GenericMatrix, public ublas::matrix<double> {}

    #ifdef HAVE_PETSC_H
    typedef PETScSparseMatrix SparseMatrix;
    #else
    typedef uBlasSparseMatrix SparseMatrix;
    #endif
    
    typedef uBlasDenseMatrix DenseMatrix;

    typedef SparseMatrix Matrix;

?

/Anders


> 
> > /Anders
> > 
> > 
> > > 
> > > Quoting DOLFIN <dolfin@xxxxxxxxxx>:
> > > 
> > > > One or more new changesets pushed to the primary DOLFIN repository.
> > > > A short summary of the last three changesets is included below.
> > > > 
> > > > changeset:   1945:a4821a8dc6ccd257033f8ff6987c88c6c76d45e7
> > > > tag:         tip
> > > > user:        "Anders Logg <logg@xxxxxxxxx>"
> > > > date:        Thu May 25 00:33:42 2006 +0200
> > > > files:       src/demo/fem/simple/main.cpp src/kernel/fem/FEM.cpp
> > > > src/kernel/fem/dolfin/FEM.h src/kernel/io/File.cpp
> > > > src/kernel/io/GenericFile.cpp src/kernel/io/dolfin/File.h
> > > > src/kernel/io/dolfin/GenericFile.h src/kernel/la/dolfin/Matrix.h
> > > > src/kernel/la/dolfin/Vector.h src/kernel/nls/NonlinearProblem.cpp
> > > > src/kernel/nls/dolfin/NonlinearProblem.h src/kernel/ode/ReducedModel.cpp
> > > > src/kernel/ode/dolfin/ReducedModel.h
> > > > description:
> > > > Fix compilation with --disable-petsc. (Should work now Ã…smund.)
> > > > 
> > > > A number of the demos don't compile without PETSc, but all libraries
> > compile
> > > > fine. We should remove the dependence on PETSc and work through
> > > > GenericMatrix
> > > > as much as possible. We should also consider doing a typedef of
> > DenseMatrix
> > > > to
> > > > Matrix when running with --disable-petsc (instead of SparseMatrix).
> > > > 
> > > > We should set up a compilation bot on fenics.org to create nightly
> > builds
> > > > for various combinations of configurations. Otherwise we'll run into
> > trouble
> > > > with flags that we rarely use (like --disable-petsc).
> > > > 
> > > > 
> > > > changeset:   1944:21e1173b19853a06ab8f44a3a84433668134c683
> > > > user:        "Anders Logg <logg@xxxxxxxxx>"
> > > > date:        Thu May 25 00:08:21 2006 +0200
> > > > files:       Makefile.in aclocal.m4 configure src/Makefile.in
> > > > src/bench/Makefile.in src/bench/fem/Makefile.in
> > src/bench/ode/Makefile.in
> > > > src/config/Makefile.in src/demo/Makefile.in src/demo/fem/Makefile.in
> > > > src/demo/nls/Makefile.in src/demo/ode/Makefile.am
> > src/demo/ode/Makefile.in
> > > > src/demo/ode/aliev-panfilov/Makefile
> > src/demo/ode/aliev-panfilov/main.cpp
> > > > src/demo/ode/courtemanche/Makefile src/demo/ode/courtemanche/main.cpp
> > > > src/demo/ode/homotopy/Makefile.in src/demo/pde/Makefile.in
> > > > src/demo/pde/nonlinear/Makefile.in src/demo/pde/stokes/Makefile.in
> > > > src/demo/scripting/Makefile.in src/demo/solvers/Makefile.in
> > > > src/demo/solvers/navierstokes/Makefile.in src/greeting/Makefile.in
> > > > src/kernel/Makefile.in src/kernel/common/Makefile.in
> > > > src/kernel/common/dolfin/Makefile.in src/kernel/fem/Makefile.in
> > > > src/kernel/fem/dolfin/Makefile.in src/kernel/form/Makefile.in
> > > > src/kernel/form/dolfin/Makefile.in src/kernel/function/Makefile.in
> > > > src/kernel/function/dolfin/Makefile.in src/kernel/io/Makefile.in sr
> > > >  c/kernel/io/dolfin/Makefile.in src/kernel/la/Makefile.in
> > > > src/kernel/la/dolfin/Makefile.in src/kernel/log/Makefile.in
> > > > src/kernel/log/dolfin/Makefile.in src/kernel/main/Makefile.in
> > > > src/kernel/main/dolfin/Makefile.in src/kernel/math/Makefile.in
> > > > src/kernel/math/dolfin/Makefile.in src/kernel/mesh/Makefile.in
> > > > src/kernel/mesh/dolfin/Makefile.in src/kernel/nls/Makefile.in
> > > > src/kernel/nls/dolfin/Makefile.in src/kernel/ode/Makefile.in
> > > > src/kernel/ode/dolfin/Makefile.in src/kernel/parameter/Makefile.in
> > > > src/kernel/parameter/dolfin/Makefile.in src/kernel/pde/Makefile.in
> > > > src/kernel/pde/dolfin/Makefile.in src/kernel/quadrature/Makefile.in
> > > > src/kernel/quadrature/dolfin/Makefile.in src/lib/Makefile.in
> > > > src/modules/Makefile.in src/modules/convdiff/Makefile.in
> > > > src/modules/convdiff/dolfin/Makefile.in src/modules/dolfin/Makefile.in
> > > > src/modules/elasticity-updated/Makefile.in
> > > > src/modules/elasticity-updated/dolfin/Makefile.in
> > > > src/modules/elasticity/Makefile.in
> > src/modules/elasticity/dolfin/Makefile.in
> > > > 
> > > >  src/modules/heat/Makefile.in src/modules/heat/dolfin/Makefile.in
> > > > src/modules/navierstokes/Makefile.in
> > > > src/modules/navierstokes/dolfin/Makefile.in
> > src/modules/poisson/Makefile.in
> > > > src/modules/poisson/dolfin/Makefile.in src/modules/stokes/Makefile.in
> > > > src/modules/stokes/dolfin/Makefile.in src/post/Makefile.in
> > > > src/pre/Makefile.in src/pydolfin/Makefile.in src/utils/Makefile.in
> > > > src/utils/convert/Makefile.in src/utils/inp2dx/Makefile.in
> > > > description:
> > > > Add cell models for cardiac excitation (Aliev-Panfilov and Courtemanche)
> > > > as new ODE demos. Thanks to Ola and Glenn for supplying the examples.
> > > > This is just a first test but the results look reasonable. Will look
> > > > more into speeding up the computation next.
> > > > 
> > > > 
> > > > changeset:   1943:16d5a8e397c062a86a04d50418573a609f6ef321
> > > > user:        "Garth N. Wells <g.n.wells@xxxxxxxxxx>"
> > > > date:        Wed May 24 14:08:37 2006 +0200
> > > > files:       src/utils/convert/dolfin-convert
> > > > description:
> > > > Read number of "tags" before connectivity when converting meshes from
> > gmsh.
> > > > 
> > > > 
> > > > -------------------------------------------------------
> > > > For more details, visit http://www.fenics.org/hg/dolfin
> > > > 
> > > > _______________________________________________
> > > > DOLFIN-dev mailing list
> > > > DOLFIN-dev@xxxxxxxxxx
> > > > http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
> > > > 
> > 



Follow ups

References