From 58a59960a85f3d86174316898b6c52757e9defd3 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Tue, 28 Sep 2021 01:49:59 -0400 Subject: [PATCH] removed BPZFP.tcc --- source/adios2/CMakeLists.txt | 1 - .../format/bp/bpOperation/compress/BPZFP.cpp | 3 +- .../format/bp/bpOperation/compress/BPZFP.tcc | 84 ------------------- 3 files changed, 1 insertion(+), 87 deletions(-) delete mode 100644 source/adios2/toolkit/format/bp/bpOperation/compress/BPZFP.tcc diff --git a/source/adios2/CMakeLists.txt b/source/adios2/CMakeLists.txt index ec9a6a814b..8e1a9c131a 100644 --- a/source/adios2/CMakeLists.txt +++ b/source/adios2/CMakeLists.txt @@ -73,7 +73,6 @@ add_library(adios2_core toolkit/format/bp/bpOperation/BPOperation.cpp toolkit/format/bp/bpOperation/BPOperation.tcc toolkit/format/bp/bpOperation/compress/BPZFP.cpp - toolkit/format/bp/bpOperation/compress/BPZFP.tcc toolkit/format/bp/bpOperation/compress/BPSZ.cpp toolkit/format/bp/bpOperation/compress/BPSirius.cpp toolkit/format/bp/bpOperation/compress/BPMGARD.cpp diff --git a/source/adios2/toolkit/format/bp/bpOperation/compress/BPZFP.cpp b/source/adios2/toolkit/format/bp/bpOperation/compress/BPZFP.cpp index a13dfccf69..bcf9dbcf21 100644 --- a/source/adios2/toolkit/format/bp/bpOperation/compress/BPZFP.cpp +++ b/source/adios2/toolkit/format/bp/bpOperation/compress/BPZFP.cpp @@ -9,7 +9,6 @@ */ #include "BPZFP.h" -#include "BPZFP.tcc" #include "adios2/helper/adiosFunctions.h" #include "adios2/helper/adiosType.h" @@ -39,7 +38,7 @@ namespace format const typename core::Variable::Operation &operation, \ std::vector &buffer) const noexcept \ { \ - SetMetadataCommon(variable, blockInfo, operation, buffer); \ + SetMetadataDefault(variable, blockInfo, operation, buffer); \ } \ \ void BPZFP::UpdateMetadata( \ diff --git a/source/adios2/toolkit/format/bp/bpOperation/compress/BPZFP.tcc b/source/adios2/toolkit/format/bp/bpOperation/compress/BPZFP.tcc deleted file mode 100644 index 8b03a70900..0000000000 --- a/source/adios2/toolkit/format/bp/bpOperation/compress/BPZFP.tcc +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Distributed under the OSI-approved Apache License, Version 2.0. See - * accompanying file Copyright.txt for details. - * - * BPZFP.tcc : - * - * Created on: Jul 18, 2018 - * Author: William F Godoy godoywf@ornl.gov - */ - -#ifndef ADIOS2_TOOLKIT_FORMAT_BP_BPOPERATION_COMPRESS_BPZFP_TCC_ -#define ADIOS2_TOOLKIT_FORMAT_BP_BPOPERATION_COMPRESS_BPZFP_TCC_ - -#include "BPZFP.h" - -#include "adios2/helper/adiosFunctions.h" - -namespace adios2 -{ -namespace format -{ - -template -void BPZFP::SetMetadataCommon( - const core::Variable &variable, - const typename core::Variable::BPInfo &blockInfo, - const typename core::Variable::Operation &operation, - std::vector &buffer) const noexcept -{ - const uint64_t inputSize = - helper::GetTotalSize(blockInfo.Count) * sizeof(T); - // being naughty here - Params &info = const_cast(operation.Info); - info["InputSize"] = std::to_string(inputSize); - - const uint64_t outputSize = 0; // not known yet - - auto itMode = operation.Parameters.find("accuracy"); - int32_t mode = -1; - - if (itMode != operation.Parameters.end()) - { - mode = static_cast(zfp_mode_accuracy); - } - else - { - itMode = operation.Parameters.find("precision"); - if (itMode != operation.Parameters.end()) - { - mode = static_cast(zfp_mode_precision); - } - else - { - itMode = operation.Parameters.find("rate"); - if (itMode != operation.Parameters.end()) - { - mode = static_cast(zfp_mode_rate); - } - } - } - const std::string modeStr = itMode->second; - - // fixed size - constexpr uint16_t metadataSize = 532; - helper::InsertToBuffer(buffer, &metadataSize); - helper::InsertToBuffer(buffer, &inputSize); - // to be filled out after operation is applied on data - info["OutputSizeMetadataPosition"] = std::to_string(buffer.size()); - helper::InsertToBuffer(buffer, &outputSize); - helper::InsertToBuffer(buffer, &mode); - - const size_t fixedRecordsPosition = buffer.size(); - buffer.resize(fixedRecordsPosition + 512, '\0'); - size_t backPosition = fixedRecordsPosition; - helper::CopyToBuffer(buffer, backPosition, modeStr.data(), modeStr.size()); - backPosition = fixedRecordsPosition + 256; - helper::CopyToBuffer(buffer, backPosition, variable.m_Name.data(), - variable.m_Name.size()); -} - -} // end namespace format -} // end namespace adios2 - -#endif /* ADIOS2_TOOLKIT_FORMAT_BP_BPOPERATION_COMPRESS_BPZFP_TCC_ */