[Dune] problem with mpi_init

Markus Blatt markus at dr-blatt.de
Fri Jan 17 20:00:29 CET 2014


Thanks for reporting this.

I guess that is a bug in the example problem created with duneproject,
which has a return statement in the try clause that causes the program
to exit before calling MPI_Finalize.

Please try to remove "return 0" from the following main function:
"
int main(int argc, char** argv)
{
  try{
    //Maybe initialize Mpi
    Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
    std::cout << "Hello World! This is tester." << std::endl;
    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;
    return 0;
  //^^^^^^^^^ Please remove!
  }
  catch (Dune::Exception &e){
    std::cerr << "Dune reported error: " << e << std::endl;
  }
  catch (...){
    std::cerr << "Unknown exception thrown!" << std::endl;
  }
}


Just a wild guess:

Does your main contain a return statement?

If you are using the 
-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858  Fax: +49 (0)322 1108991658 




More information about the Dune mailing list