class MWIndRC : public MWRMComm

This class is an derived from the Resource Management (RM) and Communication (Comm) layer

Inheritance:


Public Methods

MWIndRC()
Constructor
~MWIndRC()
Destructor...

Public

A. Resource Management Functions
void exit( int exitval )
System shutdown
int setup( int argc, char* argv[], int *my_id, int *master_id)
Initialization of the master process
int config( int *nhosts, int *narches, MWWorkerID ***w )
What is there to configure? Nothing
int start_worker( MWWorkerID *w )
Just init the workerID to a worker
int init_beginning_workers( int *nworkers, MWWorkerID ***workers )
This routine is used to start up multiple workers at the beginning of a run
int removeWorker( MWWorkerID *w )
Remove a worker from the virtual machine
B. Checkpointing Functions
int read_RMstate( FILE *fp )
Do nothing
The Communication Routines
int initsend( int encoding = 0 )
Initialize a buffer for sending some data
int send( int to_whom, int msgtag )
Send the data that has been packed
int recv( int from_whom, int msgtag )
Receive some data that has been packed
int bufinfo( int buf_id, int *len, int *tag, int *from )
Provide info on the message just received
Pack Functions
int pack( char *bytes, int nitem, int stride = 1 )
Pack some bytes
int pack( float *f, int nitem, int stride = 1 )
float
int pack( double *d, int nitem, int stride = 1 )
double
int pack( int *i, int nitem, int stride = 1 )
int
int pack( unsigned int *ui, int nitem, int stride = 1 )
unsigned int
int pack( short *sh, int nitem, int stride = 1 )
short
int pack( unsigned short *ush, int nitem, int stride = 1 )
unsigned short
int pack( long *l, int nitem, int stride = 1 )
long
int pack( unsigned long *ul, int nitem, int stride = 1 )
unsigned long
int pack( char *string )
Pack a NULL-terminated string
Unpack Functions
int unpack( char *bytes, int nitem, int stride = 1 )
Unpack some bytes
int unpack( float *f, int nitem, int stride = 1 )
float
int unpack( double *d, int nitem, int stride = 1 )
double
int unpack( int *i, int nitem, int stride = 1 )
int
int unpack( unsigned int *ui, int nitem, int stride = 1 )
unsigned int
int unpack( short *sh, int nitem, int stride = 1 )
short
int unpack( unsigned short *ush, int nitem, int stride = 1 )
unsigned short
int unpack( long *l, int nitem, int stride = 1 )
long
int unpack( unsigned long *ul, int nitem, int stride = 1 )
unsigned long
int unpack( char *string )
Unpack a NULL-terminated string

Protected

D. Host Management Members
int hostaddlogic( int *num_workers )
This will figure out if we need to ask for more hosts or remove hosts

Private Fields

int served
What was last served

Documentation

This class is an derived from the Resource Management (RM) and Communication (Comm) layer. In MW-Ind, there is just one worker and one master and both are on the same machine. And not just that both are same process!! Send and Recv are merely memcpy. This class I deem is useful for debugging purposes. The api etc all will remain the same when using this layer. All the user has to do is to compile it with the INDEPENDENT flag and use this as the RMComm layer. See into the fibonacci example for more details on the makefile. And then just launch the application as a process. That's it.
int served
What was last served

MWIndRC()
Constructor. Sets data to -1's.

~MWIndRC()
Destructor...

A. Resource Management Functions
Here are all the methods you could want to have for managing a set of machines. See each method for details...

void exit( int exitval )
System shutdown. Does not return.
Parameters:
exitval - The value to call ::exit() with

int setup( int argc, char* argv[], int *my_id, int *master_id)
Initialization of the master process. This will be called one time only when the master starts up.
Returns:
0 on success, -1 on failure

int config( int *nhosts, int *narches, MWWorkerID ***w )
What is there to configure? Nothing

int start_worker( MWWorkerID *w )
Just init the workerID to a worker. This is an idempotent function.

int init_beginning_workers( int *nworkers, MWWorkerID ***workers )
This routine is used to start up multiple workers at the beginning of a run. In MW-Ind there is no initial worker. Simply return 0.

int removeWorker( MWWorkerID *w )
Remove a worker from the virtual machine. MW-Ind has no concept of host management. Hence all are null.

B. Checkpointing Functions

int read_RMstate( FILE *fp )
Do nothing

D. Host Management Members

int hostaddlogic( int *num_workers )
This will figure out if we need to ask for more hosts or remove hosts. In MW-Ind version there is just one worker. So this function is NULL.

The Communication Routines
These communication primitives use memcpy as the communication mechanism for the transfer of data.

int initsend( int encoding = 0 )
Initialize a buffer for sending some data
Parameters:
encoding - Defined by each application. 0 = default

int send( int to_whom, int msgtag )
Send the data that has been packed.
Parameters:
to_whom - An identifier for the recipient
msgtag - A 'tag' to identify that type of message

int recv( int from_whom, int msgtag )
Receive some data that has been packed. Just a memcpy
Parameters:
from_whom - From a specific source; -1 is from all
msgtag - With a certain tag; -1 is all.

int bufinfo( int buf_id, int *len, int *tag, int *from )
Provide info on the message just received

Pack Functions
In the following pack() functions, there are some common themes. First, each stuffs some data into a buffer to be sent. The nitem parameter is just a count of the number of items. The stride parameter specifies *which* items to pack. 1 implies all, 2 would be every 2nd item, 3 is every 3rd item, etc.

The return value is user defined. It should be standardized, but I'll do that later.

int pack( char *bytes, int nitem, int stride = 1 )
Pack some bytes

int pack( float *f, int nitem, int stride = 1 )
float

int pack( double *d, int nitem, int stride = 1 )
double

int pack( int *i, int nitem, int stride = 1 )
int

int pack( unsigned int *ui, int nitem, int stride = 1 )
unsigned int

int pack( short *sh, int nitem, int stride = 1 )
short

int pack( unsigned short *ush, int nitem, int stride = 1 )
unsigned short

int pack( long *l, int nitem, int stride = 1 )
long

int pack( unsigned long *ul, int nitem, int stride = 1 )
unsigned long

int pack( char *string )
Pack a NULL-terminated string

Unpack Functions
These unpack functions unpack data packed with the pack() functions. See the pack() functions for more details.

int unpack( char *bytes, int nitem, int stride = 1 )
Unpack some bytes

int unpack( float *f, int nitem, int stride = 1 )
float

int unpack( double *d, int nitem, int stride = 1 )
double

int unpack( int *i, int nitem, int stride = 1 )
int

int unpack( unsigned int *ui, int nitem, int stride = 1 )
unsigned int

int unpack( short *sh, int nitem, int stride = 1 )
short

int unpack( unsigned short *ush, int nitem, int stride = 1 )
unsigned short

int unpack( long *l, int nitem, int stride = 1 )
long

int unpack( unsigned long *ul, int nitem, int stride = 1 )
unsigned long

int unpack( char *string )
Unpack a NULL-terminated string


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de