OpenFOAM logo
Open Source CFD Toolkit

Pstream Class Reference

Inheritance diagram for Pstream:

Inheritance graph
[legend]
Collaboration diagram for Pstream:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ClassName ("Pstream")
 Pstream (const label bufSize=0)
 Construct given optional buffer size.

Static Public Member Functions

void addValidParOptions (HashTable< string > &validParOptions)
 Add the valid option this type of communications library.
bool init (int &argc, char **&argv)
 Initialisation function called from main.
bool parRun ()
 Is this a parallel run?
label nProcs ()
 Number of processes in parallel run.
bool master ()
 Am I the master process.
int masterNo ()
 Process index of the master.
int myProcNo ()
 Number of this process (starting from masterNo() = 0).
const List< int > & procIDs ()
 Process IDs.
int procID (int procNo)
 Process ID of given process index.
int firstSlave ()
 Process index of first slave.
int lastSlave ()
 Process index of last slave.
const List< commsStruct > & linearCommunication ()
 Communication schedule for linear all-to-master (proc 0).
const List< commsStruct > & treeCommunication ()
 Communication schedule for tree all-to-master (proc 0).
int msgType ()
 Message tag of standard messages.
void exit (int errnum=1)
 Exit program.
void abort ()
 Abort program.
template<class T, class BinaryOp>
void gather (const List< commsStruct > &comms, T &Value, const BinaryOp &bop)
 Gather data. Apply bop to combine Value.
template<class T, class BinaryOp>
void gather (T &Value, const BinaryOp &bop)
 Like above but switches between linear/tree communication.
template<class T>
void scatter (const List< commsStruct > &comms, T &Value)
 Scatter data. Distribute without modification. Reverse of gather.
template<class T>
void scatter (T &Value)
 Like above but switches between linear/tree communication.
template<class T, class CombineOp>
void combineGather (const List< commsStruct > &comms, T &Value, const CombineOp &cop)
template<class T, class CombineOp>
void combineGather (T &Value, const CombineOp &cop)
 Like above but switches between linear/tree communication.
template<class T>
void combineScatter (const List< commsStruct > &comms, T &Value)
 Scatter data. Reverse of combineGather.
template<class T>
void combineScatter (T &Value)
 Like above but switches between linear/tree communication.
template<class T, class CombineOp>
void listCombineGather (const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop)
template<class T, class CombineOp>
void listCombineGather (List< T > &Value, const CombineOp &cop)
 Like above but switches between linear/tree communication.
template<class T>
void listCombineScatter (const List< commsStruct > &comms, List< T > &Value)
 Scatter data. Reverse of combineGather.
template<class T>
void listCombineScatter (List< T > &Value)
 Like above but switches between linear/tree communication.
template<class T>
void gatherList (const List< commsStruct > &comms, List< T > &Values)
 Gather data but keep individual values separate.
template<class T>
void gatherList (List< T > &Values)
 Like above but switches between linear/tree communication.
template<class T>
void scatterList (const List< commsStruct > &comms, List< T > &Values)
 Scatter data. Reverse of gatherList.
template<class T>
void scatterList (List< T > &Values)
 Like above but switches between linear/tree communication.

Static Public Attributes

bool floatTransfer
 Should compact transfer be used in which floats replace doubles.
int nProcsSimpleSum
 Number of processors at which the sum algorithm changes from linear.

Protected Member Functions

void enlargeBuffer (size_t count)
 Increase the size of the transfer buffer.

Protected Attributes

List< char > buf_
 Transfer buffer.
int bufPosition_
 Current buffer read/write location.

Constructor & Destructor Documentation

Pstream const label  bufSize = 0  )  [inline]
 

Construct given optional buffer size.

Definition at line 241 of file Pstream.H.


Member Function Documentation

void abort  )  [static]
 

Abort program.

void addValidParOptions HashTable< string > &  validParOptions  )  [static]
 

Add the valid option this type of communications library.

adds/requires on the command line

ClassName "Pstream"   ) 
 

void combineGather T &  Value,
const CombineOp &  cop
[static]
 

Like above but switches between linear/tree communication.

void combineGather const List< commsStruct > &  comms,
T &  Value,
const CombineOp &  cop
[static]
 

