libeblearntools
ebl::metaparser Class Reference

#include <metaparser.h>

List of all members.

Public Member Functions

 metaparser ()
virtual ~metaparser ()
 Destructor.
void parse_logs (const string &root, list< string > *sticky=NULL, list< string > *watch=NULL)
void organize_plot (list< string > &names, varmaplist &flat, pairtree &p)
void write_plots (configuration &conf, const char *dir=NULL, pairtree *p=NULL, string *prefix=NULL)
natural_varmap best (const string &key, uint n, bool display=false)
 Return the n best values (minimized) of key.
varmaplist best (list< string > &keys, uint n, bool display=false)
 Return the n best values (minimized) of key.
int get_max_iter ()
int get_max_common_iter ()
int get_max_common_iter (configuration &conf, const string &dir)
void process (const string &dir)
 Parse, analyze and report.
varmaplist analyze (configuration &conf, const string &dir, int &maxiter, varmaplist &besteach, bool displayall=false, int *maxiter_common=NULL, varmaplist *best_common=NULL)
void send_report (configuration &conf, const string dir, varmaplist &best, int max_iter, string conf_fullfname, string jobs_info, uint nrunning=0, double maxminutes=0.0, double minminutes=0.0, varmaplist *besteach=NULL, varmaplist *best_common=NULL, int *maxiter_common=NULL)

Detailed Description

A parser that can analyze the output of multiple jobs (usually used in conjunction with metarun).


Constructor & Destructor Documentation

ebl::metaparser::metaparser ( )

Constructor, initialize the hierarchy. This hierarchy defines groups of variables, e.g. we want to have a first level of variables for each value of variable "name", then a sub level for each value of variable "i".


Member Function Documentation

varmaplist ebl::metaparser::analyze ( configuration conf,
const string &  dir,
int &  maxiter,
varmaplist &  besteach,
bool  displayall = false,
int *  maxiter_common = NULL,
varmaplist *  best_common = NULL 
)

Analyze log files and return the best set of variables.

Parameters:
maxiterSet this to the maximum iteration number found.
besteachThis will be set to the best answers of each job.
int ebl::metaparser::get_max_common_iter ( configuration conf,
const string &  dir 
)

Return the minimum iteration number of maximums for each job. Same as get_max_common_iter() without arguments, but calls parse_logs() with directory 'dir' and uses 'conf' to configure the call to parse_logs().

int ebl::metaparser::get_max_common_iter ( )

Return the minimum iteration number of maximums for each job. This assumes a call to parse_logs beforehand.

int ebl::metaparser::get_max_iter ( )

Return the maximum iteration number, i.e. the maximum value found for variable "i", -1 if nothing is found.

void ebl::metaparser::organize_plot ( list< string > &  names,
varmaplist &  flat,
pairtree p 
)

Organize a flat representation 'flat' into a plottable tree representation, organized in hierarchy where the 1st depth contains curves names composed of each possible configuration of each variable name in 'names' except for the last one. The last one will be used as the x axis. The last depth contains all remaining variables, that can be ploted against the first 2 depths, as the y value. This fills the pairtree p accordingly.

void ebl::metaparser::parse_logs ( const string &  root,
list< string > *  sticky = NULL,
list< string > *  watch = NULL 
)

Parse all files in root matching the .log extension. If 'sticky' is not null, keep those variables between iterations. If 'watch' is not null and not empty, only extract those variables.

void ebl::metaparser::send_report ( configuration conf,
const string  dir,
varmaplist &  best,
int  max_iter,
string  conf_fullfname,
string  jobs_info,
uint  nrunning = 0,
double  maxminutes = 0.0,
double  minminutes = 0.0,
varmaplist *  besteach = NULL,
varmaplist *  best_common = NULL,
int *  maxiter_common = NULL 
)

Send an email reporting the status of the runs.

Parameters:
besteachAn optional list of best results for each job.
void ebl::metaparser::write_plots ( configuration conf,
const char *  dir = NULL,
pairtree p = NULL,
string *  prefix = NULL 
)

Write text files parsable by plotting tools such as gnuplot, and generate pdf plots with gnuplot into directory dir.

Parameters:
pOptional tree to use in lieu of internal tree.

The documentation for this class was generated from the following files: