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