STYLE: broadcast instead of combineScatter/listCombineScatter/mapCombineScatter

- these are the same thing now and 'broadcast' expresses the intention
  more directly/consistently
This commit is contained in:
Mark Olesen 2022-03-10 21:54:52 +01:00
parent de8ef5332d
commit 62fc3bbc33
68 changed files with 153 additions and 148 deletions

View File

@ -313,7 +313,7 @@ void deleteEmptyPatches(fvMesh& mesh)
{
masterNames = patches.names();
}
Pstream::scatter(masterNames);
Pstream::broadcast(masterNames);
labelList oldToNew(patches.size(), -1);
@ -662,9 +662,10 @@ void countExtrudePatches
// Synchronise decision. Actual numbers are not important, just make
// sure that they're > 0 on all processors.
Pstream::listCombineGather(zoneSidePatch, plusEqOp<label>());
Pstream::listCombineScatter(zoneSidePatch);
Pstream::listCombineGather(zoneZonePatch, plusEqOp<label>());
Pstream::listCombineScatter(zoneZonePatch);
Pstream::broadcast(zoneSidePatch);
Pstream::broadcast(zoneZonePatch);
}
@ -1858,7 +1859,7 @@ int main(int argc, char *argv[])
Pstream::listCombineGather(isInternal, orEqOp<bool>());
Pstream::listCombineScatter(isInternal);
Pstream::broadcast(isInternal);
// Check zone either all internal or all external faces
checkZoneInside(mesh, zoneNames, zoneID, extrudeMeshFaces, isInternal);
@ -2320,7 +2321,7 @@ int main(int argc, char *argv[])
// Reduce
Pstream::mapCombineGather(globalSum, plusEqOp<point>());
Pstream::mapCombineScatter(globalSum);
Pstream::broadcast(globalSum);
forAll(localToGlobalRegion, localRegionI)
{

View File

@ -733,7 +733,7 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseSurfaceTrees
}
Pstream::listCombineGather(hits, plusEqOp<labelHashSet>());
Pstream::listCombineScatter(hits);
Pstream::broadcast(hits);
forAll(surfaceHits, eI)
{
@ -824,7 +824,7 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseEdgeTrees
}
Pstream::listCombineGather(hits, plusEqOp<labelHashSet>());
Pstream::listCombineScatter(hits);
Pstream::broadcast(hits);
forAll(featureEdgeHits, eI)
{

View File

@ -421,7 +421,7 @@ void extractSurface
label sz = compactZoneID.size();
compactZoneID.insert(iter.key(), sz);
}
Pstream::mapCombineScatter(compactZoneID);
Pstream::broadcast(compactZoneID);
// Rework HashTable into labelList just for speed of conversion

View File

@ -475,7 +475,7 @@ Foam::label Foam::checkTopology
}
Pstream::listCombineGather(regionDisconnected, andEqOp<bool>());
Pstream::listCombineScatter(regionDisconnected);
Pstream::broadcast(regionDisconnected);
}

View File

@ -715,7 +715,7 @@ void syncPoints
// Combine on master.
Pstream::listCombineGather(sharedPts, cop);
Pstream::listCombineScatter(sharedPts);
Pstream::broadcast(sharedPts);
// Now we will all have the same information. Merge it back with
// my local information.

View File

@ -452,8 +452,7 @@ void getInterfaceSizes
// Rework
Pstream::scatter(regionsToSize);
Pstream::broadcast(regionsToSize);
// Now we have the global sizes of all inter-regions.
@ -1113,7 +1112,7 @@ label findCorrespondingRegion
}
Pstream::listCombineGather(cellsInZone, plusEqOp<label>());
Pstream::listCombineScatter(cellsInZone);
Pstream::broadcast(cellsInZone);
// Pick region with largest overlap of zoneI
label regionI = findMax(cellsInZone);

View File

@ -85,7 +85,7 @@ void Foam::parLagrangianRedistributor::findClouds
// Synchronise cloud names
Pstream::combineGather(cloudNames, ListOps::uniqueEqOp<word>());
Pstream::combineScatter(cloudNames);
Pstream::broadcast(cloudNames);
objectNames.setSize(cloudNames.size());
@ -123,7 +123,7 @@ void Foam::parLagrangianRedistributor::findClouds
forAll(objectNames, i)
{
Pstream::combineGather(objectNames[i], ListOps::uniqueEqOp<word>());
Pstream::combineScatter(objectNames[i]);
Pstream::broadcast(objectNames[i]);
}
}

View File

@ -54,7 +54,7 @@ Foam::wordList Foam::parLagrangianRedistributor::filterObjects
// - Combine names from all processors
Pstream::combineGather(fieldNames, ListOps::uniqueEqOp<word>());
Pstream::combineScatter(fieldNames);
Pstream::broadcast(fieldNames);
// Sort for consistent order on all processors
Foam::sort(fieldNames);

View File

