Skip to content
Snippets Groups Projects
Commit ed3e3167 authored by Steffen Müthing's avatar Steffen Müthing
Browse files

[MPI] Make parallel version CollectiveCommunication default-constructible

In order to simplify fallback handling between code with and without MPI
support, this patch makes the specialization of CollectiveCommunication
for MPI communicators default-constructible by defaulting the underlying
MPI communicator to MPI_COMM_WORLD, which should be reasonable for most
scenarios.

As the non-specialized version for sequential code is already
default-constructible, this allows grid constructors to accept a
CollectiveCommunication object regardless of whether MPI support is
enabled or not and to provide a default value for this parameter.

This patch resolves FS#1497.
parent 1a902a1e
No related branches found
No related tags found
No related merge requests found
......@@ -146,7 +146,7 @@ namespace Dune
{
public:
//! Instantiation using a MPI communicator
CollectiveCommunication (const MPI_Comm& c)
CollectiveCommunication (const MPI_Comm& c = MPI_COMM_WORLD)
: communicator(c)
{
if(communicator!=MPI_COMM_NULL) {
......
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