From 558a773bbf0b862d58c1300e5e0d9ca6a6c81692 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Mon, 20 Sep 2021 22:46:47 -0400 Subject: [PATCH] removed unused functions in operator classes --- source/adios2/core/Operator.cpp | 26 ----------------- source/adios2/core/Operator.h | 29 ------------------- .../operator/compress/CompressBZIP2.cpp | 5 ---- .../adios2/operator/compress/CompressBZIP2.h | 2 -- .../operator/compress/CompressBlosc.cpp | 19 ------------ .../adios2/operator/compress/CompressBlosc.h | 2 -- .../operator/compress/CompressLibPressio.cpp | 5 ---- .../operator/compress/CompressLibPressio.h | 2 -- .../adios2/operator/compress/CompressSZ.cpp | 5 ---- source/adios2/operator/compress/CompressSZ.h | 2 -- .../adios2/operator/compress/CompressZFP.cpp | 13 --------- source/adios2/operator/compress/CompressZFP.h | 3 -- 12 files changed, 113 deletions(-) diff --git a/source/adios2/core/Operator.cpp b/source/adios2/core/Operator.cpp index 4d5eacbe46..692f7a5545 100644 --- a/source/adios2/core/Operator.cpp +++ b/source/adios2/core/Operator.cpp @@ -51,24 +51,6 @@ void Operator::RunCallback2(void *arg0, const std::string &arg1, CheckCallbackType("Callback2"); } -size_t Operator::BufferMaxSize(const size_t sizeIn) const -{ - throw std::invalid_argument("ERROR: signature (const size_t) not supported " - "by derived class implemented with " + - m_Type + ", in call to BufferMaxSize\n"); -} - -#define declare_type(T) \ - template <> \ - size_t Operator::BufferMaxSize(const T *dataIn, const Dims &dimensions, \ - const Params ¶meters) const \ - { \ - return DoBufferMaxSize(dataIn, dimensions, helper::GetDataType(), \ - parameters); \ - } -ADIOS2_FOREACH_ZFP_TYPE_1ARG(declare_type) -#undef declare_type - size_t Operator::Compress(const void * /*dataIn*/, const Dims & /*dimensions*/, DataType /*type*/, void * /*bufferOut*/, const Params & /*params*/, Params & /*info*/) @@ -92,14 +74,6 @@ size_t Operator::Decompress(const void *bufferIn, const size_t sizeIn, } // PROTECTED -size_t Operator::DoBufferMaxSize(const void *dataIn, const Dims &dimensions, - DataType type, const Params ¶meters) const -{ - throw std::invalid_argument("ERROR: signature (const void*, const Dims& " - "std::string ) not supported " - "by derived class implemented with " + - m_Type + ", in call to BufferMaxSize\n"); -} Dims Operator::ConvertDims(const Dims &dimensions, const DataType type, const size_t targetDims, const bool enforceDims, diff --git a/source/adios2/core/Operator.h b/source/adios2/core/Operator.h index 81a7a74aa9..09326808f9 100644 --- a/source/adios2/core/Operator.h +++ b/source/adios2/core/Operator.h @@ -57,23 +57,6 @@ class Operator virtual void RunCallback2(void *, const std::string &, const std::string &, const std::string &, const size_t, const Dims &, const Dims &, const Dims &) const; - /** - * Returns a conservative buffer size to hold input data for classes - * @param sizeIn size of input data to be compressed in bytes - * @return recommended allocation for output buffer - */ - virtual size_t BufferMaxSize(const size_t sizeIn) const; - - /** - * Used by Zfp - * Returns a conservative buffer size to hold input data for classes - * @param dataIn - * @param dimensions - * @return recommended allocation for output buffer in bytes - */ - template - size_t BufferMaxSize(const T *dataIn, const Dims &dimensions, - const Params ¶ms) const; /** * @param dataIn @@ -98,18 +81,6 @@ class Operator /** Parameters associated with a particular Operator */ Params m_Parameters; - /** - * Used by CompressZfp - * Returns a conservative buffer size to hold input data for classes - * @param dataIn - * @param dimensions - * @param type - * @return conservative buffer size for allocation - */ - virtual size_t DoBufferMaxSize(const void *dataIn, const Dims &dimensions, - DataType type, - const Params ¶meters) const; - /** * Used by lossy compressors with a limitation on complex data types or * dimentions Returns a adios2::Dims object that meets the requirement of a diff --git a/source/adios2/operator/compress/CompressBZIP2.cpp b/source/adios2/operator/compress/CompressBZIP2.cpp index e7931f0280..bd57e972e7 100644 --- a/source/adios2/operator/compress/CompressBZIP2.cpp +++ b/source/adios2/operator/compress/CompressBZIP2.cpp @@ -32,11 +32,6 @@ CompressBZIP2::CompressBZIP2(const Params ¶meters) { } -size_t CompressBZIP2::BufferMaxSize(const size_t sizeIn) const -{ - return static_cast(std::ceil(1.1 * sizeIn) + 600); -} - size_t CompressBZIP2::Compress(const void *dataIn, const Dims &dimensions, DataType type, void *bufferOut, const Params ¶meters, Params &info) diff --git a/source/adios2/operator/compress/CompressBZIP2.h b/source/adios2/operator/compress/CompressBZIP2.h index b1ae536cc7..d40a30af35 100644 --- a/source/adios2/operator/compress/CompressBZIP2.h +++ b/source/adios2/operator/compress/CompressBZIP2.h @@ -31,8 +31,6 @@ class CompressBZIP2 : public Operator ~CompressBZIP2() = default; - size_t BufferMaxSize(const size_t sizeIn) const final; - /** * Compression signature for legacy libraries that use void* * @param dataIn diff --git a/source/adios2/operator/compress/CompressBlosc.cpp b/source/adios2/operator/compress/CompressBlosc.cpp index 905e7b67d5..f1e98948ca 100644 --- a/source/adios2/operator/compress/CompressBlosc.cpp +++ b/source/adios2/operator/compress/CompressBlosc.cpp @@ -42,25 +42,6 @@ CompressBlosc::CompressBlosc(const Params ¶meters) { } -size_t CompressBlosc::BufferMaxSize(const size_t sizeIn) const -{ - const size_t maxInputPerChunk = BLOSC_MAX_BUFFERSIZE; - const size_t numFullChunks = sizeIn / maxInputPerChunk; - const size_t sizeLastChunk = sizeIn % maxInputPerChunk; - - const size_t maxOutputPerChunk = maxInputPerChunk + BLOSC_MAX_OVERHEAD; - const size_t maxOutputLastChunk = sizeLastChunk + BLOSC_MAX_OVERHEAD; - - /* DataHeader is used to detect of old format which can only handle - * BLOSC_MAX_BUFFERSIZE (<2GiB) or the new adios2 chunked blosc format is - * used. - */ - const size_t maxRquiredDataMem = maxOutputPerChunk * numFullChunks + - maxOutputLastChunk + sizeof(DataHeader); - - return maxRquiredDataMem; -} - size_t CompressBlosc::Compress(const void *dataIn, const Dims &dimensions, DataType type, void *bufferOut, const Params ¶meters, Params &info) diff --git a/source/adios2/operator/compress/CompressBlosc.h b/source/adios2/operator/compress/CompressBlosc.h index d26644cbfb..46f3e0fe57 100644 --- a/source/adios2/operator/compress/CompressBlosc.h +++ b/source/adios2/operator/compress/CompressBlosc.h @@ -43,8 +43,6 @@ class CompressBlosc : public Operator ~CompressBlosc() = default; - size_t BufferMaxSize(const size_t sizeIn) const final; - /** * Compression signature for legacy libraries that use void* * @param dataIn diff --git a/source/adios2/operator/compress/CompressLibPressio.cpp b/source/adios2/operator/compress/CompressLibPressio.cpp index 8630820b1c..436d2ed949 100644 --- a/source/adios2/operator/compress/CompressLibPressio.cpp +++ b/source/adios2/operator/compress/CompressLibPressio.cpp @@ -285,11 +285,6 @@ CompressLibPressio::CompressLibPressio(const Params ¶meters) { } -size_t CompressLibPressio::BufferMaxSize(const size_t sizeIn) const -{ - return static_cast(std::ceil(1.1 * sizeIn) + 600); -} - size_t CompressLibPressio::Compress(const void *dataIn, const Dims &dimensions, DataType varType, void *bufferOut, const Params ¶meters, Params &info) diff --git a/source/adios2/operator/compress/CompressLibPressio.h b/source/adios2/operator/compress/CompressLibPressio.h index d2be0d30e2..65094d55a1 100644 --- a/source/adios2/operator/compress/CompressLibPressio.h +++ b/source/adios2/operator/compress/CompressLibPressio.h @@ -31,8 +31,6 @@ class CompressLibPressio : public Operator ~CompressLibPressio() = default; - size_t BufferMaxSize(const size_t sizeIn) const final; - /** * Compression signature for legacy libraries that use void* * @param dataIn diff --git a/source/adios2/operator/compress/CompressSZ.cpp b/source/adios2/operator/compress/CompressSZ.cpp index 8cf008da61..a8a5e4de31 100644 --- a/source/adios2/operator/compress/CompressSZ.cpp +++ b/source/adios2/operator/compress/CompressSZ.cpp @@ -29,11 +29,6 @@ namespace compress CompressSZ::CompressSZ(const Params ¶meters) : Operator("sz", parameters) {} -size_t CompressSZ::BufferMaxSize(const size_t sizeIn) const -{ - return static_cast(std::ceil(1.1 * sizeIn) + 600); -} - size_t CompressSZ::Compress(const void *dataIn, const Dims &dimensions, DataType varType, void *bufferOut, const Params ¶meters, Params &info) diff --git a/source/adios2/operator/compress/CompressSZ.h b/source/adios2/operator/compress/CompressSZ.h index 604ea3b787..c0d31099ba 100644 --- a/source/adios2/operator/compress/CompressSZ.h +++ b/source/adios2/operator/compress/CompressSZ.h @@ -31,8 +31,6 @@ class CompressSZ : public Operator ~CompressSZ() = default; - size_t BufferMaxSize(const size_t sizeIn) const final; - /** * Compression signature for legacy libraries that use void* * @param dataIn diff --git a/source/adios2/operator/compress/CompressZFP.cpp b/source/adios2/operator/compress/CompressZFP.cpp index af2b3110d5..35ba0e7429 100644 --- a/source/adios2/operator/compress/CompressZFP.cpp +++ b/source/adios2/operator/compress/CompressZFP.cpp @@ -22,19 +22,6 @@ CompressZFP::CompressZFP(const Params ¶meters) : Operator("zfp", parameters) { } -size_t CompressZFP::DoBufferMaxSize(const void *dataIn, const Dims &dimensions, - DataType type, - const Params ¶meters) const -{ - Dims convertedDims = ConvertDims(dimensions, type, 3); - zfp_field *field = GetZFPField(dataIn, convertedDims, type); - zfp_stream *stream = GetZFPStream(convertedDims, type, parameters); - const size_t maxSize = zfp_stream_maximum_size(stream, field); - zfp_field_free(field); - zfp_stream_close(stream); - return maxSize; -} - size_t CompressZFP::Compress(const void *dataIn, const Dims &dimensions, DataType type, void *bufferOut, const Params ¶meters, Params &info) diff --git a/source/adios2/operator/compress/CompressZFP.h b/source/adios2/operator/compress/CompressZFP.h index 42f3c27c54..01326b286b 100644 --- a/source/adios2/operator/compress/CompressZFP.h +++ b/source/adios2/operator/compress/CompressZFP.h @@ -88,9 +88,6 @@ class CompressZFP : public Operator zfp_stream *GetZFPStream(const Dims &dimensions, DataType type, const Params ¶meters) const; - size_t DoBufferMaxSize(const void *dataIn, const Dims &dimensions, - DataType type, const Params ¶meters) const final; - /** * check status from BZip compression and decompression functions * @param status returned by BZip2 library