OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

Pstream Class Reference

Inheritance diagram for Pstream:

Inheritance graph
[legend]
Collaboration diagram for Pstream:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 66 of file Pstream.H.


Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static bool floatTransfer
 Should compact transfer be used in which floats replace doubles.
static int nProcsSimpleSum
 Number of processors at which the sum algorithm changes from linear.
static bool scheduledTransfer
 Switch for scheduled vs non-scheduled transfer.

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.

Classes

class  commsStruct

Constructor & Destructor Documentation

Pstream ( const label  bufSize = 0  )  [inline]

Construct given optional buffer size.

Definition at line 244 of file Pstream.H.


Member Function Documentation

void enlargeBuffer ( size_t  count  )  [inline, protected]

Increase the size of the transfer buffer.

Definition at line 459 of file Pstream.H.

ClassName ( "Pstream"   ) 

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

Add the valid option this type of communications library.

adds/requires on the command line

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

Initialisation function called from main.

Spawns slave processes and initialises inter-communication

Referenced by ParRunControl::runPar().

Here is the caller graph for this function:

static bool parRun (  )  [inline, static]

Is this a parallel run?

Definition at line 270 of file Pstream.H.

Referenced by processorFvPatch::neighbProcNo(), and globalPointPatch::size().

Here is the caller graph for this function:

static label nProcs (  )  [inline, static]

Number of processes in parallel run.

Definition at line 276 of file Pstream.H.

static bool master (  )  [inline, static]

Am I the master process.

Definition at line 282 of file Pstream.H.

static int masterNo (  )  [inline, static]

Process index of the master.

Definition at line 288 of file Pstream.H.

static int myProcNo (  )  [inline, static]

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

Definition at line 294 of file Pstream.H.

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

Process IDs.

Definition at line 300 of file Pstream.H.

static int procID ( int  procNo  )  [inline, static]

Process ID of given process index.

Definition at line 306 of file Pstream.H.

static int firstSlave (  )  [inline, static]

Process index of first slave.

Definition at line 312 of file Pstream.H.

static int lastSlave (  )  [inline, static]

Process index of last slave.

Definition at line 318 of file Pstream.H.

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

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

Definition at line 324 of file Pstream.H.

Referenced by Foam::reduce().

Here is the caller graph for this function:

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

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

Definition at line 330 of file Pstream.H.

static int msgType (  )  [inline, static]

Message tag of standard messages.

Definition at line 336 of file Pstream.H.

static void exit ( int  errnum = 1  )  [static]

Exit program.

static void abort (  )  [static]

Abort program.

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

Gather data. Apply bop to combine Value.

from different processors

Referenced by Foam::reduce().

Here is the caller graph for this function:

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

Like above but switches between linear/tree communication.

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

Scatter data. Distribute without modification. Reverse of gather.

Referenced by Foam::reduce().

Here is the caller graph for this function:

static void scatter ( T &  Value  )  [static]

Like above but switches between linear/tree communication.

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

Referenced by Foam::combineReduce().

Here is the caller graph for this function:

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

Like above but switches between linear/tree communication.

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

Scatter data. Reverse of combineGather.

Referenced by Foam::combineReduce().

Here is the caller graph for this function:

static void combineScatter ( T &  Value  )  [static]

Like above but switches between linear/tree communication.

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

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

Like above but switches between linear/tree communication.

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

Scatter data. Reverse of combineGather.

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

Like above but switches between linear/tree communication.

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

Gather data but keep individual values separate.

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

Like above but switches between linear/tree communication.

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

Scatter data. Reverse of gatherList.

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

Like above but switches between linear/tree communication.


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.

bool scheduledTransfer [static]

Switch for scheduled vs non-scheduled transfer.

Definition at line 238 of file Pstream.H.


The documentation for this class was generated from the following file:
  • src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H
Copyright © 2000-2007 OpenCFD Ltd