[Dune] ALUSimplexGrid<3, 3>::loadBalance(DataHandle&) appears to expect something else than a DataHandle

Martin Nolte nolte at mathematik.uni-freiburg.de
Sat Nov 20 14:00:46 CET 2010


Hi Jö,

the layout of the data handle for loadBalance was never officially discussed.
Indeed, ALUGrid originally used (and can still use) a data handle derived from
the internal ALUGrid structure. This data handle is only called for codim-0
entities on the macrogrid. The user has to perform the necessary hierarchical
walkthrough on his own.

When wrapping this loadBalance method for GeometryGrid, I thought this interface
unnecessarily complicated and tried to use the one we all know, i.e., I wrote an
adapter class transforming the DataHandleIF into the DataHandle expected by
ALUGrid. If you pass a DataHandleIF (it has to be the interface class!) to
ALUGrid, this adapter will automatically be plugged in. Otherwise, ALUGrid
assumes that it's "native" data handle is provided. In the dune-grid school we
did in 2009 in Heidelberg, we successfully used the DataHandleIF version.

To be a bit more specific, ALUGrid provides to loadBalance methods that
communicate data:

  template< class T, class I >
  bool loadBalance ( DataHandleIF< T, I > &dataHandle );

  template< class DataHandle >
  bool loadBalance ( DataHandle &dataHandle );

The first method is what you expected, the second one is ALUGrid's "native" version.

To me, the use of DataHandleIF seems more intuitive. On the other hand, it is
misuse of the interface in the following sense:
a) You can only pass one data handle. Hence, this data handle has to be capable
of gathering / scattering all data. This is only possible, if all data has a
common "Data" type (actually ALUGrid does not care for this type internally).
b) DataHandleIF was designed to transfer data on one grid view (as they are
called today). During load balancing, we transfer data on the whole hierarchy.
Consequently, if I want to communicate one value on the leaf level, there are
two possibilities: Communicating nothing on the non-leafs leads to fixed-size
returning false. Communicating a dummy value on the non-leafs increases the
amount of data to be transferred.

Someday, this issue will have to be discussed on a developer meeting. This
discussion won't make sense until there is another grid implementation that
supports dynamic load balancing, though.

Best,

Martin


On 11/20/2010 02:53 AM, Jö Fahlke wrote:
> Hi!
> 
> I'm trying to read in a grid and data attached to it's elements and boundary
> segments via the GmshReader.  For a parallel ALUSimplexGrid<3,3> I believe I
> have to create a GridFactory on all ranks, read the grid file into the factory
> using the GmshReader on rank 0 only (this also gives me the data attached to
> the grid) and then call loadBalance() on the grid.  The Grid documentation
> (http://www.dune-project.org/doc/doxygen/html/classDune_1_1Grid.html) says:
> 
> | template<class DataHandle>
> | bool loadBalance (DataHandle &data)
> |
> | Re-balances the load each process has to handle for a parallel grid, the
> | DataHandle data works like the data handle for the communicate methods. If
> | grid has changed , true is returned.
> 
> I.e. if I want to redistribute the data I have to write a DataHandle for it.
> 
> I've done that, but now ALUGrid appears to expect the DataHandle to have a
> method compress(), which is not part of the DataHandle interface.  Indeed, the
> documentation for ALUSimplexGrid<3,3>
> (http://www.dune-project.org/doc/doxygen/html/classDune_1_1ALUSimplexGrid_3_013_00_013_01_4.html)
> says something quite different.  Most unsettling is that the DataHandler that
> ALUSimplexGrid<3,3> requires appear to unly support codim 0 communication.
> 
> Is this correct, does ALUSimplexGrid<3,3>::loadBalance(DataHandle) require
> some non-standard DataHandle?  And is it further correct that
> ALUSimplexGrid<3,3>::loadBalance(DataHandle) can only communicate codim 0
> data?
> 
> Bye,
> Jö.
> 
> 
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-- 
Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5642
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune mailing list