SST  7.0.0
StructuralSimulationToolkit
statoutputconsole.h
1 // Copyright 2009-2017 Sandia Corporation. Under the terms
2 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2017, Sandia Corporation
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef _H_SST_CORE_STATISTICS_OUTPUTCONSOLE
13 #define _H_SST_CORE_STATISTICS_OUTPUTCONSOLE
14 
15 #include "sst/core/sst_types.h"
16 
17 #include <sst/core/statapi/statoutput.h>
18 
19 namespace SST {
20 namespace Statistics {
21 
22 /**
23  \class StatisticOutputConsole
24 
25  The class for statistics output to the console. This will be the
26  default statistic output in SST.
27 */
29 {
30 public:
31  /** Construct a StatOutputConsole
32  * @param outputParameters - Parameters used for this Statistic Output
33  */
34  StatisticOutputConsole(Params& outputParameters);
35 
36 protected:
37  /** Perform a check of provided parameters
38  * @return True if all required parameters and options are acceptable
39  */
40  bool checkOutputParameters() override;
41 
42  /** Print out usage for this Statistic Output */
43  void printUsage() override;
44 
45  /** Indicate to Statistic Output that simulation started.
46  * Statistic output may perform any startup code here as necessary.
47  */
48  void startOfSimulation() override;
49 
50  /** Indicate to Statistic Output that simulation ended.
51  * Statistic output may perform any shutdown code here as necessary.
52  */
53  void endOfSimulation() override;
54 
55  /** Implementation function for the start of output.
56  * This will be called by the Statistic Processing Engine to indicate that
57  * a Statistic is about to send data to the Statistic Output for processing.
58  * @param statistic - Pointer to the statistic object than the output can
59  * retrieve data from.
60  */
61  void implStartOutputEntries(StatisticBase* statistic) override;
62 
63  /** Implementation function for the end of output.
64  * This will be called by the Statistic Processing Engine to indicate that
65  * a Statistic is finished sendind data to the Statistic Output for processing.
66  * The Statisic Output can perform any output related functions here.
67  */
68  void implStopOutputEntries() override;
69 
70  /** Implementation functions for output.
71  * These will be called by the statistic to provide Statistic defined
72  * data to be output.
73  * @param fieldHandle - The handle to the registered statistic field.
74  * @param data - The data related to the registered field to be output.
75  */
76  void implOutputField(fieldHandle_t fieldHandle, int32_t data) override;
77  void implOutputField(fieldHandle_t fieldHandle, uint32_t data) override;
78  void implOutputField(fieldHandle_t fieldHandle, int64_t data) override;
79  void implOutputField(fieldHandle_t fieldHandle, uint64_t data) override;
80  void implOutputField(fieldHandle_t fieldHandle, float data) override;
81  void implOutputField(fieldHandle_t fieldHandle, double data) override;
82 
83 protected:
84  StatisticOutputConsole() {;} // For serialization
85 
86 private:
87  std::string m_OutputBuffer;
88 
89 };
90 
91 } //namespace Statistics
92 } //namespace SST
93 
94 #endif
Forms the base class for statistics output generation within the SST core.
Definition: statoutput.h:47
void implStartOutputEntries(StatisticBase *statistic) override
Implementation function for the start of output.
Definition: statoutputconsole.cc:56
Forms the base class for statistics gathering within SST.
Definition: statbase.h:61
Definition: action.cc:17
bool checkOutputParameters() override
Perform a check of provided parameters.
Definition: statoutputconsole.cc:28
void implStopOutputEntries() override
Implementation function for the end of output.
Definition: statoutputconsole.cc:66
void printUsage() override
Print out usage for this Statistic Output.
Definition: statoutputconsole.cc:40
void startOfSimulation() override
Indicate to Statistic Output that simulation started.
Definition: statoutputconsole.cc:48
Parameter store.
Definition: params.h:45
void implOutputField(fieldHandle_t fieldHandle, int32_t data) override
Implementation functions for output.
Definition: statoutputconsole.cc:72
void endOfSimulation() override
Indicate to Statistic Output that simulation ended.
Definition: statoutputconsole.cc:52
The class for statistics output to the console.
Definition: statoutputconsole.h:28