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

#include <SplitWorld.h>

Public Member Functions

 SplitWorld (unsigned int numgroups, MPI_Comm global=MPI_COMM_WORLD)
 
 ~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 ()
 
double 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

esysUtils::JMPI globalcom
 
esysUtils::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
 

Detailed Description

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.

Constructor & Destructor Documentation

SplitWorld::SplitWorld ( unsigned int  numgroups,
MPI_Comm  global = MPI_COMM_WORLD 
)
SplitWorld::~SplitWorld ( )

Member Function Documentation

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 esysUtils::checkResult(), clearPendingJobs(), getStringFromPyException(), globalcom, jobcounter, localid, localworld, esysUtils::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().

void SplitWorld::clearPendingJobs ( )
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().

void SplitWorld::distributeJobs ( )
private
boost::python::object SplitWorld::getLocalObjectVariable ( const std::string &  name)

Referenced by BOOST_PYTHON_MODULE().

double 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 ( )

Member Data Documentation

std::vector<boost::python::object> escript::SplitWorld::create
private
esysUtils::JMPI escript::SplitWorld::globalcom
private
unsigned int escript::SplitWorld::jobcounter
private

Referenced by addJobPerWorld(), and distributeJobs().

std::vector<boost::python::dict> escript::SplitWorld::kwargs
private
esysUtils::JMPI escript::SplitWorld::leadercom
private
unsigned int escript::SplitWorld::localid
private
escript::SubWorld_ptr escript::SplitWorld::localworld
private
bool escript::SplitWorld::manualimport
private

Referenced by copyVariable(), and SplitWorld().

unsigned int escript::SplitWorld::swcount
private
std::vector<boost::python::tuple> escript::SplitWorld::tupargs
private

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