From 73e9b2804f03dfded194c0f1e4e1546a51ecc090 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 2 Feb 2018 19:20:58 +0000 Subject: [PATCH] PstreamGlobals::MPI_COMM_FOAM: New OpenFOAM specific MPI communicator Splitting MPI_COMM_FOAM from MPI_COMM_WORLD allows OpenFOAM to be linked with other libraries communicating via MPI. Resolves feature request https://bugs.openfoam.org/view.php?id=2815 --- src/Pstream/mpi/PstreamGlobals.C | 4 ++- src/Pstream/mpi/PstreamGlobals.H | 21 ++++++------ src/Pstream/mpi/UOPwrite.C | 8 ++--- src/Pstream/mpi/UPstream.C | 32 +++++++++++++++---- .../decompose/ptscotchDecomp/Make/options | 1 + .../decompose/ptscotchDecomp/ptscotchDecomp.C | 9 ++++-- src/renumber/zoltanRenumber/Make/options | 1 + src/renumber/zoltanRenumber/zoltanRenumber.C | 4 +-- 8 files changed, 53 insertions(+), 27 deletions(-) diff --git a/src/Pstream/mpi/PstreamGlobals.C b/src/Pstream/mpi/PstreamGlobals.C index 1acbe583f..8ca8c1720 100644 --- a/src/Pstream/mpi/PstreamGlobals.C +++ b/src/Pstream/mpi/PstreamGlobals.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,8 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +MPI_Comm PstreamGlobals::MPI_COMM_FOAM; + // Outstanding non-blocking operations. //! \cond fileScope DynamicList PstreamGlobals::outstandingRequests_; diff --git a/src/Pstream/mpi/PstreamGlobals.H b/src/Pstream/mpi/PstreamGlobals.H index f87a55b0c..e029816cb 100644 --- a/src/Pstream/mpi/PstreamGlobals.H +++ b/src/Pstream/mpi/PstreamGlobals.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,23 +51,20 @@ namespace Foam namespace PstreamGlobals { + extern MPI_Comm MPI_COMM_FOAM; -extern DynamicList outstandingRequests_; + extern DynamicList outstandingRequests_; -//extern int nRequests_; -//extern DynamicList