12#ifndef SST_CORE_STATAPI_STATOUTPUTTXT_H
13#define SST_CORE_STATAPI_STATOUTPUTTXT_H
15#include "sst/core/sst_types.h"
16#include "sst/core/statapi/statoutput.h"
26namespace SST::Statistics {
81 void outputField(fieldHandle_t fieldHandle, int32_t data)
override;
82 void outputField(fieldHandle_t fieldHandle, uint32_t data)
override;
83 void outputField(fieldHandle_t fieldHandle, int64_t data)
override;
84 void outputField(fieldHandle_t fieldHandle, uint64_t data)
override;
85 void outputField(fieldHandle_t fieldHandle,
float data)
override;
86 void outputField(fieldHandle_t fieldHandle,
double data)
override;
91 bool m_outputTopHeader;
92 bool m_outputInlineHeader;
95 bool m_useCompression;
100 int print(
const char* fmt, ...) __attribute__((format(printf, 2, 3)));
107 std::string m_outputBuffer;
108 std::string m_FilePath;
113 virtual bool outputsToFile() = 0;
119 virtual bool supportsCompression() = 0;
124 virtual std::string getStartOutputPrefix() = 0;
131 virtual bool getOutputTopHeaderDefault() = 0;
132 virtual bool getOutputInlineHeaderDefault() = 0;
133 virtual bool getOutputSimTimeDefault() = 0;
134 virtual bool getOutputRankDefault() = 0;
136 virtual std::string getDefaultFileName() {
return ""; }
151 SST_ELI_REGISTER_DERIVED(
156 SST_ELI_ELEMENT_VERSION(1,0,0),
157 "Output to text file"
160 SST_ELI_DOCUMENT_PARAMS(
161 {
"outputtopheader",
"Whether to print a header at the top of the output",
"False" },
162 {
"outputinlineheader",
"Whether to print a field names inline with statistic output",
"True" },
163 {
"outputsimtime",
"Whether to print the simulation time in the output",
"True" },
164 {
"outputrank",
"Whether to print the rank in the output",
"True" },
165 {
"filepath",
"Filepath for the output file",
"./StatisticOutput.txt" },
166 {
"compressed",
"Whether to compress the output file",
"False" }
185 bool outputsToFile()
override {
return true; }
191 bool supportsCompression()
override
202 std::string getStartOutputPrefix()
override {
return ""; }
209 bool getOutputTopHeaderDefault()
override {
return false; }
210 bool getOutputInlineHeaderDefault()
override {
return true; }
211 bool getOutputSimTimeDefault()
override {
return true; }
212 bool getOutputRankDefault()
override {
return true; }
214 std::string getDefaultFileName()
override {
return "StatisticOutput.txt"; }
225 SST_ELI_REGISTER_DERIVED(
230 SST_ELI_ELEMENT_VERSION(1,0,0),
234 SST_ELI_DOCUMENT_PARAMS(
235 {
"outputtopheader",
"Whether to print a header at the top of the output",
"False" },
236 {
"outputinlineheader",
"Whether to print a field names inline with statistic output",
"True" },
237 {
"outputsimtime",
"Whether to print the simulation time in the output",
"False" },
238 {
"outputrank",
"Whether to print the rank in the output",
"False" },
256 bool outputsToFile()
override {
return false; }
262 bool supportsCompression()
override {
return false; }
267 std::string getStartOutputPrefix()
override {
return " "; }
274 bool getOutputTopHeaderDefault()
override {
return false; }
275 bool getOutputInlineHeaderDefault()
override {
return true; }
276 bool getOutputSimTimeDefault()
override {
return false; }
277 bool getOutputRankDefault()
override {
return false; }
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:43
Parameter store.
Definition params.h:65
Forms the base class for statistics gathering within SST.
Definition statbase.h:51
ImplementVirtualSerializable(SST::Statistics::StatisticFieldsOutput) protected StatisticFieldsOutput()
Construct a base StatisticOutput.
Definition statoutput.h:294
The class for statistics output to the console.
Definition statoutputtxt.h:223
StatisticOutputConsole(Params &outputParameters)
Construct a StatOutputTxt.
Definition statoutputtxt.cc:430
Definition statoutputtxt.h:29
void endOfSimulation() override
Indicate to Statistic Output that simulation ended.
Definition statoutputtxt.cc:105
void outputField(fieldHandle_t fieldHandle, int32_t data) override
Implementation functions for output.
Definition statoutputtxt.cc:161
void implStartOutputEntries(StatisticBase *statistic) override
Implementation function for the start of output.
Definition statoutputtxt.cc:113
StatisticOutputTextBase(Params &outputParameters)
Construct a StatOutputTxt.
Definition statoutputtxt.cc:26
void startOfSimulation() override
Indicate to Statistic Output that simulation started.
Definition statoutputtxt.cc:60
virtual bool supportsDynamicRegistration() const override
This output supports adding statistics during runtime if the header is embedded in the output.
Definition statoutputtxt.h:37
void implStopOutputEntries() override
Implementation function for the end of output.
Definition statoutputtxt.cc:153
bool checkOutputParameters() override
Perform a check of provided parameters.
Definition statoutputtxt.cc:31
The class for statistics output to a text file.
Definition statoutputtxt.h:149
Forms the base class for statistics output generation within the SST core.
Definition statoutput.h:54
virtual bool acceptsGroups() const
True if this StatOutput can handle StatisticGroups.
Definition statoutput.h:75