00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _H_SST_CORE_STATISTICS_OUTPUT_TXT_GZ
00013 #define _H_SST_CORE_STATISTICS_OUTPUT_TXT_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 #ifdef HAVE_LIBZ
00021
00022 #include <zlib.h>
00023
00024 namespace SST {
00025 namespace Statistics {
00026
00027
00028
00029
00030
00031
00032 class StatisticOutputCompressedTxt : public StatisticOutput
00033 {
00034 public:
00035
00036
00037
00038 StatisticOutputCompressedTxt(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 StatisticOutputCompressedTxt() {;}
00089
00090 private:
00091 gzFile m_hFile;
00092 std::string m_outputBuffer;
00093 std::string m_FilePath;
00094 bool m_outputTopHeader;
00095 bool m_outputInlineHeader;
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_outputBuffer);
00105 ar & BOOST_SERIALIZATION_NVP(m_FilePath);
00106 ar & BOOST_SERIALIZATION_NVP(m_outputTopHeader);
00107 ar & BOOST_SERIALIZATION_NVP(m_outputInlineHeader);
00108 ar & BOOST_SERIALIZATION_NVP(m_outputSimTime);
00109 ar & BOOST_SERIALIZATION_NVP(m_outputRank);
00110 }
00111 };
00112
00113 }
00114 }
00115
00116 BOOST_CLASS_EXPORT_KEY(SST::Statistics::StatisticOutputCompressedTxt)
00117
00118 #endif
00119 #endif