[Dune] Weird behaviour of MPIHelper

Aleksejs Fomins aleksejs.fomins at lspr.ch
Tue May 19 15:28:50 CEST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJVWzqSAAoJEDkNM7UOEwMZgxEP/iL0mj7E/os0cqxgPKNH3Pg7
BdenRCd+j4ZhcMGQVGPZo3qRcFnJq0cOX1nvjyHBuLPV6pv6dqWQIoG1I5EQhDMQ
meo9534vf/Mk2t8bwpJ4DkBfC9xWcwStjB8BrpK+BTrtmm3kgqpum7sNoDe5g3NW
11Ioayg97j/fkAfakhk2VbaCWWeVelOVzIVOle2OOBXfvTsLIzdXYIzDuRWTJKSR
cJ53LLyOiQxsm6McGTwX+bie2H6Cl2SKB5twy7GCcOvFV8yu+KbuNzeS7Huqjsyc
biwJuyeS74hCD3PCeFmWlwb4R63epBrXv9TMK/qRNY0fT7gBpJAUkEkRS9Ohn/6t
ExJh295XZkRor6554MvoYn2S0RQ+5ATxaGCQqB4Rxqpfx1Ig3kuJdT4BCajfQ9wI
tZZkIA+6rYn5gkgGDX9PpQETZwIK3aQydJPBib237KAcRHDEzlwkCcL5LARCXUlX
yMzFHuAIEXraXKRHH/z6Ku2TamJGl/Liv6AvVJ8n0br8KHZny5VPZNB1a0T+rcfh
gtW/RJ2yfDY0FpBLldR5DrvfNZeTBqaFCJ2XHCY3jNeHpTAxAlMNTza/JZIh7umM
PfHK+Pwr81JBcBsG8HiRba0aIoXHQ6L/x0GOag5sUpd8iBo1o6iJ4Tv415ib43It
VPlbTFJ3YoPYhemMEZZR
=1Yms
-----END PGP SIGNATURE-----




More information about the Dune mailing list