Skip to content
Snippets Groups Projects
Commit 61185cad authored by Christian Engwer's avatar Christian Engwer
Browse files

- use empty struct as fake_mpi_communicator type. this avoids accidential...

- use empty struct as fake_mpi_communicator type. this avoids accidential compatibility with a real mpi implementation.
- call MPI_Init only once.

[[Imported from SVN: r5924]]
parent ea5891f1
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,7 @@ namespace Dune
/**
* @brief The type of the mpi communicator.
*/
typedef int MPICommunicator;
struct MPICommunicator {};
/**
* @brief Get the default communicator.
......@@ -86,7 +86,8 @@ namespace Dune
*/
static MPICommunicator getCommunicator()
{
return -1;
static MPICommunicator comm();
return comm;
}
static CollectiveCommunication<MPICommunicator>
......@@ -208,7 +209,7 @@ namespace Dune
{
rank_ = -1;
size_ = -1;
MPI_Init(&argc, &argv);
static int is_initialized = MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD,&rank_);
MPI_Comm_size(MPI_COMM_WORLD,&size_);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment