SST  11.0.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 _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:
34  "sst",
35  "statoutputconsole",
36  SST_ELI_ELEMENT_VERSION(1,0,0),
37  "Output directly to console screen"
38  )
39 
40 
41  /** Construct a StatOutputConsole
42  * @param outputParameters - Parameters used for this Statistic Output
43  */
44  StatisticOutputConsole(Params& outputParameters);
45 
46 protected:
47  /** Perform a check of provided parameters
48  * @return True if all required parameters and options are acceptable
49  */
50  bool checkOutputParameters() override;
51 
52  /** Print out usage for this Statistic Output */
53  void printUsage() override;
54 
55  /** Indicate to Statistic Output that simulation started.
56  * Statistic output may perform any startup code here as necessary.
57  */
58  void startOfSimulation() override;
59 
60  /** Indicate to Statistic Output that simulation ended.
61  * Statistic output may perform any shutdown code here as necessary.
62  */
63  void endOfSimulation() override;
64 
65  /** Implementation function for the start of output.
66  * This will be called by the Statistic Processing Engine to indicate that
67  * a Statistic is about to send data to the Statistic Output for processing.
68  * @param statistic - Pointer to the statistic object than the output can
69  * retrieve data from.
70  */
71  void implStartOutputEntries(StatisticBase* statistic) override;
72 
73  /** Implementation function for the end of output.
74  * This will be called by the Statistic Processing Engine to indicate that
75  * a Statistic is finished sending data to the Statistic Output for processing.
76  * The Statistic Output can perform any output related functions here.
77  */
78  void implStopOutputEntries() override;
79 
80  /** Implementation functions for output.
81  * These will be called by the statistic to provide Statistic defined
82  * data to be output.
83  * @param fieldHandle - The handle to the registered statistic field.
84  * @param data - The data related to the registered field to be output.
85  */
86  void outputField(fieldHandle_t fieldHandle, int32_t data) override;
87  void outputField(fieldHandle_t fieldHandle, uint32_t data) override;
88  void outputField(fieldHandle_t fieldHandle, int64_t data) override;
89  void outputField(fieldHandle_t fieldHandle, uint64_t data) override;
90  void outputField(fieldHandle_t fieldHandle, float data) override;
91  void outputField(fieldHandle_t fieldHandle, double data) override;
92 
93 protected:
94  StatisticOutputConsole() {;} // For serialization
95 
96 private:
97  std::string m_OutputBuffer;
98 
99 };
100 
101 } //namespace Statistics
102 } //namespace SST
103 
104 #endif
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:56
Forms the base class for statistics gathering within SST.
Definition: statbase.h:64
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 outputField(fieldHandle_t fieldHandle, int32_t data) override
Implementation functions for output.
Definition: statoutputconsole.cc:72
Definition: statoutput.h:144
void startOfSimulation() override
Indicate to Statistic Output that simulation started.
Definition: statoutputconsole.cc:48
Parameter store.
Definition: params.h:44
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