[Dune] dune 2.4.1 and parallelism
Dominic Kempf
dominic.r.kempf at gmail.com
Mon Jun 13 11:43:44 CEST 2016
Hey Marco,
I would also recommend a read through our build system docs here:
https://beta.dune-project.org/buildsystem/
You should then
* port your flags to CMake equivalents
* *not* set your C/C++ compiler to mpicc/mpicxx manually
The build system should find MPI all by itself, and as we switched the
default
to parallel builds, your executables should be compiled with MPI support.
Best,
Dominic
On Mon, Jun 13, 2016 at 11:14 AM, Marco Cisternino <
marco.cisternino at optimad.it> wrote:
> Hi duners,
> I have a problem with dune modules common, geometry, grid, subgrid,
> alugrid building
> Everything works fine, apparently, but making a new default module I
> cannot get the helper working in parallel
>
> My file opts
> CMAKE_FLAGS="CMAKE_CXX_COMPILER=mpicxx CMAKE_C_COMPILER=mpicc
> --enable-parallel --disable-documentation --with-metis --with-parmetis
> -enable-experimental-grid-extensions --with-lapack --with-blas"
>
> The default code enriched by some calls to MPI routines:
> #ifdef HAVE_CONFIG_H
> # include "config.h"
> #endif
> #include <iostream>
> #include <dune/common/parallel/mpihelper.hh> // An initializer of MPI
> #include <dune/common/exceptions.hh> // We use exceptions
> #include <mpi.h>
>
> int main(int argc, char** argv)
> {
> try{
> MPI_Init(&argc,&argv);
> // Maybe initialize MPI
> Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
> std::cout << "Hello World! This is intersectionBug." << std::endl;
> int rank;
> MPI_Comm_rank(MPI_COMM_WORLD,&rank);
> std::cout << "I'm" << rank << " " << helper.rank()<< std::endl;
> 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;
> MPI_Finalize();
> }
> catch (Dune::Exception &e){
> std::cerr << "Dune reported error: " << e << std::endl;
> }
> catch (...){
> std::cerr << "Unknown exception thrown!" << std::endl;
> }
> }
>
> Direct calls to MPI routines work fine giving parallel outputs. I had to
> add explicit call to MPI_Init because MPI is not initialize by the helper
> instance method.
> Instead, helper methods answer like the code is sequential.
> Probably my opts file is wrong... I'm using a very old one adapted for
> cmake
>
> If you need more information about modules building, just ask, please.
> Thanks for you help.
>
> Marco
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20160613/bf03965b/attachment.htm>
More information about the Dune
mailing list