escript  Revision_
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=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
 

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::SplitWorld ( unsigned int  numgroups,
MPI_Comm  global = 91 
)

◆ ~SplitWorld()

SplitWorld::~SplitWorld ( )

Member Function Documentation

◆ addJob()

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

◆ addJobPerWorld()

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

◆ addVariable()

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

◆ buildDomains()

object SplitWorld::buildDomains ( boost::python::tuple  t,
boost::python::dict  kwargs 
)

References localworld.

Referenced by escript::raw_buildDomains().

◆ clearAllJobs()

void SplitWorld::clearAllJobs ( )

References clearPendingJobs(), and localworld.

Referenced by runJobs().

◆ clearPendingJobs()

void SplitWorld::clearPendingJobs ( )
private

References create, kwargs, and tupargs.

Referenced by addJobPerWorld(), clearAllJobs(), and distributeJobs().

◆ clearVariable()

void SplitWorld::clearVariable ( std::string  name)

References localworld.

Referenced by BOOST_PYTHON_MODULE().

◆ copyVariable()

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

References localworld, and manualimport.

Referenced by BOOST_PYTHON_MODULE().

◆ distributeJobs()

void SplitWorld::distributeJobs ( )
private

◆ getLocalObjectVariable()

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

Referenced by BOOST_PYTHON_MODULE().

◆ getScalarVariable()

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

Referenced by BOOST_PYTHON_MODULE().

◆ getSubWorldCount()

int SplitWorld::getSubWorldCount ( )

References swcount.

Referenced by BOOST_PYTHON_MODULE().

◆ getSubWorldID()

int SplitWorld::getSubWorldID ( )

References localid.

Referenced by BOOST_PYTHON_MODULE().

◆ getVarList()

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

References localworld.

◆ getVarPyInfo()

boost::python::object SplitWorld::getVarPyInfo ( )

References localworld.

Referenced by BOOST_PYTHON_MODULE().

◆ getVarPyList()

boost::python::object SplitWorld::getVarPyList ( )

References localworld.

Referenced by BOOST_PYTHON_MODULE().

◆ removeVariable()

void SplitWorld::removeVariable ( std::string  name)

References localworld.

Referenced by BOOST_PYTHON_MODULE().

◆ runJobs()

void SplitWorld::runJobs ( )

Member Data Documentation

◆ create

std::vector<boost::python::object> escript::SplitWorld::create
private

◆ globalcom

JMPI escript::SplitWorld::globalcom
private

◆ jobcounter

unsigned int escript::SplitWorld::jobcounter
private

Referenced by addJobPerWorld(), and distributeJobs().

◆ kwargs

std::vector<boost::python::dict> escript::SplitWorld::kwargs
private

◆ leadercom

JMPI escript::SplitWorld::leadercom
private

◆ localid

unsigned int escript::SplitWorld::localid
private

◆ localworld

escript::SubWorld_ptr escript::SplitWorld::localworld
private

◆ manualimport

bool escript::SplitWorld::manualimport
private

Referenced by copyVariable(), and SplitWorld().

◆ swcount

unsigned int escript::SplitWorld::swcount
private

◆ tupargs

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

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