FreeFOAM The Cross-Platform CFD Toolkit
PstreamImpl Class Reference

Abstract base class for Pstream operations that depend on the parallel library used. Foam::PstreamImpl::New will lookup the entry "PstreamImplementation" in the global controlDict file (i.e. the one found by Foam::dotFoam) and tries to first load a library named lib<PstreamImplementation>Pstream.so, and then instantiate the class <PstreamImplementation>PstreamImpl. More...

#include <OpenFOAM/PstreamImpl.H>


Detailed Description

Abstract base class for Pstream operations that depend on the parallel library used. Foam::PstreamImpl::New will lookup the entry "PstreamImplementation" in the global controlDict file (i.e. the one found by Foam::dotFoam) and tries to first load a library named lib<PstreamImplementation>Pstream.so, and then instantiate the class <PstreamImplementation>PstreamImpl.

Source files

Definition at line 80 of file PstreamImpl.H.

+ Inheritance diagram for PstreamImpl:
+ Collaboration diagram for PstreamImpl:

List of all members.

Public Member Functions

 TypeName ("PstreamImpl")
 declareRunTimeSelectionTable (autoPtr, PstreamImpl, dictionary,(),())
 PstreamImpl ()
 Construct null.
virtual ~PstreamImpl ()
virtual void addValidParOptions (HashTable< string > &validParOptions)=0
 Add the valid option this type of communications library.
virtual bool init (int &argc, char **&argv, int &myProcNo, List< int > &procIDs, bool &isParallel)=0
 Initialisation function called from main.
virtual void exit (int errnum)=0
 Exit program.
virtual void abort ()=0
 Abort program.
virtual void reduce (scalar &Value, const sumOp< scalar > &bop)=0
 Reduce implementation for scalars (.

Static Public Member Functions

static autoPtr< PstreamImplNew ()
 Return a reference to the selected PstreamImpl implementation.
static void loadPstreamLibrary ()
 Loads the Pstream implementation library.
template<class T , class CTable >
static autoPtr< TloadPstreamInstance (const word &dictEntry, const word &envName, CTable *ctable)
 Loads the given type from the Pstream implementation library.

Static Protected Member Functions

static void setParRun (bool &isParallel)
 Set data for parallel running.
static void initCommunicationSchedule ()
 Initialize all communication schedules. Callback from.

Friends

class Pstream

Additional Inherited Members

- Public Types inherited from PstreamBase
enum  commsTypes { blocking, scheduled, nonBlocking }
 Types of communications. More...

Constructor & Destructor Documentation

PstreamImpl ( )
inline

Construct null.

Definition at line 129 of file PstreamImpl.H.

virtual ~PstreamImpl ( )
inlinevirtual

Definition at line 133 of file PstreamImpl.H.


Member Function Documentation

void setParRun ( bool &  isParallel)
staticprotected

Set data for parallel running.

Definition at line 50 of file PstreamImpl.C.

References Pstream::myProcNo(), Foam::name(), Foam::Perr, Foam::Pout, and prefixOSstream::prefix().

void initCommunicationSchedule ( )
staticprotected

Initialize all communication schedules. Callback from.

PstreamImpl::init()

Definition at line 59 of file PstreamImpl.C.

Referenced by mpiPstreamImpl::init().

TypeName ( "PstreamImpl"  )
declareRunTimeSelectionTable ( autoPtr  ,
PstreamImpl  ,
dictionary  ,
()  ,
()   
)
Foam::autoPtr< Foam::PstreamImpl > New ( )
static

Return a reference to the selected PstreamImpl implementation.

Definition at line 90 of file PstreamImpl.C.

virtual void addValidParOptions ( HashTable< string > &  validParOptions)
pure virtual

Add the valid option this type of communications library.

adds/requires on the command line

Implemented in dummyPstreamImpl, and mpiPstreamImpl.

Referenced by Pstream::addValidParOptions().

virtual bool init ( int &  argc,
char **&  argv,
int &  myProcNo,
List< int > &  procIDs,
bool &  isParallel 
)
pure virtual

Initialisation function called from main.

Spawns slave processes and initialises inter-communication

Implemented in dummyPstreamImpl, and mpiPstreamImpl.

Referenced by Pstream::init().

virtual void exit ( int  errnum)
pure virtual

Exit program.

Implemented in dummyPstreamImpl, and mpiPstreamImpl.

Referenced by Pstream::exit(), and PstreamImpl::loadPstreamInstance().

virtual void abort ( )
pure virtual

Abort program.

Implemented in dummyPstreamImpl, and mpiPstreamImpl.

Referenced by Pstream::abort().

virtual void reduce ( scalar &  Value,
const sumOp< scalar > &  bop 
)
pure virtual

Reduce implementation for scalars (.

See also:
PstreamReduceOps.H)

Implemented in dummyPstreamImpl, and mpiPstreamImpl.

autoPtr< T > loadPstreamInstance ( const word dictEntry,
const word envName,
CTable *  ctable 
)
static

Friends And Related Function Documentation

friend class Pstream
friend

Definition at line 174 of file PstreamImpl.H.


The documentation for this class was generated from the following files: