Basically there are two helpers available:.
Example of who to use these classes:
A program that is parallel if compiled with MPI and sequential otherwise:
int main(int argc, char** argv){ typedef Dune::MPIHelper MPIHelper; MPIHelper::instance(argc, argv); typename MPIHelper::MPICommunicator world = MPIHelper::getCommunicator(); ...
If one wants to have sequential program even if the code is compiled with mpi then one simply has to exchange the typedef with
typedef Dune::MPIHelper FakeMPIHelper;
For checking whether we really use MPI or just fake please use MPIHelper::isFake (this is also possible at compile time!)
#include <cassert>
#include "collectivecommunication.hh"
#include "mpi.h"
#include "mpicollectivecommunication.hh"
#include "stdstreams.hh"
Go to the source code of this file.
Namespaces | |
namespace | Dune |
Classes | |
class | Dune::FakeMPIHelper |
A fake mpi helper. More... | |
class | Dune::MPIHelper |
A real mpi helper.
This helper should be used for parallel programs. More... |