escript
Revision_
|
#include <SubWorld.h>
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 () |
JMPI & | getMPI () |
JMPI & | getCorrMPI () |
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_ptr > | str2reduce |
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 |
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
|
private |
|
private |
SubWorld::SubWorld | ( | JMPI & | globalcom, |
JMPI & | comm, | ||
JMPI & | corr, | ||
unsigned int | subworldcount, | ||
unsigned int | local_id, | ||
bool | manualimport | ||
) |
References swcount.
SubWorld::~SubWorld | ( | ) |
void SubWorld::addJob | ( | boost::python::object | j | ) |
References jobvec.
void SubWorld::addVariable | ( | std::string & | name, |
Reducer_ptr & | red | ||
) |
References domain, jobvec, manualimports, escript::reducerstatus::NONE, reducemap, and varstate.
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 | ) |
References escript::reducerstatus::NONE, reducemap, and setAllVarsState().
void SubWorld::copyVariable | ( | const std::string & | src, |
const std::string & | dest | ||
) |
References reducemap.
void SubWorld::debug | ( | ) |
bool SubWorld::deliverImports | ( | std::string & | errmsg | ) |
References escript::getStringFromPyException(), jobvec, manualimports, and reducemap.
JMPI & SubWorld::getCorrMPI | ( | ) |
References corrmpi.
Referenced by synchVariableInfo().
Domain_ptr SubWorld::getDomain | ( | ) |
References domain.
bp::object SubWorld::getLocalObjectVariable | ( | const std::string & | name | ) |
size_t SubWorld::getNumVars | ( | ) |
References reducemap.
Referenced by checkRemoteCompatibility(), debug(), setAllVarsState(), setVarState(), and synchVariableInfo().
DataTypes::real_t 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 | ) |
References jobvec, escript::reducerstatus::NEW, reducemap, and setMyVarState().
void SubWorld::newRunJobs | ( | ) |
References reducemap.
void SubWorld::resetInterest | ( | ) |
char SubWorld::runJobs | ( | std::string & | errmsg | ) |
References escript::getStringFromPyException(), and jobvec.
|
private |
References getNumVars(), escript::reducerstatus::NEW, escript::reducerstatus::NONE, swcount, and varstate.
Referenced by clearVariable(), and synchVariableValues().
void SubWorld::setDomain | ( | Domain_ptr | d | ) |
References domain.
|
private |
References localid, and setVarState().
Referenced by getLocalObjectVariable(), getScalarVariable(), localTransport(), and synchVariableValues().
|
private |
References getNumVars(), localid, and varstate.
Referenced by setMyVarState().
bool SubWorld::synchVariableInfo | ( | std::string & | err | ) |
References amLeader(), ERROR, everyone, getCorrMPI(), getNumVars(), escript::reducerstatus::INTERESTED, jobvec, manualimports, escript::reducerstatus::NEW, escript::reducerstatus::NONE, escript::reducerstatus::OLD, escript::reducerstatus::OLDINTERESTED, reducemap, swcount, and varstate.
Referenced by getLocalObjectVariable(), and getScalarVariable().
bool SubWorld::synchVariableValues | ( | std::string & | err | ) |
References corrmpi, escript::reducerstatus::INTERESTED, MPI_MAX, escript::reducerstatus::NEW, escript::reducerstatus::NONE, escript::reducerstatus::OLD, escript::reducerstatus::OLDINTERESTED, reducemap, setAllVarsState(), setMyVarState(), swcount, and varstate.
Referenced by getLocalObjectVariable(), and getScalarVariable().
|
private |
Referenced by checkRemoteCompatibility(), getCorrMPI(), and synchVariableValues().
|
private |
Referenced by addVariable(), getDomain(), and setDomain().
|
private |
Referenced by synchVariableInfo().
|
private |
Referenced by addJob(), addVariable(), clearJobs(), deliverImports(), localTransport(), runJobs(), and synchVariableInfo().
|
private |
Referenced by checkRemoteCompatibility(), setMyVarState(), and setVarState().
|
private |
Referenced by addVariable(), deliverImports(), and synchVariableInfo().
|
private |
Referenced by addVariable(), checkRemoteCompatibility(), clearVariable(), copyVariable(), debug(), deliverImports(), getLocalObjectVariable(), getNumVars(), getScalarVariable(), getVarInfo(), getVarList(), localTransport(), newRunJobs(), removeVariable(), synchVariableInfo(), and synchVariableValues().
|
private |
Referenced by setAllVarsState(), SubWorld(), synchVariableInfo(), and synchVariableValues().
|
private |
Referenced by amLeader(), and getMPI().
|
private |