@ -109,7 +109,7 @@ if (timeDirs.size() && doLagrangian)
cloudFields,
HashTableOps::plusEqOp<word>()
);
Pstream::mapCombineScatter(cloudFields);
Pstream::broadcast(cloudFields);
}
}
}

View File

@ -43,10 +43,12 @@ if (doLagrangian)
nameOp<fileName>()
);
if (Pstream::parRun())
{
// Synchronise cloud names
Pstream::combineGather(cloudNames, ListOps::uniqueEqOp<word>());
Pstream::combineScatter(cloudNames);
Pstream::broadcast(cloudNames);
}
// Consistent order
Foam::sort(cloudNames);

View File

@ -188,7 +188,7 @@ int main(int argc, char *argv[])
maxIds.resize(maxNProcs, -1);
Pstream::listCombineGather(maxIds, maxEqOp<label>());
Pstream::listCombineScatter(maxIds);
Pstream::broadcast(maxIds);
// From ids to count
const labelList numIds = maxIds + 1;

View File

@ -78,7 +78,7 @@ Foam::label Foam::particleTracksSampler::setTrackFields
if (Pstream::parRun())
{
Pstream::combineGather(fieldNames, ListOps::uniqueEqOp<word>());
Pstream::combineScatter(fieldNames);
Pstream::broadcast(fieldNames);
}
for (const word& fieldName : fieldNames)

View File

@ -41,7 +41,7 @@ Foam::Field<T> Foam::channelIndex::regionSum(const Field<T>& cellField) const
// Global sum
Pstream::listCombineGather(regionField, plusEqOp<T>());
Pstream::listCombineScatter(regionField);
Pstream::broadcast(regionField);
return regionField;
}

View File

@ -288,10 +288,9 @@ bool setFaceFieldType
}
Pstream::listCombineGather(nChanged, plusEqOp<label>());
Pstream::listCombineScatter(nChanged);
Pstream::broadcast(nChanged);
typename GeometricField<Type, fvPatchField, volMesh>::
Boundary& fieldBf = field.boundaryFieldRef();
auto& fieldBf = field.boundaryFieldRef();
// Reassign.
forAll(field.boundaryField(), patchi)

View File

@ -303,7 +303,6 @@ int main(int argc, char *argv[])
Pstream::mapCombineGather(patchSize, plusEqOp<label>());
Pstream::mapCombineGather(zoneSize, plusEqOp<label>());
// Allocate compact numbering for all patches/faceZones
forAllConstIters(patchSize, iter)
{
@ -315,8 +314,7 @@ int main(int argc, char *argv[])
compactZoneID.insert(iter.key(), compactZoneID.size());
}
Pstream::mapCombineScatter(compactZoneID);
Pstream::broadcast(compactZoneID);
// Rework HashTable into labelList just for speed of conversion

View File

@ -549,14 +549,14 @@ void Foam::fileMonitor::updateStates
// Scatter or reduce to synchronise state
if (masterOnly)
{
// Scatter
// Broadcast
if (stats.storage().size() == 1)
{
Pstream::scatter(stats.storage()[0]);
Pstream::broadcast(stats.storage()[0]);
}
else
{
Pstream::listCombineScatter(stats.storage());
Pstream::broadcast(stats.storage());
}
}
else

View File

@ -545,14 +545,14 @@ void Foam::fileMonitor::updateStates
// Scatter or reduce to synchronise state
if (masterOnly)
{
// Scatter
// Broadcast
if (stats.storage().size() == 1)
{
Pstream::scatter(stats.storage()[0]);
Pstream::broadcast(stats.storage()[0]);
}
else
{
Pstream::listCombineScatter(stats.storage());
Pstream::broadcast(stats.storage());
}
}
else

View File

@ -68,7 +68,7 @@ void Foam::IOobjectList::syncNames(wordList& objNames)
{
// Synchronize names
Pstream::combineGather(objNames, ListOps::uniqueEqOp<word>());
Pstream::combineScatter(objNames);
Pstream::broadcast(objNames);
}
// Sort for consistent order on all processors

View File

