[Dune] Writing and reloading an alugrid with data attached

Jö Fahlke jorrit at jorrit.de
Fri Feb 18 23:49:23 CET 2011


Am Fri, 18. Feb 2011, 17:57:52 +0100 schrieb Robert Kloefkorn:
> we are talking about to different things here.
> 
> First, ALUGrid can read distributed macro grid files, but up to now they
> have to be in ALUGrid format. This means no data can be attached.
> However, element numbers (localId and most probably leafIndex) will be
> as they occur in the macro grid file, meaning first element =0, ...

OK, so I should probably save pairs of (localId, data) into an extra file (one
file per rank).

> When writing a checkpoint the grid is actually restored such that
> indices and so on should be the same. We wrote this down at the last
> meeting.

I didn't want to use checkpoint/restart since that is not ready yet.  And when
load-balancing I only have the macrogrid anyway.

> The way I suggest is to go to your big machine with shared memory read
> the grid and distribute to whatever proc number you like.
> The proc numbers can be smaller than the number you want to use later.
> The write the checkpoint, I think writeGrid is the method on ALUGrid,
> and readGrid to read again.

I'm using writeMacroGrid() currently, I can switch to writeGrid() later.

At the moment I have a problem with loadBalance() and the globalIdSet: I'm
loadbalancing to two processes, so the initially rank 0 has the grid read by
gmsh and rank 1's grid is empty.  Then I get the following assertion:

lt-dune-gmsh-to-alusimplex-3d: ../../dune/grid/alugrid/3d/indexsets.hh:812: typename Dune::ALU3dGrid<elType, Comm>::Traits::GlobalIdType Dune::ALU3dGridGlobalIdSet<elType, Comm>::id(const typename Dune::ALU3dGrid<elType, Comm>::Codim<codim>::Entity&) const [with int codim = 0, Dune::ALU3dGridElementType elType = (Dune::ALU3dGridElementType)4u, Comm = ompi_communicator_t*]: Assertion `ids_[codim].find( hset_.index(ep) ) != ids_[codim].end()' failed.

This happen inside the datahandle's scatter method on rank 1, when trying to
determine the globalId of the element I'm receiving data for.  From gdb it
looks like the globalIdSet is empty on rank 1.

To reproduce: update dune-grid to at least trunk at 7437, and do

  dunecontrol --only=dune-grid all
  cd dune-grid/utility/gmsh-to-alu
  make dune-gmsh-to-alusimplex-3d
  mpirun -np 2 ./dune-gmsh-to-alusimplex-3d ../../doc/grids/gmsh/pyramid4.msh pyramid pyramid-data

> Martin and I, we wanted to implement the BackupRestoreFactory Interface
> to have it already in the release. Maybe you wait some days.
> In any case the loadBalancing of your data and the backup/restore of
> these have to be done by yourself.

I guess, I will adapt the program when backup/restore is ready.  This means it
will work with grids as well (although I have no need for that currently.

Thanks,
Jö.

-- 
Den Slogan "Wer Deutschland nicht liebt, soll Deutschland verlassen!"
kommentierte eine Kellnerin in einem Restaurant unter den Linden mit:
"Sind die bekloppt?  Wer soll denn dann noch arbeiten gehen?"
-- aus http://de.indymedia.org/2007/08/191280.shtml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110218/c4aa4dd6/attachment.sig>


More information about the Dune mailing list