[Dune] MPI Handling in dgfparser

Peter Bastian Peter.Bastian at iwr.uni-heidelberg.de
Sun Jul 16 08:29:40 CEST 2006


Andreas Dedner wrote:
> 
> Thimo Neubauer wrote:
>> How about wrapping the MPI-startup in a helper class? This would allow
>> for something as easy to write as the first pattern (and without any
>> defines):
>>
>>   MPIHelper mpihelper;
>>
>>   grid("name", mpihelper::MPI_COMM_WORLD);
>>   // or grid("name", mpihelper)
>>   
> 
> Once you see it, it seems the obvious solution...
> One could use the Dummy class to define the default argument, so that
> users without mpi do not have to see anything disturbing with
> MPI...
> 
This is a nice solution! Some questions:

- Is there a different helper class for each grid then? (It should be).

- Why can't these be singletons, this would remove the burden of MPI 
initialization from the user altogether. On the other hand several grids 
might use MPI, then only one needs to initialize it (Which is also a 
problem of the solution above, BTW).

-- Peter
------------------------------------------------------------------
Peter Bastian, IWR,Uni Heidelberg, INF 348,R 020, 69120 Heidelberg
email: Peter.Bastian at iwr.uni-heidelberg.de   Tel: +49 6221 54 4984
WWW: http://www.iwr.uni-heidelberg.de/~Peter.Bastian Fax: ... 8860





More information about the Dune mailing list