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