[Dune] About geometryInInSide in UGGrid

Andreas Lauser andreas.lauser at iws.uni-stuttgart.de
Fri Apr 3 15:58:16 CEST 2009


Hi all,

On Donnerstag, 2. April 2009 09:48:33 Markus Blatt wrote:
> On Wed, Apr 01, 2009 at 03:30:14PM +0200, Yufei Cao wrote:
> > Thank you for your solution !
> >
> > I did it as what you said, then the code can be well
> > compiled. However, when I run the code, I got the
> > following error:
> >
> > Fatal error; unknown error handler
> > May be MPI call before MPI_INIT.  Error message is
> > MPI_COMM_RANK and code is 197
>
> This pretty much seems like UG thinks you are using MPI.

This is perfectly possible and IMHO a major headache when using UGGrid in 
DUNE. The problem is that the size of an UGGrid object depends on whether dune 
grid is compiled with or without ENABLE_MPI. since UGGrid uses explicit 
instantiation, it is only possible to link it to programs where ENABLE_MPI is 
the same as when compiling dune-grid (i.e. it is not possible to link 
sequential programs to a parallel libdunegrid). I suggested changing UGGrid  
to implicit template instantiation in order to avoid these kinds of problems, 
but it was not liked too much as it would increase compilation times. maybe 
someone should give it a second thought...

> Just do as you are told:
>
> #include "config.h"
> #include"dune/common/mpihelper.hh" // An initializer of MPI
> #include"dune/common/exceptions.hh" // We use exceptions
>
> int main(int argc, char** argv){
>   try{
>     //Maybe initialize Mpi
>     Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
>
>     // you might skip these lines
>     if(Dune::MPIHelper::isFake)
>       std::cout<< "This is a sequential program." << std::endl;
>     else
>       std::cout<<"I am rank "<<helper.rank()<<" of "<<helper.size()
>         <<" processes!"<<std::endl;
>
>     // your code
>     ....
>   }catch (Dune::Exception &e){
>     std::cerr << "Dune reported error: " << e << std::endl;
>   }
> }

this will probably result in "This is a sequential program", but UGGrid calls 
MPI anyway because libdunegrid was compiled with ENABLE_MPI=1

Kind Regards
  Andreas

-- 
Andreas Lauser
Lehrstuhl für Hydromechanik und Hydrosystemmodellierung
Universität Stuttgart - Institut für Wasserbau
Pfaffenwaldring 61
D-70569 Stuttgart
Tel: (+49) 0711/ 685-64719
Fax: (+49) 0711/ 685-60430
e-mail: andreas.lauser at iws.uni-stuttgart.de




More information about the Dune mailing list