SST  6.1.0
StructuralSimulationToolkit
statoutputtxt.h
1 // Copyright 2009-2016 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-2016, 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_OUTPUTTXT
13 #define _H_SST_CORE_STATISTICS_OUTPUTTXT
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 StatisticOutputTxt
24 
25  The class for statistics output to a text file.
26 */
28 {
29 public:
30  /** Construct a StatOutputTxt
31  * @param outputParameters - Parameters used for this Statistic Output
32  */
33  StatisticOutputTxt(Params& outputParameters);
34 
35 protected:
36  /** Perform a check of provided parameters
37  * @return True if all required parameters and options are acceptable
38  */
39  bool checkOutputParameters();
40 
41  /** Print out usage for this Statistic Output */
42  void printUsage();
43 
44  /** Indicate to Statistic Output that simulation started.
45  * Statistic output may perform any startup code here as necessary.
46  */
47  void startOfSimulation();
48 
49  /** Indicate to Statistic Output that simulation ended.
50  * Statistic output may perform any shutdown code here as necessary.
51  */
52  void endOfSimulation();
53 
54  /** Implementation function for the start of output.
55  * This will be called by the Statistic Processing Engine to indicate that
56  * a Statistic is about to send data to the Statistic Output for processing.
57  * @param statistic - Pointer to the statistic object than the output can
58  * retrieve data from.
59  */
60  void implStartOutputEntries(StatisticBase* statistic);
61 
62  /** Implementation function for the end of output.
63  * This will be called by the Statistic Processing Engine to indicate that
64  * a Statistic is finished sendind data to the Statistic Output for processing.
65  * The Statisic Output can perform any output related functions here.
66  */
67  void implStopOutputEntries();
68 
69  /** Implementation functions for output.
70  * These will be called by the statistic to provide Statistic defined
71  * data to be output.
72  * @param fieldHandle - The handle to the registered statistic field.
73  * @param data - The data related to the registered field to be output.
74  */
75  void implOutputField(fieldHandle_t fieldHandle, int32_t data);
76  void implOutputField(fieldHandle_t fieldHandle, uint32_t data);
77  void implOutputField(fieldHandle_t fieldHandle, int64_t data);
78  void implOutputField(fieldHandle_t fieldHandle, uint64_t data);
79  void implOutputField(fieldHandle_t fieldHandle, float data);
80  void implOutputField(fieldHandle_t fieldHandle, double data);
81 
82 protected:
83  StatisticOutputTxt() {;} // For serialization
84 
85 private:
86  FILE* m_hFile;
87  std::string m_outputBuffer;
88  std::string m_FilePath;
89  bool m_outputTopHeader;
90  bool m_outputInlineHeader;
91  bool m_outputSimTime;
92  bool m_outputRank;
93 
94 };
95 
96 } //namespace Statistics
97 } //namespace SST
98 
99 #endif
void implStopOutputEntries()
Implementation function for the end of output.
Definition: statoutputtxt.cc:190
void implOutputField(fieldHandle_t fieldHandle, int32_t data)
Implementation functions for output.
Definition: statoutputtxt.cc:196
Forms the base class for statistics output generation within the SST core.
Definition: statoutput.h:47
Forms the base class for statistics gathering within SST.
Definition: statbase.h:36
Definition: action.cc:17
void printUsage()
Print out usage for this Statistic Output.
Definition: statoutputtxt.cc:68
void startOfSimulation()
Indicate to Statistic Output that simulation started.
Definition: statoutputtxt.cc:82
The class for statistics output to a text file.
Definition: statoutputtxt.h:27
void endOfSimulation()
Indicate to Statistic Output that simulation ended.
Definition: statoutputtxt.cc:148
bool checkOutputParameters()
Perform a check of provided parameters.
Definition: statoutputtxt.cc:30
void implStartOutputEntries(StatisticBase *statistic)
Implementation function for the start of output.
Definition: statoutputtxt.cc:154
Parameter store.
Definition: params.h:44