escript  Revision_Unversioneddirectory
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
escript::SubWorld Class Reference

#include <SubWorld.h>

Inheritance diagram for escript::SubWorld:

Public Member Functions

 SubWorld (esysUtils::JMPI &globalcom, esysUtils::JMPI &comm, esysUtils::JMPI &corr, unsigned int subworldcount, unsigned int local_id, bool manualimport)
 
 ~SubWorld ()
 
void setDomain (Domain_ptr d)
 
Domain_ptr getDomain ()
 
esysUtils::JMPIgetMPI ()
 
esysUtils::JMPIgetCorrMPI ()
 
void addJob (boost::python::object j)
 
char runJobs (std::string &errmsg)
 
void clearJobs ()
 
void addVariable (std::string &, Reducer_ptr &red)
 
void removeVariable (std::string &name)
 
void clearVariable (std::string &name)
 
std::list< std::pair< std::string, bool > > getVarList ()
 
std::list< std::pair< std::string, std::string > > getVarInfo ()
 
size_t getNumVars ()
 
bool localTransport (std::string &errmsg)
 
bool checkRemoteCompatibility (std::string &errmsg)
 
bool deliverImports (std::string &errmsg)
 
bool amLeader ()
 
double getScalarVariable (const std::string &name)
 
boost::python::object getLocalObjectVariable (const std::string &name)
 
void debug ()
 
bool synchVariableInfo (std::string &err)
 
bool synchVariableValues (std::string &err)
 
void resetInterest ()
 
void copyVariable (const std::string &src, const std::string &dest)
 
void newRunJobs ()
 

Private Types

typedef std::map< std::string, Reducer_ptrstr2reduce
 
typedef std::map< std::string, unsigned char > str2char
 

Private Member Functions

void setMyVarState (const std::string &vname, char state)
 
void setVarState (const std::string &vname, char state, int swid)
 
void setAllVarsState (const std::string &name, char state)
 

Private Attributes

esysUtils::JMPI everyone
 
esysUtils::JMPI swmpi
 
esysUtils::JMPI corrmpi
 
escript::Domain_ptr domain
 
std::vector< boost::python::object > jobvec
 
unsigned int swcount
 
unsigned int localid
 
str2reduce reducemap
 
str2char varstate
 
bool manualimports
 

Detailed Description

This class represents a collection of MPI processes which will execute a number of Jobs (in series). There could be a number of SubWorlds (executing jobs in parallel) in the overall system. All jobs running in a SubWorld will use a common domain object. After each job runs, any values it exports will be merged into local reducer objects. Global (ie with the participation of other SubWorlds) reductions and interworld transfers are handled after the current batch of jobs have completed. That is, variable values should not be considered up to date until the whole batch is complete. Further, after a batch has completed, multiple subworlds may have copies of the variable, if the variable is modified in a later batch, this may result in unwanted double counting. eg: v (reduce:+) Batch 1: world 1: v+=1,2,3 — local v=6 world 2: v+=1,2 — local v=3 What is the value of v in this split world? v=9

Batch 2: world 1: v+=1 — local v=1+9 world 2: v+=1 — local v=1+9 What is the value of v? 20, not 11

Member Typedef Documentation

typedef std::map<std::string, unsigned char> escript::SubWorld::str2char
private
typedef std::map<std::string, Reducer_ptr> escript::SubWorld::str2reduce
private

Constructor & Destructor Documentation

SubWorld::SubWorld ( esysUtils::JMPI globalcom,
esysUtils::JMPI comm,
esysUtils::JMPI corr,
unsigned int  subworldcount,
unsigned int  local_id,
bool  manualimport 
)

References swcount.

SubWorld::~SubWorld ( )

Member Function Documentation

void SubWorld::addJob ( boost::python::object  j)

References jobvec.

void SubWorld::addVariable ( std::string &  name,
Reducer_ptr red 
)
bool SubWorld::amLeader ( )

References swmpi.

Referenced by synchVariableInfo().

bool SubWorld::checkRemoteCompatibility ( std::string &  errmsg)
void SubWorld::clearJobs ( )

References jobvec.

void SubWorld::clearVariable ( std::string &  name)
void SubWorld::copyVariable ( const std::string &  src,
const std::string &  dest 
)

References reducemap.

void SubWorld::debug ( )
bool SubWorld::deliverImports ( std::string &  errmsg)
JMPI & SubWorld::getCorrMPI ( )

References corrmpi.

Referenced by synchVariableInfo().

Domain_ptr SubWorld::getDomain ( )

References domain.

boost::python::object SubWorld::getLocalObjectVariable ( const std::string &  name)
JMPI & SubWorld::getMPI ( )

References swmpi.

size_t SubWorld::getNumVars ( )
double SubWorld::getScalarVariable ( const std::string &  name)
std::list< std::pair< std::string, std::string > > SubWorld::getVarInfo ( )

References reducemap.

std::list< std::pair< std::string, bool > > SubWorld::getVarList ( )

References reducemap.

bool SubWorld::localTransport ( std::string &  errmsg)
void SubWorld::newRunJobs ( )

References reducemap.

void SubWorld::removeVariable ( std::string &  name)

References reducemap, and varstate.

void SubWorld::resetInterest ( )
char SubWorld::runJobs ( std::string &  errmsg)
void SubWorld::setAllVarsState ( const std::string &  name,
char  state 
)
private
void SubWorld::setDomain ( Domain_ptr  d)

References domain.

void SubWorld::setMyVarState ( const std::string &  vname,
char  state 
)
private
void SubWorld::setVarState ( const std::string &  vname,
char  state,
int  swid 
)
private

References getNumVars(), localid, and varstate.

Referenced by setMyVarState().

bool SubWorld::synchVariableInfo ( std::string &  err)
bool SubWorld::synchVariableValues ( std::string &  err)

Member Data Documentation

esysUtils::JMPI escript::SubWorld::corrmpi
private
escript::Domain_ptr escript::SubWorld::domain
private

Referenced by addVariable(), getDomain(), and setDomain().

esysUtils::JMPI escript::SubWorld::everyone
private

Referenced by synchVariableInfo().

std::vector<boost::python::object> escript::SubWorld::jobvec
private
unsigned int escript::SubWorld::localid
private
bool escript::SubWorld::manualimports
private
str2reduce escript::SubWorld::reducemap
private
unsigned int escript::SubWorld::swcount
private
esysUtils::JMPI escript::SubWorld::swmpi
private

Referenced by amLeader(), and getMPI().

str2char escript::SubWorld::varstate
private

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