ENH: more consistent use of broadcast, combineReduce etc.

- broadcast           : (replaces scatter)
  - combineReduce       == combineGather + broadcast
  - listCombineReduce   == listCombineGather + broadcast
  - mapCombineReduce    == mapCombineGather + broadcast
  - allGatherList       == gatherList + scatterList

  Before settling on a more consistent naming convention,
  some intermediate namings were used in OpenFOAM-v2206:

    - combineReduce       (2206: combineAllGather)
    - listCombineReduce   (2206: listCombineAllGather)
    - mapCombineReduce    (2206: mapCombineAllGather)
This commit is contained in:
Mark Olesen
2022-08-23 15:58:32 +02:00
committed by Andrew Heather
parent b9c15b8585
commit 473e14418a
103 changed files with 248 additions and 307 deletions

View File

@ -166,7 +166,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
// Find nearest - globally consistent
Pstream::listCombineAllGather(nearest, mappedPatchBase::nearestEqOp());
Pstream::listCombineReduce(nearest, mappedPatchBase::nearestEqOp());
oldPoints_.resize(this->size());

View File

@ -111,7 +111,7 @@ Foam::patchProbes::sample(const VolumeField<Type>& vField) const
}
}
Pstream::listCombineAllGather(values, isNotEqOp<Type>());
Pstream::listCombineReduce(values, isNotEqOp<Type>());
return tvalues;
}
@ -141,7 +141,7 @@ Foam::patchProbes::sample(const SurfaceField<Type>& sField) const
}
}
Pstream::listCombineAllGather(values, isNotEqOp<Type>());
Pstream::listCombineReduce(values, isNotEqOp<Type>());
return tvalues;
}

View File

@ -225,7 +225,7 @@ Foam::probes::sample(const VolumeField<Type>& vField) const
}
}
Pstream::listCombineAllGather(values, isNotEqOp<Type>());
Pstream::listCombineReduce(values, isNotEqOp<Type>());
return tvalues;
}
@ -248,7 +248,7 @@ Foam::probes::sample(const SurfaceField<Type>& sField) const
}
}
Pstream::listCombineAllGather(values, isNotEqOp<Type>());
Pstream::listCombineReduce(values, isNotEqOp<Type>());
return tvalues;
}

View File

@ -84,8 +84,8 @@ void Foam::cloudSet::calcSamples
minFoundProc[i] = foundProc[i];
}
}
Pstream::listCombineAllGather(minFoundProc, minEqOp<label>());
Pstream::listCombineAllGather(maxFoundProc, maxEqOp<label>());
Pstream::listCombineReduce(minFoundProc, minEqOp<label>());
Pstream::listCombineReduce(maxFoundProc, maxEqOp<label>());
DynamicField<point> missingPoints(sampleCoords_.size());

View File

@ -155,7 +155,7 @@ void Foam::patchCloudSet::calcSamples
// Find nearest - globally consistent
Pstream::listCombineAllGather(nearest, mappedPatchBase::nearestEqOp());
Pstream::listCombineReduce(nearest, mappedPatchBase::nearestEqOp());
if (debug && Pstream::master())

View File

@ -178,11 +178,7 @@ void Foam::patchSeedSet::calcSamples
// 2. Reduce on master. Select nearest processor.
// Find nearest - globally consistent
Pstream::listCombineAllGather
(
nearest,
mappedPatchBase::nearestEqOp()
);
Pstream::listCombineReduce(nearest, mappedPatchBase::nearestEqOp());
// 3. Pick up my local faces that have won

View File

@ -196,7 +196,7 @@ Foam::IOobjectList Foam::sampledSets::preCheckFields(unsigned request)
// Parallel consistency (no-op in serial)
// Probably not needed...
/// Pstream::mapCombineAllGather(selected, HashSetOps::plusEqOp<word>());
/// Pstream::mapCombineReduce(selected, HashSetOps::plusEqOp<word>());
DynamicList<label> missed(fieldSelection_.size());

View File

@ -264,7 +264,7 @@ void Foam::shortestPathSet::sync
celli,
Tuple2<point, bool>(origin, findMinDistance)
);
Pstream::combineAllGather
Pstream::combineReduce
(
searchData,
[](ProcData& x, const ProcData& y)

View File

@ -227,7 +227,7 @@ bool Foam::sampledMeshedSurface::update(const meshSearch& meshSearcher)
// See which processor has the nearest. Mark and subset
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pstream::listCombineAllGather(nearest, minFirstEqOp<scalar>{});
Pstream::listCombineReduce(nearest, minFirstEqOp<scalar>{});
labelList cellOrFaceLabels(fc.size(), -1);

View File

@ -119,7 +119,7 @@ Foam::IOobjectList Foam::sampledSurfaces::preCheckFields()
}
// Parallel consistency (no-op in serial)
Pstream::mapCombineAllGather(selected, HashSetOps::plusEqOp<word>());
Pstream::mapCombineReduce(selected, HashSetOps::plusEqOp<word>());
DynamicList<label> missed(fieldSelection_.size());

View File

@ -262,7 +262,7 @@ void Foam::isoSurfacePoint::syncUnseparatedPoints
}
// Globally consistent
Pstream::listCombineAllGather(sharedPts, minEqOp<point>());
Pstream::listCombineReduce(sharedPts, minEqOp<point>());
// Now we will all have the same information. Merge it back with
// my local information.