From 54ba768b01f2c38e7fbbfd2bcd4072bafdcfad96 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Fri, 29 Oct 2021 19:01:38 -0400 Subject: [PATCH] fix sirius operator --- source/adios2/operator/compress/CompressSirius.cpp | 7 +++++++ source/adios2/operator/compress/CompressSirius.h | 2 ++ source/adios2/operator/compress/CompressorFactory.cpp | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/source/adios2/operator/compress/CompressSirius.cpp b/source/adios2/operator/compress/CompressSirius.cpp index 75ea5a4394..41f649af0b 100644 --- a/source/adios2/operator/compress/CompressSirius.cpp +++ b/source/adios2/operator/compress/CompressSirius.cpp @@ -34,6 +34,13 @@ CompressSirius::CompressSirius(const Params ¶meters) m_TierBuffers.resize(m_Tiers); } +CompressSirius::CompressSirius() : Operator("sirius") +{ + m_Tiers = 4; + m_TierBuffersMap.resize(m_Tiers); + m_TierBuffers.resize(m_Tiers); +} + size_t CompressSirius::Operate(const char *dataIn, const Dims &blockStart, const Dims &blockCount, const DataType varType, char *bufferOut, const Params ¶ms) diff --git a/source/adios2/operator/compress/CompressSirius.h b/source/adios2/operator/compress/CompressSirius.h index a34c99c00b..0f210e8c01 100644 --- a/source/adios2/operator/compress/CompressSirius.h +++ b/source/adios2/operator/compress/CompressSirius.h @@ -27,6 +27,8 @@ class CompressSirius : public Operator public: CompressSirius(const Params ¶meters); + CompressSirius(); + ~CompressSirius() = default; size_t Operate(const char *dataIn, const Dims &blockStart, diff --git a/source/adios2/operator/compress/CompressorFactory.cpp b/source/adios2/operator/compress/CompressorFactory.cpp index d90676d8ba..37fcf8776e 100644 --- a/source/adios2/operator/compress/CompressorFactory.cpp +++ b/source/adios2/operator/compress/CompressorFactory.cpp @@ -158,6 +158,16 @@ size_t CompressorFactory::Decompress(const char *bufferIn, const size_t sizeIn, #else throw std::runtime_error("ERROR: current ADIOS2 library didn't compile " "with PNG, can't use compressor\n"); +#endif + } + else if (compressorType == Operator::OperatorType::SIRIUS) + { +#ifdef ADIOS2_HAVE_MHS + compress::CompressSirius op; + return op.InverseOperate(bufferIn, sizeIn, dataOut); +#else + throw std::runtime_error("ERROR: current ADIOS2 library didn't compile " + "with MHS, can't use Sirius compressor\n"); #endif } else if (compressorType == Operator::OperatorType::Sz)