@ -215,7 +215,7 @@ void Foam::extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
// Reduce
Pstream::mapCombineGather(globalSum, plusEqOp<point>());
Pstream::mapCombineScatter(globalSum);
Pstream::broadcast(globalSum);
forAll(localToGlobalRegion, localRegionI)
{

View File

@ -1018,7 +1018,7 @@ void Foam::fvMeshSubset::setCellSubset
// Note that up to nextPatchID the globalPatchMap is an identity so
// no need to index through that.
Pstream::listCombineGather(globalPatchSizes, plusEqOp<label>());
Pstream::listCombineScatter(globalPatchSizes);
Pstream::broadcast(globalPatchSizes);
// Now all processors have all the patchnames.
// Decide: if all processors have the same patch names and size is zero

View File

@ -437,7 +437,7 @@ Foam::scalar Foam::hexRef8::getLevel0EdgeLength() const
// Get the minimum per level over all processors. Note minimum so if
// cells are not cubic we use the smallest edge side.
Pstream::listCombineGather(typEdgeLenSqr, minEqOp<scalar>());
Pstream::listCombineScatter(typEdgeLenSqr);
Pstream::broadcast(typEdgeLenSqr);
if (debug)
{
@ -472,7 +472,7 @@ Foam::scalar Foam::hexRef8::getLevel0EdgeLength() const
}
Pstream::listCombineGather(maxEdgeLenSqr, maxEqOp<scalar>());
Pstream::listCombineScatter(maxEdgeLenSqr);
Pstream::broadcast(maxEdgeLenSqr);
if (debug)
{

View File

@ -134,12 +134,12 @@ void Foam::ensightCells::clearOut()
void Foam::ensightCells::reduce()
{
// No listCombineGather, listCombineScatter for FixedList
forAll(sizes_, typei)
{
sizes_[typei] = size(elemType(typei));
Foam::reduce(sizes_[typei], sumOp<label>());
}
// Can reduce FixedList with sumOp<label> in a single operation
Foam::reduce(sizes_, sumOp<label>());
}

View File

@ -163,12 +163,12 @@ void Foam::ensightFaces::clearOut()
void Foam::ensightFaces::reduce()
{
// No listCombineGather, listCombineScatter for FixedList
forAll(sizes_, typei)
{
sizes_[typei] = size(elemType(typei));
Foam::reduce(sizes_[typei], sumOp<label>());
}
// Can reduce FixedList with sumOp<label> in a single operation
Foam::reduce(sizes_, sumOp<label>());
}

View File

@ -169,7 +169,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::initialisePatch()
sumTriMagSf_[Pstream::myProcNo() + 1] = sum(triMagSf);
Pstream::listCombineGather(sumTriMagSf_, maxEqOp<scalar>());
Pstream::listCombineScatter(sumTriMagSf_);
Pstream::broadcast(sumTriMagSf_);
for (label i = 1; i < triMagSf.size(); ++i)
{

View File

@ -224,7 +224,7 @@ bool Foam::functionObjects::Curle::execute()
pDash /= 4*mathematical::pi;
Pstream::listCombineGather(pDash, plusEqOp<scalar>());
Pstream::listCombineScatter(pDash);
Pstream::broadcast(pDash);
if (surfaceWriterPtr_)
{

View File

@ -88,9 +88,9 @@ bool Foam::functionObjects::columnAverage::columnAverageField
// Global sum
Pstream::listCombineGather(regionField, plusEqOp<Type>());
Pstream::listCombineScatter(regionField);
Pstream::listCombineGather(regionCount, plusEqOp<label>());
Pstream::listCombineScatter(regionCount);
Pstream::broadcast(regionField);
Pstream::broadcast(regionCount);
forAll(regionField, regioni)
{

View File

@ -334,7 +334,7 @@ void Foam::functionObjects::extractEulerianParticles::calculateAddressing
// Create map from new regions to slots in particles list
// - filter through new-to-new addressing to identify new particles
Pstream::listCombineGather(newToNewRegion, maxEqOp<label>());
Pstream::listCombineScatter(newToNewRegion);
Pstream::broadcast(newToNewRegion);
label nParticle = -1;
labelHashSet newRegions;
@ -354,7 +354,7 @@ void Foam::functionObjects::extractEulerianParticles::calculateAddressing
// Accumulate old region data or create a new particle if there is no
// mapping from the old-to-new region
Pstream::listCombineGather(oldToNewRegion, maxEqOp<label>());
Pstream::listCombineScatter(oldToNewRegion);
Pstream::broadcast(oldToNewRegion);
List<eulerianParticle> newParticles(newRegionToParticleMap.size());
forAll(oldToNewRegion, oldRegioni)
{

View File

@ -67,7 +67,7 @@ static Map<Type> regionSum(const regionSplit& regions, const Field<Type>& fld)
}
Pstream::mapCombineGather(regionToSum, plusEqOp<Type>());
Pstream::mapCombineScatter(regionToSum);
Pstream::broadcast(regionToSum);
return regionToSum;
}
@ -216,7 +216,7 @@ Foam::functionObjects::regionSizeDistribution::findPatchRegions
// Make sure all the processors have the same set of regions
Pstream::mapCombineGather(patchRegions, minEqOp<label>());
Pstream::mapCombineScatter(patchRegions);
Pstream::broadcast(patchRegions);
return patchRegions;
}

View File

@ -1065,8 +1065,8 @@ void Foam::functionObjects::forces::calcForcesMoment()
Pstream::listCombineGather(force_, plusEqOp<vectorField>());
Pstream::listCombineGather(moment_, plusEqOp<vectorField>());
Pstream::listCombineScatter(force_);
Pstream::listCombineScatter(moment_);
Pstream::broadcast(force_);
Pstream::broadcast(moment_);
}

View File

@ -469,7 +469,7 @@ void Foam::functionObjects::propellerInfo::updateSampleDiskCells()
}
Pstream::listCombineGather(pointMask_, orEqOp<bool>());
Pstream::listCombineScatter(pointMask_);
Pstream::broadcast(pointMask_);
}
@ -775,7 +775,7 @@ Foam::tmp<Foam::Field<Type>> Foam::functionObjects::propellerInfo::interpolate
}
Pstream::listCombineGather(field, maxEqOp<Type>());
Pstream::listCombineScatter(field);
Pstream::broadcast(field);
return tfield;
}

