diff --git a/applications/test/parallel-comm0/Test-parallel-comm0.C b/applications/test/parallel-comm0/Test-parallel-comm0.C index c9dba8cadc..e8c8a1e5b9 100644 --- a/applications/test/parallel-comm0/Test-parallel-comm0.C +++ b/applications/test/parallel-comm0/Test-parallel-comm0.C @@ -122,7 +122,12 @@ int main(int argc, char *argv[]) } Pout<< "local procUsed " << procUsed << nl; - reduce(procUsed.data(), procUsed.size_data(), bitOrOp()); + reduce + ( + procUsed.data(), + procUsed.size_data(), + bitOrOp() + ); Pout<< "reduce procUsed " << procUsed << nl; // Identical size on all procs @@ -146,7 +151,12 @@ int main(int argc, char *argv[]) } Pout<< "local uniform " << uniformity << nl; - reduce(uniformity.data(), uniformity.size_data(), bitOrOp()); + reduce + ( + uniformity.data(), + uniformity.size_data(), + bitOrOp() + ); Pout<< "reduce uniform " << uniformity << nl; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/convertLagrangian.H b/applications/utilities/postProcessing/dataConversion/foamToVTK/convertLagrangian.H index cc533e3a9b..d1c10b9574 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/convertLagrangian.H +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/convertLagrangian.H @@ -30,11 +30,7 @@ if (doLagrangian) nameOp() ); - if (UPstream::parRun()) - { - // Synchronise cloud names - Pstream::combineReduce(cloudNames, ListOps::uniqueEqOp()); - } + Pstream::combineReduce(cloudNames, ListOps::uniqueEqOp()); Foam::sort(cloudNames); // Consistent order for (const word& cloudName : cloudNames) diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracksSamplerTemplates.C b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracksSamplerTemplates.C index a29b40b69a..8312ca5124 100644 --- a/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracksSamplerTemplates.C +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracksSamplerTemplates.C @@ -75,10 +75,7 @@ Foam::label Foam::particleTracksSampler::setTrackFields { wordList fieldNames = obr.names>(); - if (Pstream::parRun()) - { - Pstream::combineReduce(fieldNames, ListOps::uniqueEqOp()); - } + Pstream::combineReduce(fieldNames, ListOps::uniqueEqOp()); for (const word& fieldName : fieldNames) { diff --git a/src/OpenFOAM/db/IOobjectList/IOobjectList.C b/src/OpenFOAM/db/IOobjectList/IOobjectList.C index 8ae7d52a5f..4439109d00 100644 --- a/src/OpenFOAM/db/IOobjectList/IOobjectList.C +++ b/src/OpenFOAM/db/IOobjectList/IOobjectList.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2016-2022 OpenCFD Ltd. + Copyright (C) 2016-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,7 +39,7 @@ void Foam::IOobjectList::checkObjectOrder bool syncPar ) { - if (syncPar && Pstream::parRun()) + if (syncPar && UPstream::is_parallel()) { wordList objectNames(objs.size()); @@ -62,21 +62,21 @@ void Foam::IOobjectList::checkNameOrder bool syncPar ) { - if (syncPar && Pstream::parRun()) + if (syncPar && UPstream::is_parallel()) { wordList masterNames; - if (Pstream::master()) + if (UPstream::master()) { masterNames = objectNames; } Pstream::broadcast(masterNames); - if (objectNames != masterNames) + if (!UPstream::master() && (objectNames != masterNames)) { FatalErrorInFunction << "Objects not synchronised across processors." << nl << "Master has " << flatOutput(masterNames) << nl - << "Processor " << Pstream::myProcNo() + << "Processor " << UPstream::myProcNo() << " has " << flatOutput(objectNames) << endl << exit(FatalError); } @@ -86,12 +86,8 @@ void Foam::IOobjectList::checkNameOrder void Foam::IOobjectList::syncNames(wordList& objNames) { - if (Pstream::parRun()) - { - // Synchronize names - Pstream::combineReduce(objNames, ListOps::uniqueEqOp()); - } - + // Synchronize names + Pstream::combineReduce(objNames, ListOps::uniqueEqOp()); Foam::sort(objNames); // Consistent order } @@ -331,7 +327,7 @@ Foam::wordList Foam::IOobjectList::allNames() const void Foam::IOobjectList::checkNames(const bool syncPar) const { - if (syncPar && Pstream::parRun()) + if (syncPar && UPstream::is_parallel()) { wordList objNames(HashPtrTable::sortedToc()); diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H index bf8e6f2f66..7c114a54e8 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H @@ -382,7 +382,8 @@ Pstream_CommonReductions(uint64_t); Pstream_FloatReductions(float); Pstream_FloatReductions(double); -Pstream_BitwiseReductions(unsigned); +Pstream_BitwiseReductions(unsigned char); +Pstream_BitwiseReductions(unsigned int); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstreamBase.C b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstreamBase.C index 0151f0ab04..c4d4b8def6 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstreamBase.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstreamBase.C @@ -494,7 +494,7 @@ Foam::Istream& Foam::UIPstreamBase::read(char* data, std::streamsize count) Foam::Istream& Foam::UIPstreamBase::readRaw(char* data, std::streamsize count) { - // No check for format() == BINARY since this is either done in the + // No check for IOstreamOption::BINARY since this is either done in the // beginRawRead() method, or the caller knows what they are doing. // Any alignment must have been done prior to this call @@ -505,7 +505,7 @@ Foam::Istream& Foam::UIPstreamBase::readRaw(char* data, std::streamsize count) bool Foam::UIPstreamBase::beginRawRead() { - if (format() != BINARY) + if (format() != IOstreamOption::BINARY) { FatalErrorInFunction << "stream format not binary" diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstreamBase.C b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstreamBase.C index 13bf32ade0..fca288d555 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstreamBase.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstreamBase.C @@ -346,7 +346,7 @@ Foam::Ostream& Foam::UOPstreamBase::write std::streamsize count ) { - if (format() != BINARY) + if (format() != IOstreamOption::BINARY) { FatalErrorInFunction << "stream format not binary" @@ -366,7 +366,7 @@ Foam::Ostream& Foam::UOPstreamBase::writeRaw std::streamsize count ) { - // No check for format() == BINARY since this is either done in the + // No check for IOstreamOption::BINARY since this is either done in the // beginRawWrite() method, or the caller knows what they are doing. // Previously aligned and sizes reserved via beginRawWrite() @@ -378,7 +378,7 @@ Foam::Ostream& Foam::UOPstreamBase::writeRaw bool Foam::UOPstreamBase::beginRawWrite(std::streamsize count) { - if (format() != BINARY) + if (format() != IOstreamOption::BINARY) { FatalErrorInFunction << "stream format not binary" diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C index 831f6485b6..cfc1deca0f 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C @@ -1061,7 +1061,7 @@ Foam::Istream& Foam::ISstream::readRaw(char* data, std::streamsize count) bool Foam::ISstream::beginRawRead() { - if (format() != BINARY) + if (format() != IOstreamOption::BINARY) { FatalIOErrorInFunction(*this) << "stream format not binary" diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C index 4efc58d929..fd7baf3e9d 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C @@ -224,7 +224,7 @@ Foam::Ostream& Foam::OSstream::write(const char* data, std::streamsize count) bool Foam::OSstream::beginRawWrite(std::streamsize count) { - if (format() != BINARY) + if (format() != IOstreamOption::BINARY) { FatalIOErrorInFunction(*this) << "stream format not binary" @@ -251,7 +251,7 @@ Foam::Ostream& Foam::OSstream::writeRaw std::streamsize count ) { - // No check for format() == BINARY since this is either done in the + // No check for IOstreamOption::BINARY since this is either done in the // beginRawWrite() method, or the caller knows what they are doing. os_.write(data, count); diff --git a/src/OpenFOAM/db/IOstreams/Tstreams/OTstream.C b/src/OpenFOAM/db/IOstreams/Tstreams/OTstream.C index 030090d3d5..67d1703d7a 100644 --- a/src/OpenFOAM/db/IOstreams/Tstreams/OTstream.C +++ b/src/OpenFOAM/db/IOstreams/Tstreams/OTstream.C @@ -143,15 +143,14 @@ Foam::Ostream& Foam::OTstream::write(const double val) Foam::Ostream& Foam::OTstream::write(const char* data, std::streamsize count) { - if (format() != IOstreamOption::BINARY) - { - FatalErrorInFunction - << "stream format not binary" - << Foam::abort(FatalError); - } + // if (format() != IOstreamOption::BINARY) + // { + // FatalErrorInFunction + // << "stream format not binary" + // << Foam::abort(FatalError); + // } NotImplemented; - return *this; } @@ -162,26 +161,24 @@ Foam::Ostream& Foam::OTstream::writeRaw std::streamsize count ) { - // No check for format() == BINARY since this is either done in the + // No check for IOstreamOption::BINARY since this is either done in the // beginRawWrite() method, or the caller knows what they are doing. NotImplemented; - return *this; } bool Foam::OTstream::beginRawWrite(std::streamsize count) { - if (format() != IOstreamOption::BINARY) - { - FatalErrorInFunction - << "stream format not binary" - << Foam::abort(FatalError); - } + // if (format() != IOstreamOption::BINARY) + // { + // FatalErrorInFunction + // << "stream format not binary" + // << Foam::abort(FatalError); + // } NotImplemented; - return true; } diff --git a/src/OpenFOAM/db/options/IOstreamOption.C b/src/OpenFOAM/db/options/IOstreamOption.C index 9be225b51c..08be738239 100644 --- a/src/OpenFOAM/db/options/IOstreamOption.C +++ b/src/OpenFOAM/db/options/IOstreamOption.C @@ -59,7 +59,7 @@ Foam::IOstreamOption::formatEnum if (!formatName.empty()) { - if (formatNames.found(formatName)) + if (formatNames.contains(formatName)) { return formatNames[formatName]; } diff --git a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C index 08710c72fa..059aa20391 100644 --- a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C +++ b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C @@ -566,7 +566,7 @@ Foam::fileOperation::lookupAndCacheProcessorsPath // 3 : mixed empty/non-empty directory (after reduce) // Combines andOp() and orOp() in single operation - unsigned procDirsStatus = (procDirs.empty() ? 1u : 2u); + unsigned int procDirsStatus = (procDirs.empty() ? 1u : 2u); if (debug) { @@ -576,7 +576,7 @@ Foam::fileOperation::lookupAndCacheProcessorsPath if (UPstream::parRun() && (!distributed() || syncPar)) { - reduce(procDirsStatus, bitOrOp()); // worldComm + reduce(procDirsStatus, bitOrOp()); // worldComm if (procDirsStatus == 3u) { diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H index b9a70712c5..40af50afbe 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H @@ -606,34 +606,6 @@ public: // full parallel analysis to determine shared points and // boundaries. void updateMesh(); - - - // Housekeeping - - //- Deprecated(2020-09) use ListOps::appendEqOp - // Uses a different template parameter - // \code - // globalMeshData::ListPlusEqOp() - // ListOps::appendEqOp