mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: processorCyclic was using incorrect message tag.
Both sides need to use the same tag so it is now calculated as
nProcs*(max(myProcNo,neighProcNo) + min(myProcNo,neighProcNo)
which is
- commutative
- does not interfere with normal message tag 1
This commit is contained in:
@ -219,30 +219,6 @@ Foam::List<int> Foam::UPstream::procIDs_(1, 0);
|
|||||||
// Standard transfer message type
|
// Standard transfer message type
|
||||||
int Foam::UPstream::msgType_(1);
|
int Foam::UPstream::msgType_(1);
|
||||||
|
|
||||||
// New message type
|
|
||||||
int Foam::UPstream::freeTag_(msgType()+1);
|
|
||||||
|
|
||||||
// Free'd message types
|
|
||||||
Foam::LIFOStack<int> 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
|
// Linear communication schedule
|
||||||
Foam::List<Foam::UPstream::commsStruct> Foam::UPstream::linearCommunication_(0);
|
Foam::List<Foam::UPstream::commsStruct> Foam::UPstream::linearCommunication_(0);
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,6 @@ SourceFiles
|
|||||||
#include "HashTable.H"
|
#include "HashTable.H"
|
||||||
#include "string.H"
|
#include "string.H"
|
||||||
#include "NamedEnum.H"
|
#include "NamedEnum.H"
|
||||||
#include "LIFOStack.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -191,12 +190,6 @@ private:
|
|||||||
static List<commsStruct> treeCommunication_;
|
static List<commsStruct> treeCommunication_;
|
||||||
|
|
||||||
|
|
||||||
//- Current free tag
|
|
||||||
static int freeTag_;
|
|
||||||
|
|
||||||
//- Freed tags
|
|
||||||
static LIFOStack<int> freedTags_;
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Set data for parallel running
|
//- Set data for parallel running
|
||||||
@ -346,11 +339,6 @@ public:
|
|||||||
{
|
{
|
||||||
return msgType_;
|
return msgType_;
|
||||||
}
|
}
|
||||||
//- Allocate new tag
|
|
||||||
static int allocateTag();
|
|
||||||
|
|
||||||
//- Release allocated tag
|
|
||||||
static void freeTag(const int tag);
|
|
||||||
|
|
||||||
|
|
||||||
//- Get the communications type of the stream
|
//- Get the communications type of the stream
|
||||||
|
|||||||
@ -55,10 +55,20 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(name, size, start, index, bm, myProcNo, neighbProcNo),
|
processorPolyPatch(name, size, start, index, bm, myProcNo, neighbProcNo),
|
||||||
tag_(UPstream::allocateTag()),
|
tag_
|
||||||
|
(
|
||||||
|
Pstream::nProcs()*max(myProcNo, neighbProcNo)
|
||||||
|
+ min(myProcNo, neighbProcNo)
|
||||||
|
),
|
||||||
referPatchName_(referPatchName),
|
referPatchName_(referPatchName),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
||||||
@ -70,10 +80,20 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(name, dict, index, bm),
|
processorPolyPatch(name, dict, index, bm),
|
||||||
tag_(UPstream::allocateTag()),
|
tag_
|
||||||
|
(
|
||||||
|
Pstream::nProcs()*max(myProcNo(), neighbProcNo())
|
||||||
|
+ min(myProcNo(), neighbProcNo())
|
||||||
|
),
|
||||||
referPatchName_(dict.lookup("referPatch")),
|
referPatchName_(dict.lookup("referPatch")),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
||||||
@ -125,9 +145,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch()
|
Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch()
|
||||||
{
|
{}
|
||||||
UPstream::freeTag(tag_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|||||||
Reference in New Issue
Block a user