View File

@ -57,7 +57,7 @@ Foam::wordList Foam::functionObjects::vtkCloud::writeFields
wordList fieldNames(obrTmp.names<IOField<Type>>());
Pstream::combineGather(fieldNames, ListOps::uniqueEqOp<word>());
Pstream::combineScatter(fieldNames);
Pstream::broadcast(fieldNames);
// Consistent order on all processors
Foam::sort(fieldNames);

View File

@ -266,7 +266,7 @@ bool Foam::areaWrite::write()
if (Pstream::parRun())
{
Pstream::mapCombineGather(selected, HashSetOps::plusEqOp<word>());
Pstream::mapCombineScatter(selected);
Pstream::broadcast(selected);
}
missed.clear();

View File

@ -78,7 +78,7 @@ void Foam::areaWrite::performAction
{
// Synchronize names
Pstream::combineGather(fieldNames, ListOps::uniqueEqOp<word>());
Pstream::combineScatter(fieldNames);
Pstream::broadcast(fieldNames);
}
// Sort for consistent order on all processors

View File

@ -105,7 +105,7 @@ void Foam::Cloud<ParticleType>::writeCloudUniformProperties() const
np[Pstream::myProcNo()] = ParticleType::particleCount_;
Pstream::listCombineGather(np, maxEqOp<label>());
Pstream::listCombineScatter(np);
Pstream::broadcast(np);
uniformPropsDict.add
(

View File

@ -121,7 +121,7 @@ void Foam::CellZoneInjection<CloudType>::setPositions
) = positions;
Pstream::listCombineGather(allPositions, minEqOp<point>());
Pstream::listCombineScatter(allPositions);
Pstream::broadcast(allPositions);
// Gather local cell tet and tet-point Ids, but leave non-local ids set -1
SubList<label>

View File

@ -119,7 +119,7 @@ void Foam::patchInjectionBase::updateMesh(const polyMesh& mesh)
sumTriMagSf_[Pstream::myProcNo() + 1] = sum(triMagSf);
Pstream::listCombineGather(sumTriMagSf_, maxEqOp<scalar>());
Pstream::listCombineScatter(sumTriMagSf_);
Pstream::broadcast(sumTriMagSf_);
for (label i = 1; i < triMagSf.size(); i++)
{

View File

@ -881,7 +881,7 @@ Foam::List<Foam::scalar> Foam::lumpedPointMovement::areas
}
Pstream::listCombineGather(zoneAreas, plusEqOp<scalar>());
Pstream::listCombineScatter(zoneAreas);
Pstream::broadcast(zoneAreas);
return zoneAreas;
}
@ -1010,10 +1010,9 @@ bool Foam::lumpedPointMovement::forcesAndMoments
}
Pstream::listCombineGather(forces, plusEqOp<vector>());
Pstream::listCombineScatter(forces);
Pstream::listCombineGather(moments, plusEqOp<vector>());
Pstream::listCombineScatter(moments);
Pstream::broadcast(forces);
Pstream::broadcast(moments);
return true;
}

View File

@ -1954,7 +1954,7 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::meshRefinement::balance
Pout<< "Wanted distribution:" << nProcCells << endl;
Pstream::listCombineGather(nProcCells, plusEqOp<label>());
Pstream::listCombineScatter(nProcCells);
Pstream::broadcast(nProcCells);
Pout<< "Wanted resulting decomposition:" << endl;
forAll(nProcCells, proci)
@ -3531,8 +3531,10 @@ const
}
Pstream::listCombineGather(nCells, plusEqOp<label>());
Pstream::listCombineScatter(nCells);
/// Pstream::broadcast(nCells);
if (Pstream::master())
{
Info<< "Cells per refinement level:" << endl;
forAll(nCells, leveli)
{
@ -3540,6 +3542,7 @@ const
<< endl;
}
}
}
}

View File

@ -821,7 +821,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createZoneBaffles
if (nTotalBaffles > 0)
{
Pstream::listCombineGather(nBaffles, plusEqOp<label>());
Pstream::listCombineScatter(nBaffles);
Pstream::broadcast(nBaffles);
Info<< nl
<< setf(ios_base::left)
@ -1948,7 +1948,7 @@ void Foam::meshRefinement::findCellZoneTopo
// - keepRegion is identical ,,
// - cellZones are identical ,,
Pstream::listCombineGather(regionToCellZone, maxEqOp<label>());
Pstream::listCombineScatter(regionToCellZone);
Pstream::broadcast(regionToCellZone);
// Find the region containing the keepPoint
@ -1999,7 +1999,7 @@ void Foam::meshRefinement::findCellZoneTopo
// This done at top of loop to account for geometric matching
// not being synchronised.
Pstream::listCombineGather(regionToCellZone, maxEqOp<label>());
Pstream::listCombineScatter(regionToCellZone);
Pstream::broadcast(regionToCellZone);
bool changed = false;
@ -5733,7 +5733,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
// 2.Combine faceZoneNames allocated on different processors
Pstream::mapCombineGather(zonesToFaceZone, eqOp<word>());
Pstream::mapCombineScatter(zonesToFaceZone);
Pstream::broadcast(zonesToFaceZone);
// 3. Allocate faceZones from (now synchronised) faceZoneNames
@ -5957,7 +5957,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
}
}
Pstream::mapCombineGather(nPosOrientation, plusEqOp<label>());
Pstream::mapCombineScatter(nPosOrientation);
Pstream::broadcast(nPosOrientation);
Info<< "Split " << nFreeStanding << " free-standing zone faces"

