From 89c5d1f048469cfd86c265c6c55b26978d9d53cc Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 16 Mar 2022 20:39:26 -0400 Subject: [PATCH] added bp file reading in MgardPlus --- .../adios2/operator/compress/CompressMGARDPlus.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/adios2/operator/compress/CompressMGARDPlus.cpp b/source/adios2/operator/compress/CompressMGARDPlus.cpp index 13dc8728ac..24d70f04e3 100644 --- a/source/adios2/operator/compress/CompressMGARDPlus.cpp +++ b/source/adios2/operator/compress/CompressMGARDPlus.cpp @@ -10,6 +10,7 @@ #include "CompressMGARDPlus.h" #include "CompressMGARD.h" +#include "adios2/core/Engine.h" #include "adios2/helper/adiosFunctions.h" namespace adios2 @@ -28,6 +29,18 @@ size_t CompressMGARDPlus::Operate(const char *dataIn, const Dims &blockStart, const Dims &blockCount, const DataType type, char *bufferOut) { + + // Read ADIOS2 files from here + adios2::core::ADIOS adios("C++"); + auto &io = adios.DeclareIO("SubIO"); + auto *engine = &io.Open(m_Parameters["MeshFile"], adios2::Mode::Read); + auto var = io.InquireVariable(m_Parameters["MeshVariable"]); + std::vector data(std::accumulate(var->m_Shape.begin(), + var->m_Shape.end(), sizeof(float), + std::multiplies())); + engine->Get(*var, data); + // Read ADIOS2 files end, use data for your algorithm + size_t bufferOutOffset = 0; const uint8_t bufferVersion = 1;