SST/macro
|
A type of logger that collects some kind of statistic and outputs to a file during or at the end of a simulation. More...
#include <stat_collector.h>
Public Member Functions | |
virtual | ~stat_collector () |
virtual void | simulation_finished (timestamp end)=0 |
This is to notify that the statistics collector is done. More... | |
virtual void | dump_local_data ()=0 |
After post-processing, this notifies the collector to dump data to a file. More... | |
virtual void | dump_global_data ()=0 |
After post-processing, this notifies the collector to dump data to a file. More... | |
virtual void | global_reduce (parallel_runtime *rt)=0 |
virtual void | reduce (stat_collector *coll)=0 |
virtual void | clear ()=0 |
virtual stat_collector * | clone () const =0 |
virtual std::string | to_string () const |
virtual void | init_factory_params (sprockit::sim_parameters *params) |
bool | registered () const |
virtual void | set_id (int id) |
int | id () const |
void | set_registered (bool reg) |
void | add_suffix (const std::string &suffix) |
std::string | fileroot () const |
Public Member Functions inherited from sprockit::factory_type | |
virtual void | init_factory_params (sim_parameters *params) |
virtual void | finalize_init () |
Static Public Member Functions | |
static stat_collector * | optional_build (sprockit::sim_parameters *params, const std::string &ns, const std::string &deflt, const char *suffix) |
Protected Member Functions | |
stat_collector () | |
void | clone_into (stat_collector *cln) const |
Static Protected Member Functions | |
static bool | check_open (std::fstream &myfile, const std::string &fname, std::ios::openmode flags=std::ios::out) |
Check to see if the file is open. More... | |
Protected Attributes | |
bool | registered_ |
int | id_ |
std::string | fileroot_ |
A type of logger that collects some kind of statistic and outputs to a file during or at the end of a simulation.
Usually, a static instance of this class should be used, because no merging of stat objects takes place, which means you'll get one file for each stat object.
Definition at line 31 of file stat_collector.h.
|
virtual |
|
inlineprotected |
Definition at line 109 of file stat_collector.h.
References check_open(), and clone_into().
void sstmac::stat_collector::add_suffix | ( | const std::string & | suffix | ) |
Referenced by set_registered().
|
staticprotected |
Check to see if the file is open.
If not, try and open it and set the current output stream to it, and throw an sprockit::spkt_error if something goes wrong.
Referenced by stat_collector().
|
pure virtual |
|
pure virtual |
|
protected |
Referenced by stat_collector().
|
pure virtual |
After post-processing, this notifies the collector to dump data to a file.
name | The root of the filename to dump to |
Implemented in sstmac::hw::stat_bytes_sent, sstmac::sw::ftq_calendar, sstmac::sw::graph_viz, sstmac::event_trace, sstmac::stat_spyplot, sstmac::location_trace, sstmac::stat_histogram, sstmac::stat_global_int, sstmac::stat_local_double, and sstmac::stat_local_int.
|
pure virtual |
After post-processing, this notifies the collector to dump data to a file.
name | The root of the filename to dump to |
Implemented in sstmac::hw::stat_bytes_sent, sstmac::sw::ftq_calendar, sstmac::sw::graph_viz, sstmac::event_trace, sstmac::stat_spyplot, sstmac::location_trace, sstmac::stat_histogram, sstmac::stat_global_int, sstmac::stat_local_double, and sstmac::stat_local_int.
|
inline |
Definition at line 97 of file stat_collector.h.
References sstmac::hw::routing::deflt, fileroot_, and optional_build().
|
pure virtual |
|
inline |
|
virtual |
Reimplemented in sstmac::hw::stat_bytes_sent, sstmac::sw::ftq_calendar, sstmac::stat_spyplot_png, sstmac::event_trace, sstmac::stat_histogram, sstmac::stat_global_int, sstmac::stat_local_double, and sstmac::stat_local_int.
Referenced by sstmac::stat_spyplot_png::set_normalization(), and to_string().
|
static |
Referenced by fileroot(), and sstmac::optional_stats().
|
pure virtual |
|
inline |
Definition at line 74 of file stat_collector.h.
References registered_.
|
inlinevirtual |
Definition at line 79 of file stat_collector.h.
Referenced by sstmac::stat_global_int::clone_me(), sstmac::stat_local_double::clone_me(), sstmac::stat_local_int::clone_me(), sstmac::stat_histogram::clone_me(), sstmac::location_trace::clone_me(), sstmac::sw::graph_viz::clone_me(), sstmac::event_trace::clone_me(), sstmac::stat_spyplot::clone_me(), sstmac::stat_spyplot_png::clone_me(), and sstmac::sw::ftq_calendar::clone_me().
|
inline |
Definition at line 89 of file stat_collector.h.
References add_suffix(), and registered_.
|
pure virtual |
This is to notify that the statistics collector is done.
Do any necessary data post-processing, but do NOT dump to file
Implemented in sstmac::hw::stat_bytes_sent, sstmac::sw::ftq_calendar, sstmac::sw::graph_viz, sstmac::location_trace, sstmac::stat_spyplot, sstmac::event_trace, sstmac::stat_histogram, sstmac::stat_global_int, sstmac::stat_local_double, and sstmac::stat_local_int.
|
inlinevirtual |
Reimplemented in sstmac::sw::ftq_calendar, sstmac::stat_spyplot_png, sstmac::sw::graph_viz, sstmac::stat_spyplot, and sstmac::location_trace.
Definition at line 66 of file stat_collector.h.
References init_factory_params().
|
protected |
Definition at line 130 of file stat_collector.h.
Referenced by fileroot().
|
protected |
Definition at line 129 of file stat_collector.h.
|
protected |
Definition at line 128 of file stat_collector.h.
Referenced by registered(), and set_registered().