Incremental update: Pstream
This commit is contained in:
parent
8d2bae6e31
commit
81dcaddb22
1 changed files with 109 additions and 80 deletions
|
@ -72,6 +72,8 @@ public:
|
|||
|
||||
static const NamedEnum<commsTypes, 3> commsTypeNames;
|
||||
|
||||
// Public classes
|
||||
|
||||
//- Structure for communicating between processors
|
||||
class commsStruct
|
||||
{
|
||||
|
@ -86,8 +88,8 @@ public:
|
|||
//- procIDs of all processors below (so not just directly below)
|
||||
labelList allBelow_;
|
||||
|
||||
//- procIDs of all processors not below. (inverse set of allBelow_
|
||||
// and minus myProcNo)
|
||||
//- procIDs of all processors not below. (inverse set of
|
||||
// allBelow_ and minus myProcNo)
|
||||
labelList allNotBelow_;
|
||||
|
||||
|
||||
|
@ -155,18 +157,45 @@ public:
|
|||
friend Ostream& operator<<(Ostream&, const commsStruct&);
|
||||
};
|
||||
|
||||
//- combineReduce operator for lists. Used for counting.
|
||||
class listEq
|
||||
{
|
||||
public:
|
||||
|
||||
template<class T>
|
||||
void operator()(T& x, const T& y) const
|
||||
{
|
||||
forAll(y, i)
|
||||
{
|
||||
if (y[i].size())
|
||||
{
|
||||
x[i] = y[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
static int myProcNo_;
|
||||
//- Is this a parallel run?
|
||||
static bool parRun_;
|
||||
|
||||
//- My processor index
|
||||
static int myProcNo_;
|
||||
|
||||
//- Process IDs
|
||||
static List<int> procIDs_;
|
||||
|
||||
//- Default message type
|
||||
static const int msgType_;
|
||||
|
||||
//- Structure for linear communications
|
||||
static List<commsStruct> linearCommunication_;
|
||||
|
||||
//- Structure for tree communications
|
||||
static List<commsStruct> treeCommunication_;
|
||||
|
||||
|
||||
|
@ -270,7 +299,7 @@ public:
|
|||
static bool init(int& argc, char**& argv);
|
||||
|
||||
//- Is this a parallel run?
|
||||
static bool parRun()
|
||||
static bool& parRun()
|
||||
{
|
||||
return parRun_;
|
||||
}
|
||||
|
|
Reference in a new issue