diff --git a/applications/test/parallel-comm1/Test-parallel-comm1.C b/applications/test/parallel-comm1/Test-parallel-comm1.C index ed8ce38516..d0bc966a5d 100644 --- a/applications/test/parallel-comm1/Test-parallel-comm1.C +++ b/applications/test/parallel-comm1/Test-parallel-comm1.C @@ -50,37 +50,37 @@ scalar sumReduce ) { scalar sum = 0; - if (Pstream::parRun()) + if (UPstream::parRun()) { if (UPstream::master(comm)) { - // Add master value and all slaves + // Add master value and all sub-procs sum = localValue; - for (const int slave : UPstream::subProcs(comm)) + for (const int proci : UPstream::subProcs(comm)) { - scalar slaveValue; + scalar procValue; UIPstream::read ( - Pstream::commsTypes::blocking, - slave, - reinterpret_cast(&slaveValue), + UPstream::commsTypes::blocking, + proci, + reinterpret_cast(&procValue), sizeof(scalar), UPstream::msgType(), // tag comm // communicator ); - sum += slaveValue; + sum += procValue; } - // Send back to slaves + // Send back - for (const int slave : UPstream::subProcs(comm)) + for (const int proci : UPstream::subProcs(comm)) { UOPstream::write ( UPstream::commsTypes::blocking, - slave, + proci, reinterpret_cast(&sum), sizeof(scalar), UPstream::msgType(), // tag diff --git a/applications/test/parallel/Test-parallel.C b/applications/test/parallel/Test-parallel.C index 580ae453a8..7479a49922 100644 --- a/applications/test/parallel/Test-parallel.C +++ b/applications/test/parallel/Test-parallel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,27 +52,27 @@ void testMapDistribute() // Generate random data. List>> complexData(100); - forAll(complexData, i) + for (auto& data : complexData) { - complexData[i].first() = rndGen.position(0, Pstream::nProcs()-1); - complexData[i].second().setSize(3); - complexData[i].second()[0] = 1; - complexData[i].second()[1] = 2; - complexData[i].second()[2] = 3; + data.first() = rndGen.position(0, UPstream::nProcs()-1); + data.second().resize(3); + data.second()[0] = 1; + data.second()[1] = 2; + data.second()[2] = 3; } // Send all ones to processor indicated by .first() // Count how many to send - labelList nSend(Pstream::nProcs(), Zero); - forAll(complexData, i) + labelList nSend(UPstream::nProcs(), Foam::zero{}); + for (const auto& data : complexData) { - const label proci = complexData[i].first(); + const label proci = data.first(); nSend[proci]++; } // Collect items to be sent - labelListList sendMap(Pstream::nProcs()); + labelListList sendMap(UPstream::nProcs()); forAll(sendMap, proci) { sendMap[proci].resize_nocopy(nSend[proci]); @@ -116,40 +116,31 @@ void testTransfer(const T& input) { T data = input; - if (Pstream::master()) + if (UPstream::master()) { Perr<<"test transfer (" << (typeid(T).name()) << "): "; perrInfo(data) << nl << endl; - } - if (Pstream::master()) - { - for (const int slave : Pstream::subProcs()) + for (const int proci : UPstream::subProcs()) { - Perr<< "master receiving from slave " << slave << endl; - IPstream fromSlave(Pstream::commsTypes::blocking, slave); - fromSlave >> data; + Perr<< "master receiving from proc:" << proci << endl; + IPstream::recv(data, proci); perrInfo(data) << endl; } - for (const int slave : Pstream::subProcs()) + for (const int proci : UPstream::subProcs()) { - Perr<< "master sending to slave " << slave << endl; - OPstream toSlave(Pstream::commsTypes::blocking, slave); - toSlave << data; + Perr<< "master sending to proc:" << proci << endl; + OPstream::bsend(data, proci); } } else { - { - Perr<< "slave sending to master " << Pstream::masterNo() << endl; - OPstream toMaster(Pstream::commsTypes::blocking, Pstream::masterNo()); - toMaster << data; - } + Perr<< "proc sending to master" << endl; + OPstream::bsend(data, UPstream::masterNo()); - Perr<< "slave receiving from master " << Pstream::masterNo() << endl; - IPstream fromMaster(Pstream::commsTypes::blocking, Pstream::masterNo()); - fromMaster >> data; + Perr<< "proc receiving from master" << endl; + IPstream::recv(data, UPstream::masterNo()); perrInfo(data) << endl; } } @@ -160,49 +151,31 @@ void testTokenized(const T& data) { token tok; - if (Pstream::master()) + if (UPstream::master()) { - Perr<<"test tokenized \"" << data << "\"" << nl << endl; - } + Perr<< "test tokenized \"" << data << "\"" << nl << endl; - if (Pstream::master()) - { - for (const int slave : Pstream::subProcs()) + for (const int proci : UPstream::subProcs()) { - Perr<< "master receiving from slave " << slave << endl; - IPstream fromSlave(Pstream::commsTypes::blocking, slave); - fromSlave >> tok; + Perr<< "master receiving from proc:" << proci << endl; + IPstream::recv(tok, proci); Perr<< tok.info() << endl; } - for (const int slave : Pstream::subProcs()) + for (const int proci : UPstream::subProcs()) { - Perr<< "master sending to slave " << slave << endl; - OPstream toSlave(Pstream::commsTypes::blocking, slave); - toSlave << data; + Perr<< "master sending to proc:" << proci << endl; + OPstream::bsend(tok, proci); } } else { - { - Perr<< "slave sending to master " << Pstream::masterNo() << endl; - OPstream toMaster - ( - Pstream::commsTypes::blocking, - Pstream::masterNo() - ); + Perr<< "proc sending to master" << endl; + OPstream::bsend(tok, UPstream::masterNo()); - toMaster << data; - } + Perr<< "proc receiving from master" << endl; + IPstream::recv(tok, UPstream::masterNo()); - Perr<< "slave receiving from master " << Pstream::masterNo() << endl; - IPstream fromMaster - ( - Pstream::commsTypes::blocking, - Pstream::masterNo() - ); - - fromMaster >> tok; Perr<< tok.info() << endl; } } @@ -212,12 +185,14 @@ void testTokenized(const T& data) int main(int argc, char *argv[]) { + argList::noCheckProcessorDirectories(); + #include "setRootCase.H" #include "createTime.H" testMapDistribute(); - if (!Pstream::parRun()) + if (!UPstream::parRun()) { Info<< "\nWarning: not parallel - skipping further tests\n" << endl; return 0; diff --git a/applications/test/treeComms/Test-treeComms.C b/applications/test/treeComms/Test-treeComms.C index 94588bd797..d31cc69694 100644 --- a/applications/test/treeComms/Test-treeComms.C +++ b/applications/test/treeComms/Test-treeComms.C @@ -51,7 +51,7 @@ void printConnection(Ostream& os, const label proci, const labelUList& below) // The number of receives - as per gatherList (v2112) void printRecvCount_gatherList ( - const List& comms, + const UList& comms, const label comm = UPstream::worldComm ) { @@ -91,7 +91,7 @@ void printRecvCount_gatherList // The number of sends - as per scatterList (v2112) void printSendCount_scatterList ( - const List& comms, + const UList& comms, const label comm = UPstream::worldComm ) { @@ -131,7 +131,7 @@ void printSendCount_scatterList // Transmission widths (contiguous data) void printWidths ( - const List& comms, + const UList& comms, const label comm = UPstream::worldComm ) { diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/IPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/IPstream.H index 5dda9b6e6e..87844b933e 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/IPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/IPstream.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2013 OpenFOAM Foundation - Copyright (C) 2021-2023 OpenCFD Ltd. + Copyright (C) 2021-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -71,6 +71,33 @@ public: const label comm = UPstream::worldComm, IOstreamOption::streamFormat fmt = IOstreamOption::BINARY ); + + + // Static Functions + + //- Receive and deserialize a value. + //- Uses \c operator>> for de-serialization + template + static void recv + ( + Type& value, + const int fromProcNo, + const int tag = UPstream::msgType(), + const label comm = UPstream::worldComm, + IOstreamOption::streamFormat fmt = IOstreamOption::BINARY + ) + { + IPstream is + ( + UPstream::commsTypes::scheduled, + fromProcNo, + 0, // bufSize + tag, + comm, + fmt + ); + is >> value; + } }; diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/OPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/OPstream.H index 154ed87d31..bd1f6953e3 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/OPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/OPstream.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2013 OpenFOAM Foundation - Copyright (C) 2021-2023 OpenCFD Ltd. + Copyright (C) 2021-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -71,6 +71,73 @@ public: const label comm = UPstream::worldComm, IOstreamOption::streamFormat fmt = IOstreamOption::BINARY ); + + + // Static Functions + + //- Serialize a value and send (buffered/blocking or standard mode). + //- Uses \c operator<< for serialization + template + static void send + ( + const Type& value, + //! blocking or scheduled only! + const UPstream::commsTypes commsType, + const int toProcNo, + const int tag = UPstream::msgType(), + const label comm = UPstream::worldComm, + IOstreamOption::streamFormat fmt = IOstreamOption::BINARY + ) + { + OPstream os(commsType, toProcNo, 0, tag, comm, fmt); + os << value; + } + + //- Serialize a value and send (buffered/blocking mode). + //- Uses \c operator<< for serialization + template + static void bsend + ( + const Type& value, + const int toProcNo, + const int tag = UPstream::msgType(), + const label comm = UPstream::worldComm, + IOstreamOption::streamFormat fmt = IOstreamOption::BINARY + ) + { + OPstream::send + ( + value, + UPstream::commsTypes::blocking, + toProcNo, + tag, + comm, + fmt + ); + } + + //- Serialize a value and send (standard mode). + //- Uses \c operator<< for serialization + template + static void send + ( + const Type& value, + const int toProcNo, + const int tag = UPstream::msgType(), + const label comm = UPstream::worldComm, + IOstreamOption::streamFormat fmt = IOstreamOption::BINARY + ) + { + OPstream::send + ( + value, + UPstream::commsTypes::scheduled, + toProcNo, + tag, + comm, + fmt + ); + } }; diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H index fe251cbf91..04e3009503 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2023 OpenCFD Ltd. + Copyright (C) 2016-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -170,7 +170,7 @@ public: // Gather/combine data // Inplace combine values from processors. - // (Uses construct from Istream instead of <<) + // (Uses construct from Istream instead of \c << operator) //- Gather data, applying \c cop to inplace combine \c value //- from different processors. @@ -178,6 +178,7 @@ public: template static void combineGather ( + //! [in,out] T& value, const CombineOp& cop, const int tag = UPstream::msgType(), @@ -193,6 +194,7 @@ public: template static void combineReduce ( + //! [in,out] T& value, const CombineOp& cop, const int tag = UPstream::msgType(), @@ -220,7 +222,8 @@ public: template static void listCombineGather ( - List& values, + //! [in,out] + UList& values, const CombineOp& cop, const int tag = UPstream::msgType(), const label comm = UPstream::worldComm @@ -232,6 +235,7 @@ public: template static void listCombineReduce ( + //! [in,out] - List (not UList) due to broadcast() List& values, const CombineOp& cop, const int tag = UPstream::msgType(), @@ -242,6 +246,7 @@ public: template static void listCombineAllGather ( + //! [in,out] - List (not UList) due to broadcast() List& values, const CombineOp& cop, const int tag = UPstream::msgType(), @@ -305,8 +310,9 @@ public: template static void gatherList ( - const List& comms, - List& values, + const UList& comms, + //! [in,out] + UList& values, const int tag, const label comm ); @@ -316,7 +322,8 @@ public: template static void gatherList ( - List& values, + //! [in,out] + UList& values, const int tag = UPstream::msgType(), const label comm = UPstream::worldComm ); @@ -328,73 +335,35 @@ public: template static void allGatherList ( - List& values, + //! [in,out] + UList& values, const int tag = UPstream::msgType(), const label comm = UPstream::worldComm ); - // Scatter + // Scatter - //- Broadcast data - template - FOAM_DEPRECATED_FOR(2024-01, "broadcast()") - static void scatter - ( - T& value, - const int tag = UPstream::msgType(), //!< ignored - const label comm = UPstream::worldComm - ); + //- Inverse of gatherList. + //- Uses the specified communication schedule. + template + static void scatterList + ( + const UList& comms, + UList& values, + const int tag, + const label comm + ); - //- Broadcast data - template - FOAM_DEPRECATED_FOR(2024-01, "broadcast()") - static void combineScatter - ( - T& value, - const int tag = UPstream::msgType(), //!< ignored - const label comm = UPstream::worldComm - ); - - //- Broadcast data - template - FOAM_DEPRECATED_FOR(2024-01, "broadcast()") - static void listCombineScatter - ( - List& value, - const int tag = UPstream::msgType(), //!< ignored - const label comm = UPstream::worldComm - ); - - //- Broadcast data - template - FOAM_DEPRECATED_FOR(2024-01, "broadcast()") - static void mapCombineScatter - ( - Container& values, - const int tag = UPstream::msgType(), //!< ignored - const label comm = UPstream::worldComm - ); - - - //- Scatter data. Reverse of gatherList - template - static void scatterList - ( - const List& comms, - List& values, - const int tag, - const label comm - ); - - //- Like above but switches between linear/tree communication - template - static void scatterList - ( - List& values, - const int tag = UPstream::msgType(), - const label comm = UPstream::worldComm - ); + //- Inverse of gatherList. + //- Uses linear/tree communication. + template + static void scatterList + ( + UList& values, + const int tag = UPstream::msgType(), + const label comm = UPstream::worldComm + ); // Exchange @@ -573,6 +542,61 @@ public: const label comm, const bool wait = true //!< (ignored) ); + + + // Housekeeping + + //- \deprecated(2024-01) Broadcast data + template + FOAM_DEPRECATED_FOR(2024-01, "Pstream::broadcast()") + static void scatter + ( + T& value, + const int tag = UPstream::msgType(), //!< ignored + const label comm = UPstream::worldComm + ) + { + Pstream::broadcast(value, comm); + } + + //- \deprecated(2024-01) Broadcast data + template + FOAM_DEPRECATED_FOR(2024-01, "Pstream::broadcast()") + static void combineScatter + ( + T& value, + const int tag = UPstream::msgType(), //!< ignored + const label comm = UPstream::worldComm + ) + { + Pstream::broadcast(value, comm); + } + + //- \deprecated(2024-01) Broadcast data + template + FOAM_DEPRECATED_FOR(2024-01, "Pstream::broadcast()") + static void listCombineScatter + ( + List& value, + const int tag = UPstream::msgType(), //!< ignored + const label comm = UPstream::worldComm + ) + { + Pstream::broadcast(value, comm); + } + + //- \deprecated(2024-01) Broadcast data + template + FOAM_DEPRECATED_FOR(2024-01, "Pstream::broadcast()") + static void mapCombineScatter + ( + Container& values, + const int tag = UPstream::msgType(), //!< ignored + const label comm = UPstream::worldComm + ) + { + Pstream::broadcast(values, comm); + } }; diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBroadcast.C b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBroadcast.C index e9e2ce98bc..7bba29d4fb 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBroadcast.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBroadcast.C @@ -148,7 +148,11 @@ namespace Foam //- Return a broadcasted value (uses a copy internally) template -Type returnBroadcast(const Type& value, const label comm) +Type returnBroadcast +( + const Type& value, + const label comm = UPstream::worldComm +) { Type work(value); Pstream::broadcast(work, comm); diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamCombineGather.C b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamCombineGather.C index 4696d00592..6b280517e0 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamCombineGather.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamCombineGather.C @@ -107,7 +107,7 @@ void Foam::Pstream::combineGather } // Send up value - if (myComm.above() != -1) + if (myComm.above() >= 0) { if (debug & 2) { @@ -166,7 +166,7 @@ void Foam::Pstream::combineReduce template void Foam::Pstream::listCombineGather ( - List& values, + UList& values, const CombineOp& cop, const int tag, const label comm @@ -233,7 +233,7 @@ void Foam::Pstream::listCombineGather } // Send up values - if (myComm.above() != -1) + if (myComm.above() >= 0) { if (debug & 2) { @@ -349,7 +349,7 @@ void Foam::Pstream::mapCombineGather } // Send up values - if (myComm.above() != -1) + if (myComm.above() >= 0) { if (debug & 2) { diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamGather.C b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamGather.C index f879f91283..920a9a2216 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamGather.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamGather.C @@ -26,7 +26,7 @@ License Description Gather data from all processors onto single processor according to some - communication schedule (usually linear-to-master or tree-to-master). + communication schedule (usually tree-to-master). The gathered data will be a single value constructed from the values on individual processors using a user-specified operator. @@ -88,7 +88,7 @@ void Foam::Pstream::gather } // Send up value - if (myComm.above() != -1) + if (myComm.above() >= 0) { if (is_contiguous::value) { diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamGatherList.C b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamGatherList.C index d009e43eb8..74af324b34 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamGatherList.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamGatherList.C @@ -26,7 +26,7 @@ License Description Gather data from all processors onto single processor according to some - communication schedule (usually linear-to-master or tree-to-master). + communication schedule (usually tree-to-master). The gathered data will be a list with element procID the data from processor procID. Before calling every processor should insert its value into values[UPstream::myProcNo(comm)]. @@ -45,24 +45,27 @@ Description template void Foam::Pstream::gatherList ( - const List& comms, - List& values, + const UList& comms, + UList& values, const int tag, const label comm ) { if (!comms.empty() && UPstream::is_parallel(comm)) { - if (values.size() < UPstream::nProcs(comm)) + const label myProci = UPstream::myProcNo(comm); + const label numProc = UPstream::nProcs(comm); + + if (values.size() < numProc) { FatalErrorInFunction - << "List of values is too small:" << values.size() - << " vs numProcs:" << UPstream::nProcs(comm) << nl + << "List of values:" << values.size() + << " < numProcs:" << numProc << nl << Foam::abort(FatalError); } // My communication order - const auto& myComm = comms[UPstream::myProcNo(comm)]; + const auto& myComm = comms[myProci]; // Receive from my downstairs neighbours for (const label belowID : myComm.below()) @@ -127,21 +130,21 @@ void Foam::Pstream::gatherList // Send up from values: // - my own value first // - all belowLeaves next - if (myComm.above() != -1) + if (myComm.above() >= 0) { const labelList& belowLeaves = myComm.allBelow(); if (debug & 2) { Pout<< " sending to " << myComm.above() - << " data from me:" << UPstream::myProcNo(comm) - << " data:" << values[UPstream::myProcNo(comm)] << endl; + << " data from me:" << myProci + << " data:" << values[myProci] << endl; } if (is_contiguous::value) { List sending(belowLeaves.size() + 1); - sending[0] = values[UPstream::myProcNo(comm)]; + sending[0] = values[myProci]; forAll(belowLeaves, leafI) { @@ -168,7 +171,7 @@ void Foam::Pstream::gatherList tag, comm ); - toAbove << values[UPstream::myProcNo(comm)]; + toAbove << values[myProci]; for (const label leafID : belowLeaves) { @@ -189,8 +192,8 @@ void Foam::Pstream::gatherList template void Foam::Pstream::scatterList ( - const List& comms, - List& values, + const UList& comms, + UList& values, const int tag, const label comm ) @@ -201,19 +204,22 @@ void Foam::Pstream::scatterList if (!comms.empty() && UPstream::is_parallel(comm)) { - if (values.size() < UPstream::nProcs(comm)) + const label myProci = UPstream::myProcNo(comm); + const label numProc = UPstream::nProcs(comm); + + if (values.size() < numProc) { FatalErrorInFunction - << "List of values is too small:" << values.size() - << " vs numProcs:" << UPstream::nProcs(comm) << nl + << "List of values:" << values.size() + << " < numProcs:" << numProc << nl << Foam::abort(FatalError); } // My communication order - const auto& myComm = comms[UPstream::myProcNo(comm)]; + const auto& myComm = comms[myProci]; // Receive from up - if (myComm.above() != -1) + if (myComm.above() >= 0) { const labelList& notBelowLeaves = myComm.allNotBelow(); @@ -318,7 +324,7 @@ void Foam::Pstream::scatterList template void Foam::Pstream::gatherList ( - List& values, + UList& values, const int tag, const label comm ) @@ -337,7 +343,7 @@ void Foam::Pstream::gatherList template void Foam::Pstream::scatterList ( - List& values, + UList& values, const int tag, const label comm ) @@ -355,7 +361,7 @@ void Foam::Pstream::scatterList template void Foam::Pstream::allGatherList ( - List& values, + UList& values, const int tag, const label comm ) diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H index 83760dfc3e..de61d0e46a 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H @@ -1202,6 +1202,7 @@ public: //- Process index of first sub-process // \deprecated(2020-09) use subProcs() method instead + FOAM_DEPRECATED_FOR(2020-09, "subProcs() method") static constexpr int firstSlave() noexcept { return 1; @@ -1209,6 +1210,7 @@ public: //- Process index of last sub-process // \deprecated(2020-09) use subProcs() method instead + FOAM_DEPRECATED_FOR(2020-09, "subProcs() or allProcs() method") static int lastSlave(const label communicator = worldComm) { return nProcs(communicator) - 1; diff --git a/src/OpenFOAM/parallel/globalIndex/globalIndex.C b/src/OpenFOAM/parallel/globalIndex/globalIndex.C index 8f314ba328..218869d33b 100644 --- a/src/OpenFOAM/parallel/globalIndex/globalIndex.C +++ b/src/OpenFOAM/parallel/globalIndex/globalIndex.C @@ -290,7 +290,7 @@ Foam::globalIndex::bin if (!globalIds.empty()) { labelList& binOffsets = bins.offsets(); - binOffsets.resize(offsets.size(), Zero); + binOffsets.resize(offsets.size(), Foam::zero{}); labelList& binValues = bins.values(); binValues = UIndirectList