diff --git a/applications/test/00-dummy/library/mpi/dummyMpiLib.cpp b/applications/test/00-dummy/library/mpi/dummyMpiLib.cpp index a0c5ed3430..cd01738148 100644 --- a/applications/test/00-dummy/library/mpi/dummyMpiLib.cpp +++ b/applications/test/00-dummy/library/mpi/dummyMpiLib.cpp @@ -27,6 +27,14 @@ License #include "dummyLib.H" #include + +// Include MPI without any C++ bindings +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif #include // * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * * // diff --git a/applications/test/parallel-comm2/Test-parallel-comm2.C b/applications/test/parallel-comm2/Test-parallel-comm2.C index 5f9f575bf6..6da3b03faa 100644 --- a/applications/test/parallel-comm2/Test-parallel-comm2.C +++ b/applications/test/parallel-comm2/Test-parallel-comm2.C @@ -40,6 +40,14 @@ Description #include "IOstreams.H" #include "PstreamReduceOps.H" #include "SHA1.H" + +// Include MPI without any C++ bindings +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif #include using namespace Foam; diff --git a/applications/test/parallel-comm3a/Test-parallel-comm3a.C b/applications/test/parallel-comm3a/Test-parallel-comm3a.C index 26403bc256..2dc745988b 100644 --- a/applications/test/parallel-comm3a/Test-parallel-comm3a.C +++ b/applications/test/parallel-comm3a/Test-parallel-comm3a.C @@ -40,10 +40,19 @@ Description #include "IOstreams.H" #include "StringStream.H" #include "Random.H" + +// Include MPI without any C++ bindings +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif #include using namespace Foam; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // void printRequests(const UList& requests) { diff --git a/applications/test/parallel-external-init/Test-parallel-external-init.C b/applications/test/parallel-external-init/Test-parallel-external-init.C index a838739ee1..6c1af9fedc 100644 --- a/applications/test/parallel-external-init/Test-parallel-external-init.C +++ b/applications/test/parallel-external-init/Test-parallel-external-init.C @@ -38,10 +38,17 @@ Description #include "vector.H" #include "IOstreams.H" #include "Pstream.H" - -#include #include +// Include MPI without any C++ bindings +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif +#include + using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/test/processorTopology/Test-processorTopology.C b/applications/test/processorTopology/Test-processorTopology.C index ffad839c58..786e5bf070 100644 --- a/applications/test/processorTopology/Test-processorTopology.C +++ b/applications/test/processorTopology/Test-processorTopology.C @@ -33,6 +33,14 @@ Description #include "polyMesh.H" #include "globalMeshData.H" #include "OFstream.H" + +// Include MPI without any C++ bindings +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif #include using namespace Foam; diff --git a/src/Pstream/mpi/PstreamGlobals.H b/src/Pstream/mpi/PstreamGlobals.H index d2ce681ce0..fb8aaec350 100644 --- a/src/Pstream/mpi/PstreamGlobals.H +++ b/src/Pstream/mpi/PstreamGlobals.H @@ -41,6 +41,14 @@ SourceFiles #include "DynamicList.H" #include "UPstream.H" // for UPstream::Request + +// Include MPI without any C++ bindings +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif #include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/Pstream/mpi/UPstreamWrapping.H b/src/Pstream/mpi/UPstreamWrapping.H index 984a4f857e..828c9336d0 100644 --- a/src/Pstream/mpi/UPstreamWrapping.H +++ b/src/Pstream/mpi/UPstreamWrapping.H @@ -39,6 +39,14 @@ SourceFiles #define Foam_UPstreamWrapping_H #include "UPstream.H" + +// Include MPI without any C++ bindings +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif #include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/parallel/decompose/kahipDecomp/kahipDecomp.C b/src/parallel/decompose/kahipDecomp/kahipDecomp.C index bc3990d107..8d29fdd6ac 100644 --- a/src/parallel/decompose/kahipDecomp/kahipDecomp.C +++ b/src/parallel/decompose/kahipDecomp/kahipDecomp.C @@ -29,13 +29,20 @@ License #include "addToRunTimeSelectionTable.H" #include "Time.H" #include "PrecisionAdaptor.H" +#include +#include +#include + +// Probably not needed, but in case we pickup parhip_interface.h +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif #include "kaHIP_interface.h" -#include -#include -#include - // Provide a clear error message if we have a severe size mismatch // Allow widening, but not narrowing diff --git a/src/parallel/decompose/metisDecomp/metisDecomp.C b/src/parallel/decompose/metisDecomp/metisDecomp.C index 41fc7258c5..efa706b58b 100644 --- a/src/parallel/decompose/metisDecomp/metisDecomp.C +++ b/src/parallel/decompose/metisDecomp/metisDecomp.C @@ -32,8 +32,12 @@ License #include "PrecisionAdaptor.H" // Probably not needed... +#ifndef MPICH_SKIP_MPICXX #define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX #define OMPI_SKIP_MPICXX +#endif #include "metis.h" diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C index 6fc60079e7..cbe191fa8f 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C @@ -32,12 +32,20 @@ License #include "Time.H" #include "PrecisionAdaptor.H" #include "OFstream.H" +#include #include +// Include MPI without any C++ bindings +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif + // Avoid too many warnings from mpi.h #pragma GCC diagnostic ignored "-Wold-style-cast" -#include #include #include "ptscotch.h" diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.C b/src/parallel/decompose/scotchDecomp/scotchDecomp.C index a16695326b..1768b7169e 100644 --- a/src/parallel/decompose/scotchDecomp/scotchDecomp.C +++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.C @@ -32,11 +32,16 @@ License #include "Time.H" #include "PrecisionAdaptor.H" #include "OFstream.H" +#include #include // Probably not needed, but in case we pickup a ptscotch.h ... +#ifndef MPICH_SKIP_MPICXX #define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX #define OMPI_SKIP_MPICXX +#endif #include "scotch.h" diff --git a/src/renumber/zoltanRenumber/zoltanRenumber.C b/src/renumber/zoltanRenumber/zoltanRenumber.C index cca2e8a07b..7b50f620d0 100644 --- a/src/renumber/zoltanRenumber/zoltanRenumber.C +++ b/src/renumber/zoltanRenumber/zoltanRenumber.C @@ -59,6 +59,14 @@ SourceFiles #include "globalIndex.H" #include "uint.H" +// Include MPI without any C++ bindings +#ifndef MPICH_SKIP_MPICXX +#define MPICH_SKIP_MPICXX +#endif +#ifndef OMPI_SKIP_MPICXX +#define OMPI_SKIP_MPICXX +#endif + #pragma GCC diagnostic ignored "-Wold-style-cast" #include "zoltan.h" #include