The Original CHomP Software
|
This namespace contains an interface to the MultiWork module which allows one to easily distribute a computational task over multiple processes and run concurrent computations. More...
Classes | |
class | mwBoxes |
This is a helper class for iterating all the boxes which share a given vertex. More... | |
class | mwCoordinator |
This class defines a generic coordinator task object for the multi-work distributed computations framework. More... | |
class | mwCorners |
This is a helper class for iterating all the corners of a given box. More... | |
class | mwData |
This class is used to convert data structures into a single sequence of bytes and to retrieve this data for the purpose of communication between a coordinator and workers. More... | |
class | mwIniProbes |
This is a helper class for producing an initial set of probes to test the interior of the requested area of parameters. More... | |
class | mwSubCoordinator |
This class defines a coordinator for the multi-work subdivision framework. More... | |
class | mwSubDataPack |
This is a helper class which defines a single data pack used in the communication between coordinator and workers in the multi-work subdivision framework. More... | |
class | mwSubWorker |
This class defines a worker for the multi-work subdivision framework. More... | |
class | mwTask |
This class defines a generic task object (coordinator or worker) for the multi-work distributed computations framework. More... | |
class | mwWorker |
This class defines a generic worker task object for the multi-work distributed computations framework. More... | |
class | mwWorkerData |
A helper class for storing data on a single worker. More... | |
Typedefs | |
typedef int(* | fcompute) (const double *left, const double *right, int dim, int level) |
The type of a function which computes a value of interest for the given product of intervals. More... | |
Enumerations | |
enum | mwConstants { mwOk = 0 , mwError = -1 , mwNoData = -2 , mwReject = -3 } |
Various error codes used during the communication. More... | |
enum | mwIOconstants { mwNone = 0 , mwCanRead = 0x01 , mwCanWrite = 0x02 , mwTimeOut = -4 , mwLost = -5 } |
Input/output flags and error codes used for network communication, mainly for the 'select' function to check which sockets are available for reading/writing. More... | |
enum | mwCodes { mwNoMsg = 0x0000 , mwInitMsg = 0x0001 , mwStdMsg = 0x0002 , mwKeepMsg = 0x0004 , mwDontKeepMsg = 0x0008 , mwByeMsg = 0x0010 , mwRejectedMsg = 0x0001 , mwPortMsg = 0x0002 } |
Various message codes used for the communication between the coordinator and workers. More... | |
Functions | |
void | swap (mwWorkerData &data1, mwWorkerData &data2) |
void | swap (mwData &x, mwData &y) |
template<class type > | |
mwData & | operator<< (mwData &m, const type &x) |
template<class type > | |
mwData & | operator>> (mwData &m, type &x) |
mwData & | operator<< (mwData &m, const char *x) |
mwData & | operator<< (mwData &m, const unsigned char *x) |
mwData & | operator>> (mwData &m, char *x) |
mwData & | operator>> (mwData &m, unsigned char *x) |
int | mwSendBytes (int fd, const char *buf, int len) |
Sends the given buffer to the given socket. More... | |
int | mwRecvBytes (int fd, char *buf, int len) |
Receives the given amount of data from the given socket. More... | |
int | mwConnect (const char *name, int port) |
Connects to the given computer at the given port. More... | |
int | mwListen (int port, int queuesize) |
Begins listening at the given port. More... | |
int | mwAccept (int fd, std::string &computer, int timeout=-1) |
Waits for and accepts a connection at the given socket. More... | |
int | mwSelect (const int *workers, int nworkers, int listensocket, int *ioflags, int timeout) |
Determines IOflags for each of the workers and additionally the listensocket (the last flag). More... | |
void | mwDisconnect (int fd) |
Disconnects the given socket. More... | |
template<class coord > | |
double | mwSubdivPoint (const double &left, const double &right, coord part, coord full) |
Returns a subdivision point corresponding to the given fraction of the provided interval. More... | |
template<int dim, class coord > | |
int | mwSubdivMain (int argc, char *argv[], const char *title, const char *helpinfo, int defaultPortNumber, int controlNumber, const double *paramLeft, const double *paramRight, int minSubdivLevel, fcompute compute) |
The main procedure for running the computations in the multiwork subdivision framework. More... | |
This namespace contains an interface to the MultiWork module which allows one to easily distribute a computational task over multiple processes and run concurrent computations.
typedef int(* chomp::multiwork::fcompute) (const double *left, const double *right, int dim, int level) |
The type of a function which computes a value of interest for the given product of intervals.
The subdivision level is provided in case the computations on higher levels need to be done in a more thorough way.
Definition at line 102 of file mwsubdiv.h.
Various message codes used for the communication between the coordinator and workers.
Definition at line 56 of file mwtask.h.
Various error codes used during the communication.
The OK code must equal zero, and error codes must be negative.
Definition at line 156 of file mwconfig.h.
Input/output flags and error codes used for network communication, mainly for the 'select' function to check which sockets are available for reading/writing.
Enumerator | |
---|---|
mwNone | No flag selected. |
mwCanRead | Reading possible. |
mwCanWrite | Writing possible. |
mwTimeOut | A connection time out has occurred. |
mwLost | The network connection has been lost. |
Definition at line 51 of file mwlowlev.h.
int chomp::multiwork::mwAccept | ( | int | fd, |
std::string & | computer, | ||
int | timeout = -1 |
||
) |
Waits for and accepts a connection at the given socket.
Saves the computer name in the string provided. Returns the new socket number (non-negative), mwTimeOut or mwError.
Referenced by chomp::multiwork::mwCoordinator::RunLoop(), and chomp::multiwork::mwWorker::Work().
int chomp::multiwork::mwConnect | ( | const char * | name, |
int | port | ||
) |
Connects to the given computer at the given port.
Returns the socket number (non-negative) or mwError.
Referenced by chomp::multiwork::mwCoordinator::ConnectWorkers(), chomp::multiwork::mwTask::QuitWorkers(), and chomp::multiwork::mwWorker::Work().
void chomp::multiwork::mwDisconnect | ( | int | fd | ) |
Disconnects the given socket.
If the number is negative, then this function call is ignored.
Referenced by chomp::multiwork::mwCoordinator::DisconnectAll(), chomp::multiwork::mwTask::QuitWorkers(), chomp::multiwork::mwCoordinator::RunLoop(), and chomp::multiwork::mwWorker::Work().
int chomp::multiwork::mwListen | ( | int | port, |
int | queuesize | ||
) |
Begins listening at the given port.
Allows for the given queue length. Returns the socket number (non-negative) or mwError.
Referenced by chomp::multiwork::mwCoordinator::BeginListening(), and chomp::multiwork::mwWorker::Work().
int chomp::multiwork::mwRecvBytes | ( | int | fd, |
char * | buf, | ||
int | len | ||
) |
Receives the given amount of data from the given socket.
Returns mwOk, mwError or mwLost.
Referenced by chomp::multiwork::mwTask::RecvMessage().
int chomp::multiwork::mwSelect | ( | const int * | workers, |
int | nworkers, | ||
int | listensocket, | ||
int * | ioflags, | ||
int | timeout | ||
) |
Determines IOflags for each of the workers and additionally the listensocket (the last flag).
The IOflags of interest are initially set. Returns mwOk, mwTimeOut or mwError.
Referenced by chomp::multiwork::mwCoordinator::RunLoop(), and chomp::multiwork::mwWorker::WorkOne().
int chomp::multiwork::mwSendBytes | ( | int | fd, |
const char * | buf, | ||
int | len | ||
) |
Sends the given buffer to the given socket.
Returns mwOk, mwError or mwLost.
Referenced by chomp::multiwork::mwTask::SendMessage().
int chomp::multiwork::mwSubdivMain | ( | int | argc, |
char * | argv[], | ||
const char * | title, | ||
const char * | helpinfo, | ||
int | defaultPortNumber, | ||
int | controlNumber, | ||
const double * | paramLeft, | ||
const double * | paramRight, | ||
int | minSubdivLevel, | ||
fcompute | compute | ||
) |
The main procedure for running the computations in the multiwork subdivision framework.
Returns: 0 = Ok, -1 = Error, 1 = Help displayed, 2 = Wrong arguments.
Definition at line 1464 of file mwsubdiv.h.
References chomp::homology::arg(), chomp::homology::arghelp(), argstreamprepare, argstreamset, chomp::homology::argswitch(), mwOk, chomp::homology::program_time, and chomp::homology::sout.
|
inline |
Returns a subdivision point corresponding to the given fraction of the provided interval.
Should be called with part = 0, ..., full, to get a subdivision of the entire interval, including the endpoints.
Definition at line 202 of file mwsubdiv.h.
Referenced by chomp::multiwork::mwSubCoordinator< dim, coord >::Prepare().
|
inline |
Definition at line 108 of file mwcoord.h.
Referenced by chomp::multiwork::mwCoordinator::RunLoop(), chomp::homology::diGraph< wType >::swap(), chomp::homology::hashedset< element, hashkeys >::swap(), chomp::homology::multitable< element >::swap(), chomp::homology::mvmap< domelement, imgelement >::swap(), chomp::homology::tPointset< coordtype >::swap(), chomp::homology::mmatrix< euclidom >::swapcols(), chomp::homology::chain< euclidom >::swapnumbers(), and chomp::homology::mmatrix< euclidom >::swaprows().