diff --git a/src/foam/db/IOstreams/Pstreams/gatherScatter.C b/src/foam/db/IOstreams/Pstreams/gatherScatter.C index 33e469f4d..24bab91a5 100644 --- a/src/foam/db/IOstreams/Pstreams/gatherScatter.C +++ b/src/foam/db/IOstreams/Pstreams/gatherScatter.C @@ -50,10 +50,10 @@ void Pstream::gather const label comm ) { - if (Pstream::nProcs() > 1) + if (Pstream::nProcs(comm) > 1) { // Get my communication order - const commsStruct& myComm = comms[Pstream::myProcNo()]; + const commsStruct& myComm = comms[Pstream::myProcNo(comm)]; // Receive from my downstairs neighbours forAll (myComm.below(), belowI) @@ -129,13 +129,13 @@ void Pstream::gather const label comm ) { - if (Pstream::nProcs() < Pstream::nProcsSimpleSum()) + if (Pstream::nProcs(comm) < Pstream::nProcsSimpleSum()) { - gather(Pstream::linearCommunication(), Value, bop, tag, comm); + gather(Pstream::linearCommunication(comm), Value, bop, tag, comm); } else { - gather(Pstream::treeCommunication(), Value, bop, tag, comm); + gather(Pstream::treeCommunication(comm), Value, bop, tag, comm); } } @@ -149,10 +149,10 @@ void Pstream::scatter const label comm ) { - if (Pstream::nProcs() > 1) + if (Pstream::nProcs(comm) > 1) { // Get my communication order - const commsStruct& myComm = comms[Pstream::myProcNo()]; + const commsStruct& myComm = comms[Pstream::myProcNo(comm)]; // Receive from up if (myComm.above() != -1) @@ -221,13 +221,13 @@ void Pstream::scatter template void Pstream::scatter(T& Value, const int tag, const label comm) { - if (Pstream::nProcs() < Pstream::nProcsSimpleSum()) + if (Pstream::nProcs(comm) < Pstream::nProcsSimpleSum()) { - scatter(Pstream::linearCommunication(), Value, tag, comm); + scatter(Pstream::linearCommunication(comm), Value, tag, comm); } else { - scatter(Pstream::treeCommunication(), Value, tag, comm); + scatter(Pstream::treeCommunication(comm), Value, tag, comm); } } diff --git a/src/foam/db/IOstreams/Pstreams/gatherScatterList.C b/src/foam/db/IOstreams/Pstreams/gatherScatterList.C index d6e7a83e9..a017ecb55 100644 --- a/src/foam/db/IOstreams/Pstreams/gatherScatterList.C +++ b/src/foam/db/IOstreams/Pstreams/gatherScatterList.C @@ -233,7 +233,7 @@ void Pstream::scatterList ")" ) << "Size of list:" << Values.size() << " does not equal the number of processors:" - << Pstream::nProcs() + << Pstream::nProcs(comm) << Foam::abort(FatalError); }