diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C index e0ef1bf8eb..fbe7575763 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C @@ -219,30 +219,6 @@ Foam::List Foam::UPstream::procIDs_(1, 0); // Standard transfer message type int Foam::UPstream::msgType_(1); -// New message type -int Foam::UPstream::freeTag_(msgType()+1); - -// Free'd message types -Foam::LIFOStack Foam::UPstream::freedTags_; - -int Foam::UPstream::allocateTag() -{ - if (freedTags_.empty()) - { - return freeTag_++; - } - else - { - return freedTags_.pop(); - } -} - -void Foam::UPstream::freeTag(const int tag) -{ - freedTags_.push(tag); -} - - // Linear communication schedule Foam::List Foam::UPstream::linearCommunication_(0); diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H index 57f6c263bc..a0b0e44b87 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H @@ -45,7 +45,6 @@ SourceFiles #include "HashTable.H" #include "string.H" #include "NamedEnum.H" -#include "LIFOStack.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -191,12 +190,6 @@ private: static List treeCommunication_; - //- Current free tag - static int freeTag_; - - //- Freed tags - static LIFOStack freedTags_; - // Private Member Functions //- Set data for parallel running @@ -346,11 +339,6 @@ public: { return msgType_; } - //- Allocate new tag - static int allocateTag(); - - //- Release allocated tag - static void freeTag(const int tag); //- Get the communications type of the stream diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C index df93919fd2..cc2a6ddb95 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C @@ -55,10 +55,20 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch ) : processorPolyPatch(name, size, start, index, bm, myProcNo, neighbProcNo), - tag_(UPstream::allocateTag()), + tag_ + ( + Pstream::nProcs()*max(myProcNo, neighbProcNo) + + min(myProcNo, neighbProcNo) + ), referPatchName_(referPatchName), referPatchID_(-1) -{} +{ + if (debug) + { + Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_ + << endl; + } +} Foam::processorCyclicPolyPatch::processorCyclicPolyPatch @@ -70,10 +80,20 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch ) : processorPolyPatch(name, dict, index, bm), - tag_(UPstream::allocateTag()), + tag_ + ( + Pstream::nProcs()*max(myProcNo(), neighbProcNo()) + + min(myProcNo(), neighbProcNo()) + ), referPatchName_(dict.lookup("referPatch")), referPatchID_(-1) -{} +{ + if (debug) + { + Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_ + << endl; + } +} Foam::processorCyclicPolyPatch::processorCyclicPolyPatch @@ -125,9 +145,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch() -{ - UPstream::freeTag(tag_); -} +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //