[Dune] Weird behaviour of MPIHelper

Aleksejs Fomins aleksejs.fomins at epfl.ch
Tue May 19 15:23:57 CEST 2015


Dear Dune,

I am having trouble with very basic c++ pointer problem in my curvilinear grid. The file grid.hh contains 2 functions:

    const CollectiveCommunication &comm () const  { return mpihelper_.getCollectiveCommunication(); }

    MPIHelper & mpihelper()  const { return mpihelper_; }

One of them returns the MPIHelper reference, the other the CollectiveCommunication reference.


I write a test program:

Grid * grid = factory.createGrid();

std::cout << "rank v1 = " << grid->comm().rank() << std::endl;
std::cout << "rank v2 = " << grid->mpihelper().getCollectiveCommunication().rank() << std::endl;

the result for a serial run is
-1183734688
0

And the first result puzzles me a lot, as I expect it to be equal to the 2nd one. Otherwise, the grid is functioning well, so it is definitely initialized

Any ideas?

Greetings,
Aleksejs




More information about the Dune mailing list