[Dune] About geometryInInSide in UGGrid

Oliver Sander sander at mi.fu-berlin.de
Fri Apr 3 17:09:53 CEST 2009


Inlining all of UGGrid will not help, because the problem persists in
UG proper.  When using MPI and UG you have to have UG compiled
with MPI.  Being able to have parallel and sequential UG at the same
time is principally feasible but a lot of work (it means, in particular,
introducing additional namespaces within UG).

--
Oliver

Andreas Lauser schrieb:
> Hi all,
>
> On Donnerstag, 2. April 2009 09:48:33 Markus Blatt wrote:
>   
>> On Wed, Apr 01, 2009 at 03:30:14PM +0200, Yufei Cao wrote:
>>     
>>> Thank you for your solution !
>>>
>>> I did it as what you said, then the code can be well
>>> compiled. However, when I run the code, I got the
>>> following error:
>>>
>>> Fatal error; unknown error handler
>>> May be MPI call before MPI_INIT.  Error message is
>>> MPI_COMM_RANK and code is 197
>>>       
>> This pretty much seems like UG thinks you are using MPI.
>>     
>
> This is perfectly possible and IMHO a major headache when using UGGrid in 
> DUNE. The problem is that the size of an UGGrid object depends on whether dune 
> grid is compiled with or without ENABLE_MPI. since UGGrid uses explicit 
> instantiation, it is only possible to link it to programs where ENABLE_MPI is 
> the same as when compiling dune-grid (i.e. it is not possible to link 
> sequential programs to a parallel libdunegrid). I suggested changing UGGrid  
> to implicit template instantiation in order to avoid these kinds of problems, 
> but it was not liked too much as it would increase compilation times. maybe 
> someone should give it a second thought...
>
>   
>> Just do as you are told:
>>
>> #include "config.h"
>> #include"dune/common/mpihelper.hh" // An initializer of MPI
>> #include"dune/common/exceptions.hh" // We use exceptions
>>
>> int main(int argc, char** argv){
>>   try{
>>     //Maybe initialize Mpi
>>     Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
>>
>>     // you might skip these lines
>>     if(Dune::MPIHelper::isFake)
>>       std::cout<< "This is a sequential program." << std::endl;
>>     else
>>       std::cout<<"I am rank "<<helper.rank()<<" of "<<helper.size()
>>         <<" processes!"<<std::endl;
>>
>>     // your code
>>     ....
>>   }catch (Dune::Exception &e){
>>     std::cerr << "Dune reported error: " << e << std::endl;
>>   }
>> }
>>     
>
> this will probably result in "This is a sequential program", but UGGrid calls 
> MPI anyway because libdunegrid was compiled with ENABLE_MPI=1
>
> Kind Regards
>   Andreas
>
>   


-- 
************************************************************************
* Oliver Sander                ** email: sander at mi.fu-berlin.de        *
* Freie Universität Berlin     ** phone: + 49 (30) 838 75348           *
* Institut für Mathematik      ** URL  : page.mi.fu-berlin.de/~sander  *
* Arnimallee 6                 ** -------------------------------------*
* 14195 Berlin, Germany        ** Member of MATHEON (www.matheon.de)   *
************************************************************************





More information about the Dune mailing list