void combineScatter T &  Value  )  [static]
 

Like above but switches between linear/tree communication.

void combineScatter const List< commsStruct > &  comms,
T &  Value
[static]
 

Scatter data. Reverse of combineGather.

void enlargeBuffer size_t  count  )  [inline, protected]
 

Increase the size of the transfer buffer.

Definition at line 456 of file Pstream.H.

void exit int  errnum = 1  )  [static]
 

Exit program.

int firstSlave  )  [inline, static]
 

Process index of first slave.

Definition at line 309 of file Pstream.H.

void gather T &  Value,
const BinaryOp &  bop
[static]
 

Like above but switches between linear/tree communication.

void gather const List< commsStruct > &  comms,
T &  Value,
const BinaryOp &  bop
[static]
 

Gather data. Apply bop to combine Value.

from different processors

void gatherList List< T > &  Values  )  [static]
 

Like above but switches between linear/tree communication.

void gatherList const List< commsStruct > &  comms,
List< T > &  Values
[static]
 

Gather data but keep individual values separate.

bool init int &  argc,
char **&  argv
[static]
 

Initialisation function called from main.

Spawns slave processes and initialises inter-communication

int lastSlave  )  [inline, static]
 

Process index of last slave.

Definition at line 315 of file Pstream.H.

const List<commsStruct>& linearCommunication  )  [inline, static]
 

Communication schedule for linear all-to-master (proc 0).

Definition at line 321 of file Pstream.H.

void listCombineGather List< T > &  Value,
const CombineOp &  cop
[static]
 

Like above but switches between linear/tree communication.

void listCombineGather const List< commsStruct > &  comms,
List< T > &  Value,
const CombineOp &  cop
[static]
 

void listCombineScatter List< T > &  Value  )  [static]
 

Like above but switches between linear/tree communication.

void listCombineScatter const List< commsStruct > &  comms,
List< T > &  Value
[static]
 

Scatter data. Reverse of combineGather.

bool master  )  [inline, static]
 

Am I the master process.

Definition at line 279 of file Pstream.H.

int masterNo  )  [inline, static]
 

Process index of the master.

Definition at line 285 of file Pstream.H.

int msgType  )  [inline, static]
 

Message tag of standard messages.

Definition at line 333 of file Pstream.H.

References Foam::T().

Here is the call graph for this function:

int myProcNo  )  [inline, static]
 

Number of this process (starting from masterNo() = 0).

Definition at line 291 of file Pstream.H.

label nProcs  )  [inline, static]
 

Number of processes in parallel run.

Definition at line 273 of file Pstream.H.

bool parRun  )  [inline, static]
 

Is this a parallel run?

Definition at line 267 of file Pstream.H.

int procID int  procNo  )  [inline, static]
 

Process ID of given process index.

Definition at line 303 of file Pstream.H.

const List<int>& procIDs  )  [inline, static]
 

Process IDs.

Definition at line 297 of file Pstream.H.

void scatter T &  Value  )  [static]
 

Like above but switches between linear/tree communication.

void scatter const List< commsStruct > &  comms,
T &  Value
[static]
 

Scatter data. Distribute without modification. Reverse of gather.

void scatterList List< T > &  Values  )  [static]
 

Like above but switches between linear/tree communication.

void scatterList const List< commsStruct > &  comms,
List< T > &  Values
[static]
 

Scatter data. Reverse of gatherList.

const List<commsStruct>& treeCommunication  )  [inline, static]
 

Communication schedule for tree all-to-master (proc 0).

Definition at line 327 of file Pstream.H.

References Foam::T().

Here is the call graph for this function:


Member Data Documentation

List<char> buf_ [protected]
 

Transfer buffer.

Definition at line 204 of file Pstream.H.

int bufPosition_ [protected]
 

Current buffer read/write location.

Definition at line 207 of file Pstream.H.

bool floatTransfer [static]
 

Should compact transfer be used in which floats replace doubles.

reducing the bandwidth requirement at the expense of some loss in accuracy

Definition at line 229 of file Pstream.H.

int nProcsSimpleSum [static]
 

Number of processors at which the sum algorithm changes from linear.

to tree

Definition at line 235 of file Pstream.H.


The documentation for this class was generated from the following file:
For further information go to www.openfoam.org