[Dune] Should we use #ifdef HAVE_MPI in parallel GMSH Reader

Aleksejs Fomins aleksejs.fomins at lspr.ch
Thu Nov 27 09:42:48 CET 2014


Dear Dune,

I have at some point written a parallel curvilinear GMSH reader, which
reads the GMSH file in blocks.

For that purpose, I use mpihelper everywhere for collective
communication. I have written the code, defining the mpihelper only if
HAVE_MPI=true. At the moment, the code will not work, if HAVE_MPI=false,
and that I would like to change.

I have heard that even if there is no mpi in the system, Dune is capable
of faking it to an extent. I see 2 solutions

1) Delete all #ifdef HAVE_MPI statements, and use mpihelper even if
there is no mpi. In that case the question is if the fake helper can
successfully fake things like

mpihelper_.getCollectiveCommunication().allgather(...);

necessary for communication and

Dune::MPIHelper::getCommunicator();

necessary for ParMetis

2) Not to use mpihelper in the serial case at all. Put #ifdef HAVE_MPI
wherever the mpihelper is used, and write alternative code for serial case.



Naturally, I would prefer the first option if it is possible, since it
involves less work and shorter code. So do you think it could work, and
would it be ethically correct to do so?

Regards,
Aleksejs

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20141127/d9199be3/attachment.sig>


More information about the Dune mailing list