class MWPvmRC : public MWRMComm

A Resource Management and Communication class that uses PVM for underlying support of inter-process communication and resource management

Inheritance:


Public Methods

MWPvmRC()
Constructor...
~MWPvmRC()
Destructor...

Public

A. Resource Management Routines
void exit( int exitval )
Shut down
int setup( int argc, char *argv[], int *my_id, int *master_id )
Initialization
int config( int *nhosts, int *narches, MWWorkerID ***workers )
Does a pvm_config, and stuffs the returned hostinfo struct information into a lot of MWWorkerID's
int start_worker( MWWorkerID *w )
Basically do a pvm_spawn
int init_beginning_workers( int *nworkers, MWWorkerID ***workers )
Start up the workers that are given to us at the beginning
int restart_beginning_workers( int *nworkers, MWWorkerID ***workers, MWmessages msg )
Called at the time of restart
int removeWorker( MWWorkerID *w )
Remove a worker
int read_RMstate( FILE *fp )
Read some state
int write_RMstate( FILE *fp )
Write some state
C. Communication Routines
int initsend( int encoding = PvmDataDefault)
int send( int to_whom, int msgtag )
int recv( int from_whom, int msgtag )
int bufinfo( int buf_id, int *len, int *tag, int *from )
Provide info on the message just received
void who( int *id )
Tells the affected party
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 *str )
Pack a NULL-terminated string
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 *str )
Unpack a NULL-terminated string

Private Fields

int is_master
Am I the master process or not?

Private

C. Some Misc Helper functions
struct condorpvm_submit_element* find_exec_class int arch
Find a suitable executable_class for a particular arch_class
int choose_exec_class( int *tempi )
In the beginning, find a exec_class to an already acquired arch_class
char* find_executable( int ex_cl, int ar_cl )
Find the appropriate executable name that belongs to exec_class ex_cl and arch_class ar_cl
void sort_exec_class_ratio( int *temp )
Sort the array temp based on the ratio of current/desired number of workers of each exec_class
char* exists_executable( int ex_cl, int ar_cl )
Find if there is an executable that belongs to exec_class ex_cl and arch_class ar_cl and if it exists return the executable name
Other Functions to be implemented
int hostaddlogic( int *num_workers )
Figure out wether or not to ask for hosts, and how many
int do_spawn( MWWorkerID *w )
Do the pvm_spawn and associated stuff
int setup_notifies( int task_tid )
Set up the proper notifies for a task & host tid
int ask_for_host( int howmany, int archnum )
This function says to pvm: "I would like another machine, please"
void conf()
Shows the pvm virtual machine according to pvm
int min( int *array, int len )
Helper for hostaddlogic()
The number of outstanding requests for a particular arch
int** hostadd_reqs
The requests per exec_classes

Documentation

A Resource Management and Communication class that uses PVM for underlying support of inter-process communication and resource management.

We *could* do cool things here...like keep track of amount of data sent, to whom, etc. We could also MWprintf ( 99, "..." ) everything that gets sent for heaps and heaps of debugging.

MWPvmRC()
Constructor...

~MWPvmRC()
Destructor...

A. Resource Management Routines
Here we implement the pure virtual functions found in ur parent class, MWRMComm.

void exit( int exitval )
Shut down. Calls pvm_exit(), then ::exit(exitval).

int setup( int argc, char *argv[], int *my_id, int *master_id )
Initialization. Does pvm_catchout(), pvm_parent(), and pvm_notifies().

int config( int *nhosts, int *narches, MWWorkerID ***workers )
Does a pvm_config, and stuffs the returned hostinfo struct information into a lot of MWWorkerID's. See the parent class for return details.

int start_worker( MWWorkerID *w )
Basically do a pvm_spawn. We also put some information into w upon return.
Returns:
The tid spawned. Negative number on error.

int init_beginning_workers( int *nworkers, MWWorkerID ***workers )
Start up the workers that are given to us at the beginning. See base class comments for more details.
Parameters:
nworkers - The number of workers at start
workers - A pointer to an array of pointers to MWWorkerID classes. This call will new() memory for the MWWorkerIDs. Also, if (*w)[n]->id2 is -1, that means that the spawn failed for worker number n.

int restart_beginning_workers( int *nworkers, MWWorkerID ***workers, MWmessages msg )
Called at the time of restart

int removeWorker( MWWorkerID *w )
Remove a worker. Basically, call pvm_delhosts().

int read_RMstate( FILE *fp )
Read some state. A null function

int write_RMstate( FILE *fp )
Write some state. A null function

Other Functions to be implemented

int hostaddlogic( int *num_workers )
Figure out wether or not to ask for hosts, and how many...
Parameters:
num_workers - An array of size num_arches that contains the number of workers in each arch class.

int do_spawn( MWWorkerID *w )
Do the pvm_spawn and associated stuff

int setup_notifies( int task_tid )
Set up the proper notifies for a task & host tid

int ask_for_host( int howmany, int archnum )
This function says to pvm: "I would like another machine, please"
Parameters:
howmany - The number of machines to request
archnum - The arch class number to ask for.

void conf()
Shows the pvm virtual machine according to pvm. Used for debugging purposes; not normally called.

int min( int *array, int len )
Helper for hostaddlogic(). Returns the index of the min element in array, which is of length len

The number of outstanding requests for a particular arch

int** hostadd_reqs
The requests per exec_classes

int is_master
Am I the master process or not?

C. Communication Routines
These are essentially thin wrappers of PVM calls.

int initsend( int encoding = PvmDataDefault)

int send( int to_whom, int msgtag )

int recv( int from_whom, int msgtag )

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

void who( int *id )
Tells the affected party

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 *str )
Pack a NULL-terminated string

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 *str )
Unpack a NULL-terminated string

C. Some Misc Helper functions

struct condorpvm_submit_element* find_exec_class int arch
Find a suitable executable_class for a particular arch_class. This function is useful to pick up the executable

int choose_exec_class( int *tempi )
In the beginning, find a exec_class to an already acquired arch_class

char* find_executable( int ex_cl, int ar_cl )
Find the appropriate executable name that belongs to exec_class ex_cl and arch_class ar_cl

void sort_exec_class_ratio( int *temp )
Sort the array temp based on the ratio of current/desired number of workers of each exec_class

char* exists_executable( int ex_cl, int ar_cl )
Find if there is an executable that belongs to exec_class ex_cl and arch_class ar_cl and if it exists return the executable name


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