escript
Revision_
|
#include <SplitWorld.h>
Public Member Functions | |
SplitWorld (unsigned int numgroups, MPI_Comm global=91) | |
~SplitWorld () | |
boost::python::object | buildDomains (boost::python::tuple t, boost::python::dict kwargs) |
void | runJobs () |
void | addJob (boost::python::object creator, boost::python::tuple tup, boost::python::dict kw) |
void | addJobPerWorld (boost::python::object creator, boost::python::tuple tup, boost::python::dict kw) |
void | addVariable (std::string name, boost::python::object creator, boost::python::tuple ntup, boost::python::dict kwargs) |
void | removeVariable (std::string name) |
void | clearVariable (std::string name) |
std::list< std::pair< std::string, bool > > | getVarList () |
boost::python::object | getVarPyList () |
boost::python::object | getVarPyInfo () |
void | clearAllJobs () |
DataTypes::real_t | getScalarVariable (const std::string &name) |
boost::python::object | getLocalObjectVariable (const std::string &name) |
int | getSubWorldCount () |
int | getSubWorldID () |
void | copyVariable (const std::string &src, const std::string &dest) |
Private Member Functions | |
void | clearPendingJobs () |
void | distributeJobs () |
Private Attributes | |
JMPI | globalcom |
JMPI | leadercom |
escript::SubWorld_ptr | localworld |
unsigned int | swcount |
unsigned int | localid |
std::vector< boost::python::object > | create |
std::vector< boost::python::tuple > | tupargs |
std::vector< boost::python::dict > | kwargs |
unsigned int | jobcounter |
bool | manualimport |
Provides an interface to a collection of subworlds. Variables are declared and jobs are submitted using this interface. Internally, the work is done by a local subworld instance (and associated communicators which this process belongs to). The local subworld will communicate with subworlds in other processes as needed. The main reason for this class, is to insulate users from the MPI type thinking needed for subworlds and instead provide an interface which allows them to think about subworlds as a group.
SplitWorld::SplitWorld | ( | unsigned int | numgroups, |
MPI_Comm | global = 91 |
||
) |
References globalcom, localid, localworld, escript::makeInfo(), manualimport, and swcount.
SplitWorld::~SplitWorld | ( | ) |
void SplitWorld::addJob | ( | boost::python::object | creator, |
boost::python::tuple | tup, | ||
boost::python::dict | kw | ||
) |
stores the constructor/factory to make Jobs and the parameters.
References create, kwargs, and tupargs.
Referenced by escript::raw_addJob().
void SplitWorld::addJobPerWorld | ( | boost::python::object | creator, |
boost::python::tuple | tup, | ||
boost::python::dict | kw | ||
) |
creates exactly one instance of the job on each world. This bypasses the normal job allocation method (since that does not guarantee one job per world)
References escript::checkResult(), clearPendingJobs(), escript::getStringFromPyException(), globalcom, jobcounter, localid, localworld, escript::shipString(), and swcount.
Referenced by escript::raw_addJobPerWorld().
void SplitWorld::addVariable | ( | std::string | name, |
boost::python::object | creator, | ||
boost::python::tuple | ntup, | ||
boost::python::dict | kwargs | ||
) |
References localworld.
Referenced by escript::raw_addVariable().
object SplitWorld::buildDomains | ( | boost::python::tuple | t, |
boost::python::dict | kwargs | ||
) |
References localworld.
Referenced by escript::raw_buildDomains().
void SplitWorld::clearAllJobs | ( | ) |
References clearPendingJobs(), and localworld.
Referenced by runJobs().
|
private |
References create, kwargs, and tupargs.
Referenced by addJobPerWorld(), clearAllJobs(), and distributeJobs().
void SplitWorld::clearVariable | ( | std::string | name | ) |
References localworld.
Referenced by BOOST_PYTHON_MODULE().
void SplitWorld::copyVariable | ( | const std::string & | src, |
const std::string & | dest | ||
) |
References localworld, and manualimport.
Referenced by BOOST_PYTHON_MODULE().
|
private |
References escript::checkResult(), clearPendingJobs(), create, escript::getStringFromPyException(), globalcom, jobcounter, kwargs, localid, localworld, escript::shipString(), swcount, and tupargs.
Referenced by runJobs().
boost::python::object SplitWorld::getLocalObjectVariable | ( | const std::string & | name | ) |
Referenced by BOOST_PYTHON_MODULE().
DataTypes::real_t SplitWorld::getScalarVariable | ( | const std::string & | name | ) |
Referenced by BOOST_PYTHON_MODULE().
int SplitWorld::getSubWorldCount | ( | ) |
References swcount.
Referenced by BOOST_PYTHON_MODULE().
int SplitWorld::getSubWorldID | ( | ) |
References localid.
Referenced by BOOST_PYTHON_MODULE().
std::list< std::pair< std::string, bool > > SplitWorld::getVarList | ( | ) |
References localworld.
boost::python::object SplitWorld::getVarPyInfo | ( | ) |
References localworld.
Referenced by BOOST_PYTHON_MODULE().
boost::python::object SplitWorld::getVarPyList | ( | ) |
References localworld.
Referenced by BOOST_PYTHON_MODULE().
void SplitWorld::removeVariable | ( | std::string | name | ) |
References localworld.
Referenced by BOOST_PYTHON_MODULE().
void SplitWorld::runJobs | ( | ) |
References escript::checkResult(), clearAllJobs(), distributeJobs(), globalcom, localworld, and escript::shipString().
Referenced by BOOST_PYTHON_MODULE().
|
private |
Referenced by addJob(), clearPendingJobs(), and distributeJobs().
|
private |
Referenced by addJobPerWorld(), distributeJobs(), runJobs(), and SplitWorld().
|
private |
Referenced by addJobPerWorld(), and distributeJobs().
|
private |
Referenced by addJob(), clearPendingJobs(), and distributeJobs().
|
private |
|
private |
Referenced by addJobPerWorld(), distributeJobs(), getSubWorldID(), and SplitWorld().
|
private |
|
private |
Referenced by copyVariable(), and SplitWorld().
|
private |
Referenced by addJobPerWorld(), distributeJobs(), getSubWorldCount(), and SplitWorld().
|
private |
Referenced by addJob(), clearPendingJobs(), and distributeJobs().