00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _H_SST_CORE_STATISTICS_OUTPUTCSV
00013 #define _H_SST_CORE_STATISTICS_OUTPUTCSV
00014
00015 #include "sst/core/sst_types.h"
00016 #include <sst/core/serialization.h>
00017
00018 #include <sst/core/statapi/statoutput.h>
00019
00020 namespace SST {
00021 namespace Statistics {
00022
00023
00024
00025
00026
00027
00028 class StatisticOutputCSV : public StatisticOutput
00029 {
00030 public:
00031
00032
00033
00034 StatisticOutputCSV(Params& outputParameters);
00035
00036 protected:
00037
00038
00039
00040 bool checkOutputParameters();
00041
00042
00043 void printUsage();
00044
00045
00046
00047
00048 void startOfSimulation();
00049
00050
00051
00052
00053 void endOfSimulation();
00054
00055
00056
00057
00058
00059
00060
00061 void implStartOutputEntries(StatisticBase* statistic);
00062
00063
00064
00065
00066
00067
00068 void implStopOutputEntries();
00069
00070
00071
00072
00073
00074
00075
00076 void implOutputField(fieldHandle_t fieldHandle, int32_t data);
00077 void implOutputField(fieldHandle_t fieldHandle, uint32_t data);
00078 void implOutputField(fieldHandle_t fieldHandle, int64_t data);
00079 void implOutputField(fieldHandle_t fieldHandle, uint64_t data);
00080 void implOutputField(fieldHandle_t fieldHandle, float data);
00081 void implOutputField(fieldHandle_t fieldHandle, double data);
00082
00083 protected:
00084 StatisticOutputCSV() {;}
00085
00086 private:
00087 FILE* m_hFile;
00088 std::vector<std::string> m_OutputBufferArray;
00089 std::string m_Separator;
00090 std::string m_FilePath;
00091 std::string m_currentComponentName;
00092 std::string m_currentStatisticName;
00093 std::string m_currentStatisticSubId;
00094 std::string m_currentStatisticType;
00095 bool m_outputTopHeader;
00096 bool m_outputSimTime;
00097 bool m_outputRank;
00098
00099 friend class boost::serialization::access;
00100 template<class Archive>
00101 void serialize(Archive & ar, const unsigned int version)
00102 {
00103 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(StatisticOutput);
00104 ar & BOOST_SERIALIZATION_NVP(m_OutputBufferArray);
00105 ar & BOOST_SERIALIZATION_NVP(m_Separator);
00106 ar & BOOST_SERIALIZATION_NVP(m_FilePath);
00107 ar & BOOST_SERIALIZATION_NVP(m_currentComponentName);
00108 ar & BOOST_SERIALIZATION_NVP(m_currentStatisticName);
00109 ar & BOOST_SERIALIZATION_NVP(m_currentStatisticSubId);
00110 ar & BOOST_SERIALIZATION_NVP(m_currentStatisticType);
00111 ar & BOOST_SERIALIZATION_NVP(m_outputTopHeader);
00112 ar & BOOST_SERIALIZATION_NVP(m_outputSimTime);
00113 ar & BOOST_SERIALIZATION_NVP(m_outputRank);
00114 }
00115 };
00116
00117 }
00118 }
00119
00120 BOOST_CLASS_EXPORT_KEY(SST::Statistics::StatisticOutputCSV)
00121
00122 #endif