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
This commit is contained in:
Henry Weller
2015-09-13 22:21:53 +01:00
parent 82855f6aca
commit 511489a40b

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -2746,22 +2746,44 @@ void Foam::globalMeshData::updateMesh()
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.
nTotalFaces_ = returnReduce(mesh_.nFaces(), sumOp<label>());
nTotalFaces_ = returnReduce
(
mesh_.nFaces(),
sumOp<label>(),
Pstream::msgType(),
comm
);
if (debug)
{
Pout<< "globalMeshData : nTotalFaces_:" << nTotalFaces_ << endl;
}
nTotalCells_ = returnReduce(mesh_.nCells(), sumOp<label>());
nTotalCells_ = returnReduce
(
mesh_.nCells(),
sumOp<label>(),
Pstream::msgType(),
comm
);
if (debug)
{
Pout<< "globalMeshData : nTotalCells_:" << nTotalCells_ << endl;
}
nTotalPoints_ = returnReduce(mesh_.nPoints(), sumOp<label>());
nTotalPoints_ = returnReduce
(
mesh_.nPoints(),
sumOp<label>(),
Pstream::msgType(),
comm
);
if (debug)
{