PetaVision  Alpha
StatsProbe.hpp
1 /*
2  * StatsProbe.hpp
3  *
4  * Created on: Mar 10, 2009
5  * Author: rasmussn
6  */
7 
8 #ifndef STATSPROBE_HPP_
9 #define STATSPROBE_HPP_
10 
11 #include "LayerProbe.hpp"
12 
13 namespace PV {
14 
15 class StatsProbe : public PV::LayerProbe {
16  public:
17  StatsProbe(const char *name, HyPerCol *hc);
18  virtual ~StatsProbe();
19 
20  virtual Response::Status outputState(double timef) override;
21  virtual int checkpointTimers(PrintStream &timerstream);
22 
23  protected:
24  StatsProbe();
25  int initialize(const char *name, HyPerCol *hc);
26  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
27  virtual void ioParam_buffer(enum ParamsIOFlag ioFlag);
28  virtual void ioParam_nnzThreshold(enum ParamsIOFlag ioFlag);
29  void requireType(PVBufType requiredType);
30 
39  virtual void initNumValues() override;
40 
41  virtual Response::Status registerData(Checkpointer *checkpointer) override;
42 
48  virtual bool needRecalc(double timevalue) override { return false; }
49 
55  virtual void calcValues(double timevalue) override {
56  Fatal().printf("%s does not use calcValues.\n", getDescription_c());
57  }
58 
59  // Member variables
60  PVBufType type;
61  double *sum;
62  double *sum2;
63  int *nnz;
64  float *fMin;
65  float *fMax;
66  float *avg;
67  float *sigma;
68 
69  float nnzThreshold;
70  Timer *iotimer; // A timer for the i/o part of outputState
71  Timer *mpitimer; // A timer for the MPI part of outputState
72  Timer *comptimer; // A timer for the basic computation of outputState
73 
74  private:
75  int initialize_base();
76  void resetStats();
77 }; // end class StatsProbe
78 }
79 
80 #endif /* STATSPROBE_HPP_ */
virtual void calcValues(double timevalue) override
Definition: StatsProbe.hpp:55
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
Definition: StatsProbe.cpp:92
virtual Response::Status outputState(double timef) override
Definition: StatsProbe.cpp:193
virtual Response::Status registerData(Checkpointer *checkpointer) override
Definition: StatsProbe.cpp:169
virtual bool needRecalc(double timevalue) override
Definition: StatsProbe.hpp:48
virtual void initNumValues() override
Definition: StatsProbe.cpp:167