class MWWorker

This is the worker class that performs the tasks in the opportunistic condor environment

Public Fields

static MWRMComm* RMC
Our RM / Comm class. Used here only for communication.
MWTask* workingTask
information from the master

Public Methods

void go( int argc, char *argv[] )
Giddyap!
MWWorker()
Default constructor
virtual ~MWWorker()
Default Destructor

Protected Fields

char mach_name[64]
The name of the machine the worker is running on.
int master
The task ID of the master - used for sending messages.
char master_mach_name[64]
The name of the master machine.

Protected Methods

virtual double benchmark( MWTask * )
Run a benchmark, given an MWTASK
virtual void execute_task( MWTask * )
This function performs the actions that happen once the Worker finds out there is a task to do
virtual void pack_worker_initinfo()
Here we might in the future pack some useful information about the specific machine on which we're running
void suicide()
Die!!!!!!
double timeval_to_double( struct timeval t )
Given a timeval, return a double
virtual void unpack_driver_task_data( void )
If you have some driver data that you would like to use on the worker in order to execute the task, you should unpack it here
virtual MWReturn unpack_init_data()
This unpacks the initial data that is sent to the worker once the master knows that he has started
void worker_mainloop()
This sits in a loop in which it asks for work from the master and does the work
MWReturn worker_setup()
This is run before the worker_mainloop()

Protected

The task instance that a worker will use for packing/unpacking

Documentation

This is the worker class that performs the tasks in the opportunistic condor environment. It is an oppressed worker class in that in simply executes the tasks given to it and reports the results back to the master. :-)

Capitalist stooges who wish to create an application must derive a class from this class, and implement the following two methods

MWWorker()
Default constructor

virtual ~MWWorker()
Default Destructor

void go( int argc, char *argv[] )
Giddyap!

static MWRMComm* RMC
Our RM / Comm class. Used here only for communication.

int master
The task ID of the master - used for sending messages.

The task instance that a worker will use for packing/unpacking

MWTask* workingTask
information from the master

char mach_name[64]
The name of the machine the worker is running on.

char master_mach_name[64]
The name of the master machine.

virtual void pack_worker_initinfo()
Here we might in the future pack some useful information about the specific machine on which we're running. Right now, all workers are equal, and we pass only the hostname.

There must be a "matching" unpack_worker_initinfo() in the MWDriver class.

virtual MWReturn unpack_init_data()
This unpacks the initial data that is sent to the worker once the master knows that he has started.

There must be a "matching" pack_worker_init_data() in the MWDriver class derived for your application.

virtual void execute_task( MWTask * )
This function performs the actions that happen once the Worker finds out there is a task to do. You will need to cast the MWTask * to a pointer of the Task type derived for your application. For example

      Task_Fib *dt = dynamic_cast<Task_Fib *> ( t );
      assert( dt );     
      

virtual double benchmark( MWTask * )
Run a benchmark, given an MWTASK

virtual void unpack_driver_task_data( void )
If you have some driver data that you would like to use on the worker in order to execute the task, you should unpack it here

MWReturn worker_setup()
This is run before the worker_mainloop(). It prints a message that the worker has been spawned, sends the master an INIT message, and awaits a reply from the master, upon which it calls unpack_init_data().

void worker_mainloop()
This sits in a loop in which it asks for work from the master and does the work. Maybe we should name this class GradStudent. :-)

void suicide()
Die!!!!!!

double timeval_to_double( struct timeval t )
Given a timeval, return a double


This class has no child classes.
Author:
Mike Yoder, modified by Jeff Linderoth and Jean-Pierre Goux
See Also:
MWDriver
MWWorker

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