View File

@ -2498,9 +2498,9 @@ Foam::label Foam::snappyRefineDriver::directionalSmooth
{
scalar minSeed = min(allSeedPointDist);
Pstream::scatter(minSeed);
scalar maxSeed = max(allSeedPointDist);
Pstream::scatter(maxSeed);
Pstream::broadcast(minSeed);
Pstream::broadcast(maxSeed);
forAll(normalizedPosition, posI)
{
@ -2551,7 +2551,7 @@ Foam::label Foam::snappyRefineDriver::directionalSmooth
);
}
Pstream::scatter(keyAndValue);
Pstream::broadcast(keyAndValue);
// Construct an iterpolation table for further queries
// - although normalized values are used for query,
@ -3248,11 +3248,11 @@ void Foam::snappyRefineDriver::deleteSmallRegions
nCellsPerZone[zonei]++;
}
Pstream::listCombineGather(nCellsPerRegion, plusEqOp<label>());
Pstream::listCombineScatter(nCellsPerRegion);
Pstream::listCombineGather(regionToZone, maxEqOp<label>());
Pstream::listCombineScatter(regionToZone);
Pstream::listCombineGather(nCellsPerZone, plusEqOp<label>());
Pstream::listCombineScatter(nCellsPerZone);
Pstream::broadcast(nCellsPerRegion);
Pstream::broadcast(regionToZone);
Pstream::broadcast(nCellsPerZone);
// Mark small regions. Note that all processors have the same information

View File

@ -245,12 +245,12 @@ void Foam::mappedPatchBase::collectSamples
(
UPstream::listGatherValues<label>(mySampleWorld, myComm)
);
Pstream::broadcast(procToWorldIndex, myComm);
labelList nPerProc
(
UPstream::listGatherValues<label>(patch_.size(), myComm)
);
Pstream::broadcast(procToWorldIndex, myComm);
Pstream::broadcast(nPerProc, myComm);
patchFaceWorlds.setSize(patchFaces.size());
@ -680,7 +680,7 @@ void Foam::mappedPatchBase::findSamples
Pstream::msgType(),
myComm
);
Pstream::listCombineScatter(nearest, Pstream::msgType(), myComm);
Pstream::broadcast(nearest, myComm);
//if (debug)
//{

View File

@ -140,7 +140,7 @@ Foam::regionSplit2D::regionSplit2D
// - not concerned about the op (keys are unique)
// - map size will be the number of regions in the set of faces
Pstream::mapCombineGather(regionToCompactAddr, minEqOp<label>());
Pstream::mapCombineScatter(regionToCompactAddr);
Pstream::broadcast(regionToCompactAddr);
nRegions_ = regionToCompactAddr.size();

View File

@ -86,7 +86,7 @@ void Foam::nearestToCell::combine(topoSet& set, const bool add) const
}
Pstream::listCombineGather(nearest, mappedPatchBase::nearestEqOp());
Pstream::listCombineScatter(nearest);
Pstream::broadcast(nearest);
for (const auto& near : nearest)
{

View File

@ -219,7 +219,7 @@ void Foam::planeToFaceZone::combine(faceZoneSet& fzSet, const bool add) const
}
}
Pstream::listCombineGather(regionRegions, bitOrEqOp<bitSet>());
Pstream::listCombineScatter(regionRegions);
Pstream::broadcast(regionRegions);
// Collapse the region connections into a map between each region
// and the lowest numbered region that it connects to
@ -261,7 +261,7 @@ void Foam::planeToFaceZone::combine(faceZoneSet& fzSet, const bool add) const
++ regionNFaces[regioni];
}
Pstream::listCombineGather(regionNFaces, plusEqOp<label>());
Pstream::listCombineScatter(regionNFaces);
Pstream::broadcast(regionNFaces);
Info<< " Found " << nRegions << " contiguous regions with "
<< regionNFaces << " faces" << endl;
}
@ -285,9 +285,13 @@ void Foam::planeToFaceZone::combine(faceZoneSet& fzSet, const bool add) const
}
Pstream::listCombineGather(regionWeights, plusEqOp<scalar>());
Pstream::listCombineGather(regionCentres, plusEqOp<point>());
Pstream::listCombineScatter(regionWeights);
Pstream::listCombineScatter(regionCentres);
if (Pstream::master())
{
regionCentres /= regionWeights;
}
//Pstream::broadcast(regionWeights);
Pstream::broadcast(regionCentres);
// Find the region centroid closest to the reference point
selectedRegioni =

