[Dune] GridPtr: distribution of element and vertex parameters

Dedner, Andreas A.S.Dedner at warwick.ac.uk
Tue Sep 18 10:07:31 CEST 2012


Hi.

1)     DataHandle dh(*this);
           In the constructor of the DataHandle the parameters are copied from their vector container
           to a mapped based container, i.e., from index to id - in contrast to the communication we can
           not use index sets in this step since the grid is being modified
2)     gridPtr_->loadBalance( dh.interface() );
           ALU implements 2 version of the DataHandle - by casting down to the interface here, the general
           method is used. The data handle interface for communication looks similar to the communication data
           handle (in fact since you are only communicating macro level information it is identical)    
3)    gridPtr_->communicate( dh.interface(), InteriorBorder_All_Interface,ForwardCommunication)
           As you can see we can use exactly the same interface also for communication in this case 
           (no hierarchy). As Martin said this is to make sure that the ghost data is correctly set 

Best
Andreas


________________________________________
From: dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org [dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org] on behalf of Bernd Flemisch [bernd at iws.uni-stuttgart.de]
Sent: 18 September 2012 08:38
Cc: dune at dune-project.org
Subject: Re: [Dune] GridPtr: distribution of element and vertex parameters

Hey Martin,

thank you for your fast answer, I think I understand more now.

In fact, UGGrid also reads the macro grid onto one process and then
distributes it by means of the loadBalance(void) method. It is for this
first static load balancing step that I think it should be feasible to
also distribute the data. What people always warn us about is to have a
real dynamic load balancing, i.e. to balance after a grid adaptation has
been performed. Although I don't know what the underlying problem is /
will be.

Kind regards
Bernd

On 09/18/2012 09:24 AM, Martin Nolte wrote:
> Hi Bernd,
>
> I guess you have hit upon a part of the Dune grid interface that has
> not been thoroughly discussed: grid.loadBalance( dataHandle ). As far
> as I'm aware of, this method is only implemented for ALUGrid (or meta
> grids build on top of it).
>
> The semantics is as follows: loadBalance redistributes the grid
> between the set of processors. This means that entities are migrated
> from one process to another. But we need to migrate the data, too.
> Therefore, all data specified by the data handle (see Dune
> communication interface) is sent along with the entities. The only
> real difference between communication on a grid view and load balance
> is that load balance performs the communication on the hierarchical
> grid (of course, such a communicate method should also exist;
> unfortunately, it does not).
>
> Now to your problem: As far as I understood, it is not so easy
> implement dynamic load balancing for UGGrid. Instead, static load
> balancing is performed at creation time. I guess, this means you are
> reading the DGF file on each process, i.e., all processes already know
> their parameters (note that, in contrast, ALU reads everything on
> process 0). So, if I understand correctly, you can safely ignore the
> call to load balance, since it does not redistribute the grid, anyway.
>
> The call to communicate is used only to copy interior data to ghosts.
> This is needed for ALUGrid, because ghosts do not exist natively.
> Since the algorithm usually performs the necessary extra communication
> anyway, ALUGrid does not perform this communication.
>
> I hope this explains the status quo. If further problems arise, it
> might be better to discuss them on the flyspray.
>
> Just a final side note: In my opinion, a thorough discussion of the
> parallel grid interface is in order anyway (on one of the next meetings).
>
> Best,
>
> Martin
>
> On 09/18/2012 08:55 AM, Bernd Flemisch wrote:
>> Dear Dune,
>>
>> we would like to implement the distribution of a GridPtr's element
>> and vertex
>> parameters for UGGrid. The corresponding lines 249ff in gridptr.hh are
>>          DataHandle dh(*this);
>>          gridPtr_->loadBalance( dh.interface() );
>>          gridPtr_->communicate( dh.interface(),
>> InteriorBorder_All_Interface,ForwardCommunication);
>> Since the DataHandle below is not documented and since the
>> documentation of
>> the loadBalance(DataHandle&) method of the grid is not giving me any
>> clue:
>> Could you please explain me in a bit more detail what these three
>> lines are
>> supposed to do? In particular, I do not know which part is done by the
>> loadBalance and which part by the communicate method. What is
>> supposed to
>> happen with the DataHandle parameter inside the loadBalance method?
>>
>> Thank you. Kind regards
>> Bernd
>>
>


--
_____________________________________________________________________

Bernd Flemisch                               phone: +49 711 685 69162
IWS, Universität Stuttgart                   fax:   +49 711 685 60430
Pfaffenwaldring 61                  email: bernd at iws.uni-stuttgart.de
D-70569 Stuttgart                  url: www.hydrosys.uni-stuttgart.de
_____________________________________________________________________


_______________________________________________
Dune mailing list
Dune at dune-project.org
http://lists.dune-project.org/mailman/listinfo/dune






More information about the Dune mailing list