SST  6.0.0
StructuralSimulationToolkit
statoutputcsv.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_OUTPUTCSV
13 #define _H_SST_CORE_STATISTICS_OUTPUTCSV
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 StatisticOutputCSV
24 
25  The class for statistics output to a comma separated file.
26 */
28 {
29 public:
30  /** Construct a StatOutputCSV
31  * @param outputParameters - Parameters used for this Statistic Output
32  */
33  StatisticOutputCSV(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  StatisticOutputCSV() {;} // For serialization
84 
85 private:
86  FILE* m_hFile;
87  std::vector<std::string> m_OutputBufferArray;
88  std::string m_Separator;
89  std::string m_FilePath;
90  std::string m_currentComponentName;
91  std::string m_currentStatisticName;
92  std::string m_currentStatisticSubId;
93  std::string m_currentStatisticType;
94  bool m_outputTopHeader;
95  bool m_outputSimTime;
96  bool m_outputRank;
97 
98 };
99 
100 } //namespace Statistics
101 } //namespace SST
102 
103 #endif
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 implOutputField(fieldHandle_t fieldHandle, int32_t data)
Implementation functions for output.
Definition: statoutputcsv.cc:233
The class for statistics output to a comma separated file.
Definition: statoutputcsv.h:27
void printUsage()
Print out usage for this Statistic Output.
Definition: statoutputcsv.cc:69
void endOfSimulation()
Indicate to Statistic Output that simulation ended.
Definition: statoutputcsv.cc:173
bool checkOutputParameters()
Perform a check of provided parameters.
Definition: statoutputcsv.cc:30
Parameter store.
Definition: params.h:46
void startOfSimulation()
Indicate to Statistic Output that simulation started.
Definition: statoutputcsv.cc:83
void implStartOutputEntries(StatisticBase *statistic)
Implementation function for the start of output.
Definition: statoutputcsv.cc:179
void implStopOutputEntries()
Implementation function for the end of output.
Definition: statoutputcsv.cc:194