View File

@ -105,7 +105,7 @@ void Foam::nearestToPoint::combine(topoSet& set, const bool add) const
Pstream::listCombineGather(nearest, mappedPatchBase::nearestEqOp());
Pstream::listCombineScatter(nearest);
Pstream::broadcast(nearest);
for (const auto& near : nearest)
{

View File

@ -996,7 +996,7 @@ Foam::vectorField Foam::NURBS3DVolume::computeControlPointSensitivities
// Sum contributions from all processors
Pstream::listCombineGather(controlPointDerivs, plusEqOp<vector>());
Pstream::listCombineScatter(controlPointDerivs);
Pstream::broadcast(controlPointDerivs);
return controlPointDerivs;
}
@ -1082,7 +1082,7 @@ Foam::vectorField Foam::NURBS3DVolume::computeControlPointSensitivities
}
// Sum contributions from all processors
Pstream::listCombineGather(controlPointDerivs, plusEqOp<vector>());
Pstream::listCombineScatter(controlPointDerivs);
Pstream::broadcast(controlPointDerivs);
return controlPointDerivs;
}

View File

@ -378,7 +378,7 @@ void Foam::cellCellStencils::cellVolumeWeight::findHoles
// Synchronise region status on processors
// (could instead swap status through processor patches)
Pstream::listCombineGather(regionType, maxEqOp<label>());
Pstream::listCombineScatter(regionType);
Pstream::broadcast(regionType);
// Communicate region status through interpolative cells
labelList cellRegionType(labelUIndList(regionType, cellRegion));
@ -756,7 +756,7 @@ bool Foam::cellCellStencils::cellVolumeWeight::update()
nCellsPerZone[zoneID[cellI]]++;
}
Pstream::listCombineGather(nCellsPerZone, plusEqOp<label>());
Pstream::listCombineScatter(nCellsPerZone);
Pstream::broadcast(nCellsPerZone);
Info<< typeName << " : detected " << nZones

View File

@ -1152,7 +1152,7 @@ void Foam::cellCellStencils::inverseDistance::findHoles
// Synchronise region status on processors
// (could instead swap status through processor patches)
Pstream::listCombineGather(regionType, maxEqOp<label>());
Pstream::listCombineScatter(regionType);
Pstream::broadcast(regionType);
DebugInfo<< FUNCTION_NAME << " : Gathered region type" << endl;
@ -1757,7 +1757,7 @@ bool Foam::cellCellStencils::inverseDistance::update()
nCellsPerZone[zoneID[cellI]]++;
}
Pstream::listCombineGather(nCellsPerZone, plusEqOp<label>());
Pstream::listCombineScatter(nCellsPerZone);
Pstream::broadcast(nCellsPerZone);
const boundBox& allBb(mesh_.bounds());

View File

@ -518,7 +518,7 @@ Foam::cellCellStencils::trackingInverseDistance::trackingInverseDistance
nCellsPerZone[zoneID[celli]]++;
}
Pstream::listCombineGather(nCellsPerZone, plusEqOp<label>());
Pstream::listCombineScatter(nCellsPerZone);
Pstream::broadcast(nCellsPerZone);
meshParts_.setSize(nZones);
forAll(meshParts_, zonei)

View File

@ -69,7 +69,7 @@ void Foam::setRefCells
}
Pstream::listCombineGather(regionNeedReference, orEqOp<bool>());
Pstream::listCombineScatter(regionNeedReference);
Pstream::broadcast(regionNeedReference);
}
@ -190,7 +190,7 @@ void Foam::setRefCells
}
Pstream::listCombineGather(hasRef, plusEqOp<label>());
Pstream::listCombineScatter(hasRef);
Pstream::broadcast(hasRef);
forAll(hasRef, regionI)
{

View File

@ -419,7 +419,7 @@ void Foam::multiLevelDecomp::decompose
label nPoints = returnReduce(domainPoints.size(), sumOp<label>());
Pstream::listCombineGather(nOutsideConnections, plusEqOp<label>());
Pstream::listCombineScatter(nOutsideConnections);
Pstream::broadcast(nOutsideConnections);
label nPatches = 0;
label nFaces = 0;
for (const label nConnect : nOutsideConnections)
@ -531,7 +531,8 @@ void Foam::multiLevelDecomp::decompose
nOutsideConnections,
plusEqOp<label>()
);
Pstream::listCombineScatter(nOutsideConnections);
Pstream::broadcast(nOutsideConnections);
label nPatches = 0;
label nFaces = 0;
for (const label nConnect : nOutsideConnections)

View File

