Skip to content
Commits on Source (2)
......@@ -403,8 +403,7 @@ void Foam::Module::boundaryLayers::findPatchesToBeTreatedTogether()
{
procPatches[Pstream::myProcNo()][i] = flattenedPatches[i];
}
Pstream::gatherList(procPatches);
Pstream::scatterList(procPatches);
Pstream::allGatherList(procPatches);
forAll(procPatches, procI)
{
......
......@@ -412,8 +412,7 @@ Foam::label Foam::Module::help::groupMarking
labelList nGroupsAtProc(Pstream::nProcs());
nGroupsAtProc[Pstream::myProcNo()] = nGroups;
Pstream::gatherList(nGroupsAtProc);
Pstream::scatterList(nGroupsAtProc);
Pstream::allGatherList(nGroupsAtProc);
label startGroup(0), totalNumGroups(0);
for (label procI = 0; procI < Pstream::nProcs(); ++procI)
......
......@@ -183,8 +183,7 @@ void Foam::Module::partTetMesh::createParallelAddressing
labelList nPointsAtProc(Pstream::nProcs());
nSharedPoints -= nLocalPoints;
nPointsAtProc[Pstream::myProcNo()] = points_.size() - nSharedPoints;
Pstream::gatherList(nPointsAtProc);
Pstream::scatterList(nPointsAtProc);
Pstream::allGatherList(nPointsAtProc);
for (label i = 0; i < Pstream::myProcNo(); ++i)
{
......
......@@ -186,8 +186,7 @@ void Foam::Module::partTriMesh::createParallelAddressing
labelList nPointsAtProc(Pstream::nProcs());
nSharedPoints -= nLocalPoints;
nPointsAtProc[Pstream::myProcNo()] = pts.size() - nSharedPoints;
Pstream::gatherList(nPointsAtProc);
Pstream::scatterList(nPointsAtProc);
Pstream::allGatherList(nPointsAtProc);
for (label i = 0; i < Pstream::myProcNo(); ++i)
{
......
......@@ -213,8 +213,8 @@ void Foam::Module::polyMeshGenAddressing::calcGlobalPointLabels() const
label startPoint(0);
labelList nPointsAtProc(Pstream::nProcs());
nPointsAtProc[Pstream::myProcNo()] = nLocalPoints;
Pstream::gatherList(nPointsAtProc);
Pstream::scatterList(nPointsAtProc);
Pstream::allGatherList(nPointsAtProc);
for (label i = 0; i < Pstream::myProcNo(); ++i)
{
startPoint += nPointsAtProc[i];
......@@ -346,8 +346,8 @@ void Foam::Module::polyMeshGenAddressing::calcGlobalFaceLabels() const
labelList numberOfInternalFaces(Pstream::nProcs());
numberOfInternalFaces[Pstream::myProcNo()] = nIntFaces + nBoundaryFaces;
Pstream::gatherList(numberOfInternalFaces);
Pstream::scatterList(numberOfInternalFaces);
Pstream::allGatherList(numberOfInternalFaces);
for (label i = 0; i < Pstream::myProcNo(); ++i)
{
startFace += numberOfInternalFaces[i];
......@@ -418,8 +418,7 @@ void Foam::Module::polyMeshGenAddressing::calcGlobalFaceLabels() const
numberOfBoundaryFaces[Pstream::myProcNo()][patchI] =
boundaries[patchI].patchSize();
}
Pstream::gatherList(numberOfBoundaryFaces);
Pstream::scatterList(numberOfBoundaryFaces);
Pstream::allGatherList(numberOfBoundaryFaces);
forAll(boundaries, patchI)
{
......@@ -467,8 +466,8 @@ void Foam::Module::polyMeshGenAddressing::calcGlobalCellLabels() const
label startLabel(0);
labelList nCellsAtProc(Pstream::nProcs());
nCellsAtProc[Pstream::myProcNo()] = globalCellLabel.size();
Pstream::gatherList(nCellsAtProc);
Pstream::scatterList(nCellsAtProc);
Pstream::allGatherList(nCellsAtProc);
for (label i = 0; i < Pstream::myProcNo(); ++i)
{
startLabel += nCellsAtProc[i];
......@@ -666,8 +665,8 @@ void Foam::Module::polyMeshGenAddressing::calcGlobalEdgeLabels() const
label startEdge(0);
labelList nEdgesAtProc(Pstream::nProcs());
nEdgesAtProc[Pstream::myProcNo()] = nLocalEdges;
Pstream::gatherList(nEdgesAtProc);
Pstream::scatterList(nEdgesAtProc);
Pstream::allGatherList(nEdgesAtProc);
for (label i = 0; i < Pstream::myProcNo(); ++i)
{
startEdge += nEdgesAtProc[i];
......
......@@ -31,7 +31,6 @@ License
#include "polyMeshGenModifier.H"
#include "demandDrivenData.H"
#include "polyMeshGenAddressing.H"
#include "SLList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -32,6 +32,7 @@ License
#include "demandDrivenData.H"
#include "HashSet.H"
#include "boolList.H"
#include "SLList.H"
//#define DEBUG_ZIPUP
......@@ -457,7 +458,22 @@ void Foam::Module::polyMeshGenModifier::zipUpCells()
if (pointChain.size() > 2)
{
edgesToInsert[nEdgesToInsert] = pointChain;
// OLD: edgesToInsert[nEdgesToInsert] = pointChain;
// Cannot use std::copy algorithm
// - SLList doesn't define iterator category
auto& dest = edgesToInsert[nEdgesToInsert];
dest.resize_nocopy(pointChain.size());
auto iter = dest.begin();
for (const auto& val : pointChain)
{
*iter = val;
++iter;
}
nEdgesToInsert++;
}
}
......
......@@ -126,8 +126,7 @@ void Foam::Module::meshOctreeAddressing::calcGlobalPointLabels() const
}
// exchange data with other processors
Pstream::gatherList(nLocalPoints);
Pstream::scatterList(nLocalPoints);
Pstream::allGatherList(nLocalPoints);
// find the starting point label
label startPoint(0);
......@@ -416,8 +415,7 @@ void Foam::Module::meshOctreeAddressing::calcGlobalLeafLabels() const
nLeavesAtProc[Pstream::myProcNo()] = nLeaves;
// exchange the data with other processors
Pstream::gatherList(nLeavesAtProc);
Pstream::scatterList(nLeavesAtProc);
Pstream::allGatherList(nLeavesAtProc);
// find the starting labels for
nLeaves = 0;
......
......@@ -127,8 +127,7 @@ void Foam::Module::meshOctreeModifier::loadDistribution
labelList procWeights(Pstream::nProcs());
procWeights[Pstream::myProcNo()] = localNumWeighs;
Pstream::gatherList(procWeights);
Pstream::scatterList(procWeights);
Pstream::allGatherList(procWeights);
for (label procI = 0; procI < Pstream::myProcNo(); ++procI)
doBalancing += procWeights[procI];
......@@ -194,8 +193,7 @@ void Foam::Module::meshOctreeModifier::loadDistribution
sendToProcesssors[Pstream::myProcNo()][counter++] = it->first;
}
Pstream::gatherList(sendToProcesssors);
Pstream::scatterList(sendToProcesssors);
Pstream::allGatherList(sendToProcesssors);
labelHashSet receiveFrom;
forAll(sendToProcesssors, procI)
......
......@@ -57,8 +57,7 @@ void Foam::Module::meshOctreeModifier::updateCommunicationPattern()
leaves[leaves.size()-1]->coordinates();
// communicate missing ranges
Pstream::gatherList(range);
Pstream::scatterList(range);
Pstream::allGatherList(range);
// find missing child cubes in the tree. These coordinates are located on
// other processors, and they must fit in the range of cubes located
......
......@@ -200,8 +200,8 @@ void Foam::Module::meshSurfaceEngine::calcGlobalBoundaryPointLabels() const
label startPoint(0);
labelList nPointsAtProc(Pstream::nProcs());
nPointsAtProc[Pstream::myProcNo()] = nLocalPoints;
Pstream::gatherList(nPointsAtProc);
Pstream::scatterList(nPointsAtProc);
Pstream::allGatherList(nPointsAtProc);
for (label i = 0; i < Pstream::myProcNo(); ++i)
startPoint += nPointsAtProc[i];
......@@ -524,8 +524,8 @@ void Foam::Module::meshSurfaceEngine::calcGlobalBoundaryEdgeLabels() const
label startEdge(0);
labelList nEdgesAtProc(Pstream::nProcs());
nEdgesAtProc[Pstream::myProcNo()] = nLocalEdges;
Pstream::gatherList(nEdgesAtProc);
Pstream::scatterList(nEdgesAtProc);
Pstream::allGatherList(nEdgesAtProc);
for (label i = 0; i < Pstream::myProcNo(); ++i)
startEdge += nEdgesAtProc[i];
......@@ -765,8 +765,7 @@ void Foam::Module::meshSurfaceEngine::calcGlobalBoundaryFaceLabels() const
labelList nFacesAtProc(Pstream::nProcs());
nFacesAtProc[Pstream::myProcNo()] = bFaces.size();
Pstream::gatherList(nFacesAtProc);
Pstream::scatterList(nFacesAtProc);
Pstream::allGatherList(nFacesAtProc);
label startFace(0);
for (label i = 0; i < Pstream::myProcNo(); ++i)
......