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

Aleksejs Fomins aleksejs.fomins at lspr.ch
Thu Nov 27 10:34:48 CET 2014


Dear Marcus,

Thank you for your reply. I will follow your advices :)

Cheers,
Aleksejs

On 11/27/2014 10:14 AM, Markus Blatt wrote:
> Hi,
> 
> up front:
> 
> Do not use #ifdef HAVE_MPI, but #if HAVE_MPI. We are using a trick to
> enable MPI only if the compilation flags include our MPI flags. To
> accomplish this HAVE_MPI will always be defined if your system
> provides even DUNE does not activate it.
> 
> The same (#if instead of #ifdef) holds for the following defines
> HAVE_DUNE_BOOST
> HAVE_GMP
> HAVE_UMFPACK
> HAVE_ALUGRID
> HAVE_ALBERTA
> HAVE_UG
> HAVE_PARMETIS
> HAVE_SUPERLU
> HAVE_PETSC
> 
> On Thu, Nov 27, 2014 at 09:42:48AM +0100, Aleksejs Fomins wrote:
>> 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
>>
> 
> As long as you do not call any MPI routines directly, but use
> MPI_Helper, etc that is true. We use template specializations to
> provide sequential fallbacks.
> 
>> 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
>>
> 
> That is the way to go, if you do not call any MPI functions directly.
> 
> Markus
> 
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
> 

-------------- 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/4571c787/attachment.sig>


More information about the Dune mailing list