Commit bb0898d2 authored by Henry Weller's avatar Henry Weller
Browse files

globalMeshData: Changed the communicator for the reductions

Avoids problems with overlapping communicationbetween these reductions
and the calculation of deltaCoeffs.  This is a temporary fix while code
reorganizations are undertaken to ensure the globalMeshData is updated
before deltaCoeffs are requested.

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1780
parent 07e0e27c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -2746,22 +2746,44 @@ void Foam::globalMeshData::updateMesh() ...@@ -2746,22 +2746,44 @@ void Foam::globalMeshData::updateMesh()
Pout<< "globalMeshData : merge dist:" << tolDim << endl; Pout<< "globalMeshData : merge dist:" << tolDim << endl;
} }
// *** Temporary hack to avoid problems with overlapping communication
// *** between these reductions and the calculation of deltaCoeffs
label comm = UPstream::worldComm + 1;
// Total number of faces. // Total number of faces.
nTotalFaces_ = returnReduce(mesh_.nFaces(), sumOp<label>()); nTotalFaces_ = returnReduce
(
mesh_.nFaces(),
sumOp<label>(),
Pstream::msgType(),
comm
);
if (debug) if (debug)
{ {
Pout<< "globalMeshData : nTotalFaces_:" << nTotalFaces_ << endl; Pout<< "globalMeshData : nTotalFaces_:" << nTotalFaces_ << endl;
} }
nTotalCells_ = returnReduce(mesh_.nCells(), sumOp<label>()); nTotalCells_ = returnReduce
(
mesh_.nCells(),
sumOp<label>(),
Pstream::msgType(),
comm
);
if (debug) if (debug)
{ {
Pout<< "globalMeshData : nTotalCells_:" << nTotalCells_ << endl; Pout<< "globalMeshData : nTotalCells_:" << nTotalCells_ << endl;
} }
nTotalPoints_ = returnReduce(mesh_.nPoints(), sumOp<label>()); nTotalPoints_ = returnReduce
(
mesh_.nPoints(),
sumOp<label>(),
Pstream::msgType(),
comm
);
if (debug) if (debug)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment