diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/exchange.C b/src/OpenFOAM/db/IOstreams/Pstreams/exchange.C index 64ced34ecf..b950ed22f0 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/exchange.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/exchange.C @@ -50,43 +50,42 @@ void Pstream::exchange const bool block ) { - if (UPstream::parRun()) + if (!contiguous()) { - if (!contiguous()) - { - FatalErrorIn - ( - "Pstream::exchange(..)" - ) << "Continuous data only." << Foam::abort(FatalError); - } + FatalErrorIn + ( + "Pstream::exchange(..)" + ) << "Continuous data only." << Foam::abort(FatalError); + } - if (sendBufs.size() != UPstream::nProcs()) - { - FatalErrorIn - ( - "Pstream::exchange(..)" - ) << "Size of list:" << sendBufs.size() - << " does not equal the number of processors:" - << UPstream::nProcs() - << Foam::abort(FatalError); - } + if (sendBufs.size() != UPstream::nProcs()) + { + FatalErrorIn + ( + "Pstream::exchange(..)" + ) << "Size of list:" << sendBufs.size() + << " does not equal the number of processors:" + << UPstream::nProcs() + << Foam::abort(FatalError); + } - sizes.setSize(UPstream::nProcs()); - labelList& nsTransPs = sizes[UPstream::myProcNo()]; - nsTransPs.setSize(UPstream::nProcs()); + sizes.setSize(UPstream::nProcs()); + labelList& nsTransPs = sizes[UPstream::myProcNo()]; + nsTransPs.setSize(UPstream::nProcs()); - forAll(sendBufs, procI) - { - nsTransPs[procI] = sendBufs[procI].size(); - } - - // Send sizes across. - int oldTag = UPstream::msgType(); - UPstream::msgType() = tag; - combineReduce(sizes, UPstream::listEq()); - UPstream::msgType() = oldTag; + forAll(sendBufs, procI) + { + nsTransPs[procI] = sendBufs[procI].size(); + } + // Send sizes across. + int oldTag = UPstream::msgType(); + UPstream::msgType() = tag; + combineReduce(sizes, UPstream::listEq()); + UPstream::msgType() = oldTag; + if (Pstream::parRun()) + { // Set up receives // ~~~~~~~~~~~~~~~