STYLE: prefer listReduce() to using listCombineReduce() when possible

- potentially allows access into the builtin MPI operations
This commit is contained in:
Mark Olesen
2025-02-25 19:26:40 +01:00
parent 5d9f8e9a9d
commit 20b2f46315
38 changed files with 97 additions and 98 deletions

View File

@ -229,7 +229,7 @@ void Foam::VF::raySearchEngine::createAgglomeration(const IOobject& io)
Pstream::allGatherList(allSf_);
Pstream::allGatherList(allAgg_);
Pstream::listCombineGather(patchAreas_, plusEqOp<scalar>());
Pstream::listGather(patchAreas_, sumOp<scalar>());
Pstream::broadcast(patchAreas_);
globalNumbering_ = globalIndex(nCoarseFace_);
@ -262,8 +262,11 @@ void Foam::VF::raySearchEngine::createGeometry()
Pstream::allGatherList(allCf_);
Pstream::allGatherList(allSf_);
Pstream::listCombineGather(patchAreas_, plusEqOp<scalar>());
Pstream::broadcast(patchAreas_);
// Pstream::listCombineGather(patchAreas_, plusEqOp<scalar>());
// Pstream::broadcast(patchAreas_);
// Basic type and op_sum, so can use listReduce (ie, mpiAllReduce)
Pstream::listReduce(patchAreas_, sumOp<scalar>());
globalNumbering_ = globalIndex(nFace_);
}

View File

@ -407,7 +407,7 @@ bool setFaceFieldType
}
}
Pstream::listCombineReduce(nChanged, plusEqOp<label>());
Pstream::listReduce(nChanged, sumOp<label>());
auto& fieldBf = field.boundaryFieldRef();