escript  Revision_
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 (JMPI &globalcom, JMPI &comm, JMPI &corr, unsigned int subworldcount, unsigned int local_id, bool manualimport)
 
 ~SubWorld ()
 
void setDomain (Domain_ptr d)
 
Domain_ptr getDomain ()
 
JMPIgetMPI ()
 
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 ()
 
DataTypes::real_t 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

JMPI everyone
 
JMPI swmpi
 
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

◆ str2char

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

◆ str2reduce

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

Constructor & Destructor Documentation

◆ SubWorld()

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

References swcount.

◆ ~SubWorld()

SubWorld::~SubWorld ( )

Member Function Documentation

◆ addJob()

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

References jobvec.

◆ addVariable()

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

◆ amLeader()

bool SubWorld::amLeader ( )

References swmpi.

Referenced by synchVariableInfo().

◆ checkRemoteCompatibility()

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

◆ clearJobs()

void SubWorld::clearJobs ( )

References jobvec.

◆ clearVariable()

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

◆ copyVariable()

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

References reducemap.

◆ debug()

void SubWorld::debug ( )

◆ deliverImports()

bool SubWorld::deliverImports ( std::string &  errmsg)

◆ getCorrMPI()

JMPI & SubWorld::getCorrMPI ( )

References corrmpi.

Referenced by synchVariableInfo().

◆ getDomain()

Domain_ptr SubWorld::getDomain ( )

References domain.

◆ getLocalObjectVariable()

bp::object SubWorld::getLocalObjectVariable ( const std::string &  name)

◆ getMPI()

JMPI & SubWorld::getMPI ( )

References swmpi.

◆ getNumVars()

size_t SubWorld::getNumVars ( )

◆ getScalarVariable()

DataTypes::real_t SubWorld::getScalarVariable ( const std::string &  name)

◆ getVarInfo()

std::list< std::pair< std::string, std::string > > SubWorld::getVarInfo ( )

References reducemap.

◆ getVarList()

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

References reducemap.

◆ localTransport()

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

◆ newRunJobs()

void SubWorld::newRunJobs ( )

References reducemap.

◆ removeVariable()

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

References reducemap, and varstate.

◆ resetInterest()

void SubWorld::resetInterest ( )

◆ runJobs()

char SubWorld::runJobs ( std::string &  errmsg)

◆ setAllVarsState()

void SubWorld::setAllVarsState ( const std::string &  name,
char  state 
)
private

◆ setDomain()

void SubWorld::setDomain ( Domain_ptr  d)

References domain.

◆ setMyVarState()

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

◆ setVarState()

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

References getNumVars(), localid, and varstate.

Referenced by setMyVarState().

◆ synchVariableInfo()

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

◆ synchVariableValues()

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

Member Data Documentation

◆ corrmpi

JMPI escript::SubWorld::corrmpi
private

◆ domain

escript::Domain_ptr escript::SubWorld::domain
private

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

◆ everyone

JMPI escript::SubWorld::everyone
private

Referenced by synchVariableInfo().

◆ jobvec

std::vector<boost::python::object> escript::SubWorld::jobvec
private

◆ localid

unsigned int escript::SubWorld::localid
private

◆ manualimports

bool escript::SubWorld::manualimports
private

◆ reducemap

str2reduce escript::SubWorld::reducemap
private

◆ swcount

unsigned int escript::SubWorld::swcount
private

◆ swmpi

JMPI escript::SubWorld::swmpi
private

Referenced by amLeader(), and getMPI().

◆ varstate

str2char escript::SubWorld::varstate
private

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