@ -283,7 +283,7 @@ bool Foam::distributedTriSurfaceMesh::read()
// Force underlying triSurfaceMesh to calculate volume type
// (is topological walk; does not construct tree)
surfaceClosed_ = triSurfaceMesh::hasVolumeType();
Pstream::scatter(surfaceClosed_);
Pstream::broadcast(surfaceClosed_);
dict_.add("closed", surfaceClosed_);
// Delay calculating outside vol type since constructs tree. Is ok
@ -1720,8 +1720,8 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
forAll(bbs, proci)
{
Pstream::listCombineGather(bbs[proci], plusEqOp<boundBox>());
Pstream::listCombineScatter(bbs[proci]);
}
Pstream::broadcast(bbs);
}
else if (distType_ == DISTRIBUTED)
{
@ -1769,8 +1769,8 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
forAll(bbs, proci)
{
Pstream::listCombineGather(bbs[proci], plusEqOp<boundBox>());
Pstream::listCombineScatter(bbs[proci]);
}
Pstream::broadcast(bbs);
}
// //// Tbd. initial duplicate filtering of border points only
// if (distType_ == DISTRIBUTED)
@ -1967,8 +1967,8 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
// forAll(bbs, proci)
// {
// Pstream::listCombineGather(bbs[proci], plusEqOp<boundBox>());
// Pstream::listCombineScatter(bbs[proci]);
// }
// Pstream::broadcast(bbs);
// }
else
{
@ -2070,8 +2070,8 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
forAll(bbs, proci)
{
Pstream::listCombineGather(bbs[proci], plusEqOp<boundBox>());
Pstream::listCombineScatter(bbs[proci]);
}
Pstream::broadcast(bbs);
}
return bbs;
}

View File

@ -143,7 +143,7 @@ void Foam::regionModels::singleLayerRegion::initialise()
}
Pstream::listCombineGather(passivePatchIDs_, maxEqOp<label>());
Pstream::listCombineScatter(passivePatchIDs_);
Pstream::broadcast(passivePatchIDs_);
magSf.field() = 0.5*(magSf + passiveMagSf);
magSf.correctBoundaryConditions();

View File

@ -167,7 +167,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
// Find nearest.
Pstream::listCombineGather(nearest, mappedPatchBase::nearestEqOp());
Pstream::listCombineScatter(nearest);
Pstream::broadcast(nearest);
oldPoints_.resize(this->size());

View File

@ -112,7 +112,7 @@ Foam::patchProbes::sample(const VolumeField<Type>& vField) const
}
Pstream::listCombineGather(values, isNotEqOp<Type>());
Pstream::listCombineScatter(values);
Pstream::broadcast(values);
return tvalues;
}
@ -143,7 +143,7 @@ Foam::patchProbes::sample(const SurfaceField<Type>& sField) const
}
Pstream::listCombineGather(values, isNotEqOp<Type>());
Pstream::listCombineScatter(values);
Pstream::broadcast(values);
return tvalues;
}

View File

@ -226,7 +226,7 @@ Foam::probes::sample(const VolumeField<Type>& vField) const
}
Pstream::listCombineGather(values, isNotEqOp<Type>());
Pstream::listCombineScatter(values);
Pstream::broadcast(values);
return tvalues;
}
@ -250,7 +250,7 @@ Foam::probes::sample(const SurfaceField<Type>& sField) const
}
Pstream::listCombineGather(values, isNotEqOp<Type>());
Pstream::listCombineScatter(values);
Pstream::broadcast(values);
return tvalues;
}

View File

@ -76,9 +76,6 @@ void Foam::cloudSet::calcSamples
// Check that all have been found
labelList maxFoundProc(foundProc);
Pstream::listCombineGather(maxFoundProc, maxEqOp<label>());
Pstream::listCombineScatter(maxFoundProc);
labelList minFoundProc(foundProc.size(), labelMax);
forAll(foundProc, i)
{
@ -88,7 +85,10 @@ void Foam::cloudSet::calcSamples
}
}
Pstream::listCombineGather(minFoundProc, minEqOp<label>());
Pstream::listCombineScatter(minFoundProc);
Pstream::listCombineGather(maxFoundProc, maxEqOp<label>());
Pstream::broadcast(minFoundProc);
Pstream::broadcast(maxFoundProc);
DynamicField<point> missingPoints(sampleCoords_.size());

View File

@ -156,7 +156,7 @@ void Foam::patchCloudSet::calcSamples
// Find nearest.
Pstream::listCombineGather(nearest, mappedPatchBase::nearestEqOp());
Pstream::listCombineScatter(nearest);
Pstream::broadcast(nearest);
if (debug && Pstream::master())

View File

@ -179,7 +179,7 @@ void Foam::patchSeedSet::calcSamples
// Find nearest. Combine on master.
Pstream::listCombineGather(nearest, mappedPatchBase::nearestEqOp());
Pstream::listCombineScatter(nearest);
Pstream::broadcast(nearest);
// 3. Pick up my local faces that have won

View File

