[Dune] communication of dynamic vectors

Markus Blatt markus at dr-blatt.de
Thu Mar 15 11:11:48 CET 2012


Hi,

On Thu, Mar 15, 2012 at 10:31:52AM +0100, arya fallahi wrote:
> So, as you see "Vector" in the communicator is "std::vector<LocalVector>" When I determine LocalVector through the following line:
> 
> typedef Dune::FieldVector<double,6> LocalVector;
> 
> Everything is ok, including the run on multiple processors. However, when I determine LocalVector through the following line:
> 
> typedef Dune::DynamicVector<double> LocalVector;
> 
> The run performs successfully only on one processor and on multiple
> ones I receive the following error when I let it run on 2 processors
> (no matter if the fixedsize is true or false): 

Notice the difference between FieldVector and DynamicVector. The former
stores its data in a member and can be memcopied. The later stores its
data in vector, which stores its data in a pointer. Therefore memcopy
will not do what you expect (it just copies the pointer adress, which
is not valid on any other process.). I fear that most (if not all)
grids just use a simple memcopy to read and write to the
message buffer. (others might have more insight, here)

You probably have to rewrite your scatter and gather routines for DynamicVector
and read/write each local entry of the vector by hand.

Hope that helps!

Cheers,

Markus
-- 
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