SST/macro
stat_histogram.h
Go to the documentation of this file.
1 #ifndef STAT_HISTOGRAM_H
2 #define STAT_HISTOGRAM_H
3 
5 #include <vector>
6 
7 namespace sstmac
8 {
9 
11  public stat_collector
12 {
13  public:
15 
16  void
17  collect(double value);
18 
19  void
20  collect(double value, int64_t num);
21 
22  void
24 
25  void
27 
28  void
30 
31  void
33 
34  void
35  clear();
36 
37  void
38  reduce(stat_collector *coll);
39 
40  virtual void
41  init_factory_params(sprockit::sim_parameters *params);
42 
44  clone_me(int id) const {
45  stat_histogram* cln = new stat_histogram;
46  clone_into(cln);
47  cln->set_id(id);
48  return cln;
49  }
50 
52  clone() const {
53  return clone_me(-1);
54  }
55 
56  protected:
57  void
58  dump(const std::string& froot);
59 
60  void
61  clone_into(stat_histogram* cln) const;
62 
63  protected:
64  std::vector<int64_t> counts_;
65 
66  double bin_size_;
67 
68  int64_t max_bin_;
69 
70  bool is_log_;
71 
72 };
73 
75  public stat_histogram
76 {
77  public:
78  void record(timestamp t, int64_t num);
79 
80 };
81 
82 }
83 
84 #endif // STAT_HISTOGRAM_H
void reduce(stat_collector *coll)
stat_collector * clone() const
std::vector< int64_t > counts_
A type of logger that collects some kind of statistic and outputs to a file during or at the end of a...
virtual void set_id(int id)
void dump_local_data()
After post-processing, this notifies the collector to dump data to a file.
A basic container for time (subject to future transplant).
Definition: timestamp.h:29
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
stat_histogram * clone_me(int id) const
void collect(double value)
virtual void init_factory_params(sprockit::sim_parameters *params)
void simulation_finished(timestamp end)
This is to notify that the statistics collector is done.
void clone_into(stat_histogram *cln) const
void dump(const std::string &froot)
void dump_global_data()
After post-processing, this notifies the collector to dump data to a file.
void global_reduce(parallel_runtime *rt)