libeblearntools
|
A class to manage jobs, that can be ran over a cluster using MPI. More...
#include <mpijob.h>
Public Member Functions | |
mpijob_manager (int argc, char **argv) | |
virtual | ~mpijob_manager () |
Destructor. | |
virtual bool | read_metaconf (const char *fname, const string *tstamp=NULL, const char *resume_name=NULL, bool resumedir=false, bool nomax=false, int maxjobs=-1) |
virtual void | prepare (bool reset_progress=false) |
Prepare all jobs (create folders and copy/create files). | |
virtual void | run (bool force_start=false) |
Run all jobs (assumes a call to prepare() beforehand). | |
virtual uint | world_size () |
Return the size of the world (including master). | |
virtual bool | is_master () |
Returns true if this instance is the master. | |
Protected Member Functions | |
virtual void | run_master () |
virtual void | stop_all () |
Stop all slaves. | |
virtual bool | assign (uint jobid, uint slave_id) |
void | jinfos (int running[]) |
virtual void | run_slave () |
Run a slave manager, which takes orders for the master manager. | |
Protected Attributes | |
int | rank |
int | jslots |
int | id_running |
id of running job (-1 if none). | |
bool | use_master |
Use master to run a job or not. |
A class to manage jobs, that can be ran over a cluster using MPI.
ebl::mpijob_manager::mpijob_manager | ( | int | argc, |
char ** | argv | ||
) |
Constructor. argc and argv are used by mpi to initialize and manager communications.
bool ebl::mpijob_manager::assign | ( | uint | jobid, |
uint | slave_id | ||
) | [protected, virtual] |
Assign job with id 'jobid' to slave with rank 'slave_id' and return true on success.
void ebl::mpijob_manager::jinfos | ( | int | running[] | ) | [protected] |
Gather and print information about jobs, such as number of jobs running, number to run left, min/max running time.
bool ebl::mpijob_manager::read_metaconf | ( | const char * | fname, |
const string * | tstamp = NULL , |
||
const char * | resume_name = NULL , |
||
bool | resumedir = false , |
||
bool | nomax = false , |
||
int | maxjobs = -1 |
||
) | [virtual] |
Read meta configuration.
tstamp | An optional timestamp to be used for the job's name instead of the current timestamp. |
resume_name | If not null, resume the existing job with this name. |
resumedir | If true, resume by reading existing job dirs, use global conf file otherwise. |
Reimplemented from ebl::job_manager.
void ebl::mpijob_manager::run_master | ( | ) | [protected, virtual] |
Run the master manager, which creates all initial files and configuration and controls jobs assignments to slaves managers.