libeblearntools
|
A class to manage jobs. More...
#include <job.h>
Public Member Functions | |
job_manager () | |
Constructor. | |
virtual | ~job_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 | set_copy (const string &path) |
Enable recursive copy of this path into jobs folders. | |
virtual void | prepare (bool reset_progress=false) |
virtual void | initialize_other (const string &other) |
virtual void | run (bool force_start=false) |
Run all jobs (assumes a call to prepare() beforehand). | |
virtual void | monitor (const char *conffname) |
Protected Member Functions | |
virtual void | release_dead_children () |
Release child processes that have terminated from their zombie state. | |
virtual void | jobs_info () |
virtual void | report () |
Analyze and send a report. | |
virtual void | last_report () |
Print stopping message and send last report. | |
virtual list< string > * | list_job_dirs (const char *conffname) |
Protected Attributes | |
meta_configuration | mconf |
(unresolved) Meta configuration | |
meta_configuration | rmconf |
(resolved) Meta configuration | |
string | mconf_fullfname |
Full filename of metaconf. | |
string | mconf_fname |
Filename of metaconf. | |
vector< job * > | jobs |
A vector of jobs to run. | |
string | copy_path |
Copy path to jobs folders. | |
uint | max_jobs |
Max number of jobs at the same time. | |
metaparser | parser |
int | maxiter |
int | maxiter_tmp |
double | mintime |
double | maxtime |
uint | nalive |
uint | nrunning |
uint | unstarted |
uint | finished |
uint | unfinished |
int | ready_slots |
ostringstream | infos |
ostringstream | summary |
Jobs status summary. | |
varmaplist | best |
best results | |
varmaplist | besteach |
best result of each job | |
uint | swait |
Waiting time when looping, in seconds. | |
timer | time |
Total running time. |
A class to manage jobs.
void ebl::job_manager::initialize_other | ( | const string & | other | ) | [virtual] |
Set the weights initialization for each job given corresponding jobs found in 'other' directory.
void ebl::job_manager::jobs_info | ( | ) | [protected, virtual] |
Gather and print information about jobs, such as number of jobs running, number to run left, min/max running time.
list< string > * ebl::job_manager::list_job_dirs | ( | const char * | conffname | ) | [protected, virtual] |
List all job directories found in conf's root directory and return that list. Caller is responsible for delete the list.
void ebl::job_manager::monitor | ( | const char * | conffname | ) | [virtual] |
Monitor progress of jobs given existing directories and progress files ('progress' and 'finished').
void ebl::job_manager::prepare | ( | bool | reset_progress = false | ) | [virtual] |
Prepare all jobs (create folders and copy/create files).
reset_progress | If true, ignore existing progress in target dir. |
Reimplemented in ebl::mpijob_manager.
bool ebl::job_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. |
nomax | If true, lift the maximum concurrent jobs limit. |
resumedif | If true, resume by reading existing job dirs, use global conf file otherwise. |
maxjobs | Limit the number of concurrent jobs to maxjobs. If -1, defaut, use conf's 'meta_max_jobs' instead if defined. |
Reimplemented in ebl::mpijob_manager.