[Dune] GmshReader in parallel applications

Jö Fahlke jorrit at jorrit.de
Tue Mar 10 22:36:00 CET 2015


Am Tue, 10. Mar 2015, 16:57:29 +0000 schrieb Radcliffe, Alastair:
> Hi fellow Duners,
> 
> Has anyone out there ever successfully used the Dune::GmshReader in
> *parallel* executions ?
> 
> I'm using release 2.3 of all the core modules, and the following
> code snippet works great in serial (./myprog):
> 
>   Dune::GridPtr<GridType> gridPtr( Dune::GmshReader<GridType>::read(
> gridfile, true, false ) );

Uh, I'm surprised that works.  You're read() returns *GridType (a C-Pointer to
GridType).  GridPtr is the DGF-Parser...  (Yes, I know, the class name could
use improvements.)  I'd simply put the result of read() into a
shared_ptr<GridType> or unique_ptr<GridType>.

Anyway, I asked about this (and more) last month, you can read the thread
here: http://lists.dune-project.org/pipermail/dune/2015-February/013406.html

Basically, you have to use the methods on the gmsh-reader that take a grid
factory to fill.  Create the grid factory on all ranks, use the gmsh-reader to
fill the factory on rank 0 only, then let the gridfactory create the grid on
all ranks, and finally call loadBalance() on the new grid.  Examples of this
are in dune-grid/src/gmsh-to-alu (for the old alugrid 1.52).

This is true if you are using UG or the old alugrid 1.52.  For the new
alugrid, please read the thread above and the alugrid paper.

Regards,
Jö.

> but hangs in parallel runs (mpiexec -np 2 myprog) ...
> 
> Any suggestions would be most welcome.

-- 
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

A mathematician is a device to turn coffee into theorems.
-- Paul Erdős
-------------- 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/20150310/a352f993/attachment.sig>


More information about the Dune mailing list