@ -203,7 +203,7 @@ Foam::IOobjectList Foam::sampledSets::preCheckFields(unsigned request)
// if (Pstream::parRun())
// {
// Pstream::mapCombineGather(selected, HashSetOps::plusEqOp<word>());
// Pstream::mapCombineScatter(selected);
// Pstream::broadcast(selected);
// }

View File

@ -82,7 +82,7 @@ void Foam::sampledSets::writeCoordSet
{
outputName = writer.write(fieldName, values);
}
Pstream::scatter(outputName);
UPstream::broadcast(outputName);
if (outputName.size())
{
@ -207,9 +207,9 @@ void Foam::sampledSets::performAction
// Use sorted order
values = UIndirectList<Type>(values, globOrder)();
}
Pstream::scatter(avgValue);
Pstream::scatter(sizeValue);
Pstream::scatter(limits);
Pstream::broadcast(avgValue);
Pstream::broadcast(sizeValue);
Pstream::broadcast(limits);
// Store results: min/max/average/size with the name of the set
// for scoping.
@ -261,9 +261,9 @@ void Foam::sampledSets::performAction
if (size())
{
Pstream::scatter(avgEnsemble);
Pstream::scatter(sizeEnsemble);
Pstream::scatter(limitsEnsemble);
Pstream::broadcast(avgEnsemble);
Pstream::broadcast(sizeEnsemble);
Pstream::broadcast(limitsEnsemble);
// Store results: min/max/average/size for the ensemble
// Eg, average(T) ...

View File

@ -228,7 +228,7 @@ bool Foam::sampledMeshedSurface::update(const meshSearch& meshSearcher)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pstream::listCombineGather(nearest, minFirstEqOp<scalar>{});
Pstream::listCombineScatter(nearest);
Pstream::broadcast(nearest);
labelList cellOrFaceLabels(fc.size(), -1);

View File

@ -121,7 +121,7 @@ Foam::IOobjectList Foam::sampledSurfaces::preCheckFields()
if (Pstream::parRun())
{
Pstream::mapCombineGather(selected, HashSetOps::plusEqOp<word>());
Pstream::mapCombineScatter(selected);
Pstream::broadcast(selected);
}

View File

@ -171,7 +171,7 @@ void Foam::distanceSurface::filterKeepLargestRegion
}
}
Pstream::scatter(keepRegion);
Pstream::broadcast(keepRegion);
forAll(regionColour, celli)
{
@ -295,7 +295,7 @@ void Foam::distanceSurface::filterKeepNearestRegions
}
}
Pstream::scatter(keepRegion);
Pstream::broadcast(keepRegion);
forAll(regionColour, celli)
{
@ -366,7 +366,7 @@ void Foam::distanceSurface::filterRegionProximity
}
}
Pstream::listCombineScatter(distRegion);
Pstream::broadcast(distRegion);
// Define the per-face acceptance based on the region average distance

View File

@ -278,7 +278,7 @@ void Foam::isoSurfacePoint::syncUnseparatedPoints
// Combine on master.
Pstream::listCombineGather(sharedPts, minEqOp<point>());
Pstream::listCombineScatter(sharedPts);
Pstream::broadcast(sharedPts);
// Now we will all have the same information. Merge it back with
// my local information.

View File

@ -868,7 +868,7 @@ Foam::scalar Foam::TDACChemistryModel<ReactionThermo, ThermoType>::solve
{
List<bool> active(composition.active());
Pstream::listCombineGather(active, orEqOp<bool>());
Pstream::listCombineScatter(active);
Pstream::broadcast(active);
forAll(active, i)
{

View File

@ -328,11 +328,11 @@ void Foam::faceReflecting::calculate()
// Distribute ray indexes to all proc's
Pstream::listCombineGather(refDisDirsIndex, maxEqOp<label>());
Pstream::listCombineScatter(refDisDirsIndex);
// Make sure all the processors have the same map
Pstream::mapCombineGather(refFacesDirIndex, minEqOp<label>());
Pstream::mapCombineScatter(refFacesDirIndex);
// Make sure all the processors have the same information
Pstream::broadcast(refDisDirsIndex);
Pstream::broadcast(refFacesDirIndex);
scalar maxBounding = 5.0*mag(mesh_.bounds().max() - mesh_.bounds().min());

View File

@ -504,9 +504,9 @@ void Foam::radiation::viewFactor::calculate()
Pstream::listCombineGather(E, maxEqOp<scalar>());
Pstream::listCombineGather(qrExt, maxEqOp<scalar>());
Pstream::listCombineScatter(T4);
Pstream::listCombineScatter(E);
Pstream::listCombineScatter(qrExt);
Pstream::broadcast(T4);
Pstream::broadcast(E);
Pstream::broadcast(qrExt);
if (Pstream::master())
{
@ -601,9 +601,8 @@ void Foam::radiation::viewFactor::calculate()
}
}
// Scatter q and fill qr
Pstream::listCombineScatter(q);
Pstream::listCombineGather(q, maxEqOp<scalar>());
// Broadcast q and fill qr
Pstream::broadcast(q);
label globCoarseId = 0;
for (const label patchID : selectedPatches_)