Master-slave job dispatcher (PyOPUS subsystem name: JD)
A simple asynchronous parallel job dispatcher. If no vm object is supplied, the jobs are evaluated locally. This module is based on pyopus.parallel.evtdrvms and is therefore obsolete. It will be removed in the next release. Use pyopus.parallel.cooperative.OpusOS.dispatch() method instead.
An asyncronous parallel job dispatcher.
vm is the virtual machine object. If it is not given the jobs are evaluated locally.
maxSlaves and minSlaves specify the maxiaml and the minimal number of parallel processes.
A nonzero value of debug turns on debug messages.
Derive from this class and reimplement the first four methods. Invoke the evaluation by calling the run() method.
Fills the handler table of the EventDrivenMS object with the handlers that take care of the parallel point evaluator’s messages.
Handles MsgEvaluateJob messages received by slaves. Evaluates the received job and sends back a MsgResult message.
Handles a MsgIdle message.
Distributes work to the slaves by sending them MsgEvaluateJob messages.
Handles a MsgResult message and takes care of the job result.
Marks the slave that sent the message as idle so that new work can be assigned to it by the MsgIdle message handler.
Handles the MsgSlaveStarted message received by the master from a freshly started slave. Does nothing special, just calls the inherited handler from the EventDrivenMS class.
Handles a MsgStartup message received by master/slave when the event loop is entered.
Performs some initializations on the master and prevents the plugins in the slave from printing messages.
Handles a notification message reporting that a slave has failed (is down).
Stores the work that was performed at the time the slave failed so it can later be reassigned to some other slave.
Returns the next job to dispatch.
Returns None when there are no more jobs available.
Should be reimplemented by a derived class.
Postprocesses the results after all jobs are finished. Should be reimplemented by a derived class.
Runs the given job and returns the results. Should be reimplemented by a derived class.
Handles the returned result Should be reimplemented by a derived class.
Resets the dispatcher. Should be reimplemented by a derived class.
Runs the algorithm.