92 static MPICommunicator comm;
132 (void)argc; (void)argv;
141 int rank ()
const {
return 0; }
145 int size ()
const {
return 1; }
149 FakeMPIHelper(
const FakeMPIHelper&);
150 FakeMPIHelper& operator=(
const FakeMPIHelper);
184 return MPI_COMM_WORLD;
195 return MPI_COMM_SELF;
228 int rank ()
const {
return rank_; }
232 int size ()
const {
return size_; }
237 void prevent_warning(
int){}
240 MPIHelper(
int& argc,
char**& argv)
243 int wasInitialized = -1;
244 MPI_Initialized( &wasInitialized );
250 static int is_initialized = MPI_Init(&argc, &argv);
251 prevent_warning(is_initialized);
254 MPI_Comm_rank(MPI_COMM_WORLD,&rank_);
255 MPI_Comm_size(MPI_COMM_WORLD,&size_);
257 assert( rank_ >= 0 );
258 assert( size_ >= 1 );
260 dverb <<
"Called MPI_Init on p=" << rank_ <<
"!" << std::endl;
266 int wasFinalized = -1;
267 MPI_Finalized( &wasFinalized );
271 dverb <<
"Called MPI_Finalize on p=" << rank_ <<
"!" <<std::endl;
277 MPIHelper(
const MPIHelper&);
278 MPIHelper& operator=(
const MPIHelper);
287 typedef FakeMPIHelper MPIHelper;
static MPICommunicator getLocalCommunicator()
get a local communicator
Definition: parallel/mpihelper.hh:193
Dune namespace.
Definition: alignment.hh:13
int rank() const
return rank of process, i.e. zero
Definition: parallel/mpihelper.hh:141
static DUNE_EXPORT MPIHelper & instance(int &argc, char **&argv)
Get the singleton instance of the helper.
Definition: parallel/mpihelper.hh:218
Are we fake (i. e. pretend to have MPI support but are compiled without.
Definition: parallel/mpihelper.hh:168
static MPICommunicator getCommunicator()
get the default communicator
Definition: parallel/mpihelper.hh:182
int size() const
return rank of process, i.e. one
Definition: parallel/mpihelper.hh:145
int rank() const
return rank of process
Definition: parallel/mpihelper.hh:228
A fake mpi helper.
Definition: parallel/mpihelper.hh:68
MPI_Comm MPICommunicator
The type of the mpi communicator.
Definition: parallel/mpihelper.hh:174
#define DUNE_EXPORT
Export a symbol as part of the public ABI.
Definition: visibility.hh:18
Definition of macros controlling symbol visibility at the ABI level.
Definition: parallel/collectivecommunication.hh:41
int size() const
return number of processes
Definition: parallel/mpihelper.hh:232
Standard Dune debug streams.
Implements an utility class that provides collective communication methods for sequential programs...
static CollectiveCommunication< MPICommunicator > getCollectiveCommunication()
Definition: parallel/mpihelper.hh:199
A real mpi helper.This helper should be used for parallel programs.
Definition: parallel/mpihelper.hh:160
DVerbType dverb(std::cout)
Singleton of verbose debug stream.
Definition: stdstreams.hh:115
static DUNE_EXPORT MPICommunicator getCommunicator()
get the default communicator
Definition: parallel/mpihelper.hh:90
Implements an utility class that provides MPI's collective communication methods. ...
Collective communication interface and sequential default implementation.
Definition: parallel/collectivecommunication.hh:71
static DUNE_EXPORT FakeMPIHelper & instance(int argc, char **argv)
Get the singleton instance of the helper.
Definition: parallel/mpihelper.hh:130
static MPICommunicator getLocalCommunicator()
get a local communicator
Definition: parallel/mpihelper.hh:102
static CollectiveCommunication< MPICommunicator > getCollectiveCommunication()
Definition: parallel/mpihelper.hh:110
Are we fake (i.e. pretend to have MPI support but are compiled without.)
Definition: parallel/mpihelper.hh:76
No_Comm MPICommunicator
The type of the mpi communicator.
Definition: parallel/mpihelper.hh:82