[Dune] Weird behaviour of MPIHelper

Christian Engwer christian.engwer at uni-muenster.de
Tue May 19 21:07:22 CEST 2015


This definitely looks like a memory corruption, or missing
initialization. I think you'll have to start actually debugging. Did
you try valgrind?

If everything is clean, please add a minimal working example to
reproduce the bug (without curvilinear-grid!).

Ciao
Christian

On Tue, May 19, 2015 at 03:23:57PM +0200, Aleksejs Fomins wrote:
> 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
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
> 

-- 
Prof. Dr. Christian Engwer 
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster

E-Mail	christian.engwer at uni-muenster.de
Telefon	+49 251 83-35067
FAX		+49 251 83-32729




More information about the Dune mailing list