[Dune] About geometryInInSide in UGGrid

Markus Blatt Markus.Blatt at iwr.uni-heidelberg.de
Thu Apr 2 09:48:33 CEST 2009


Hi,

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.

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;
  }
}


Cheers,

Markus




More information about the Dune mailing list