Skip to content

Commit

Permalink
Merge pull request #3113 from JasonRuonanWang/MgardPlus
Browse files Browse the repository at this point in the history
added bp file reading in MgardPlus
  • Loading branch information
JasonRuonanWang committed Mar 17, 2022
2 parents 9c95a0a + 89c5d1f commit 032af87
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions source/adios2/operator/compress/CompressMGARDPlus.cpp
Expand Up @@ -10,6 +10,7 @@

#include "CompressMGARDPlus.h"
#include "CompressMGARD.h"
#include "adios2/core/Engine.h"
#include "adios2/helper/adiosFunctions.h"

namespace adios2
Expand All @@ -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<float>(m_Parameters["MeshVariable"]);
std::vector<float> data(std::accumulate(var->m_Shape.begin(),
var->m_Shape.end(), sizeof(float),
std::multiplies<size_t>()));
engine->Get(*var, data);
// Read ADIOS2 files end, use data for your algorithm

size_t bufferOutOffset = 0;
const uint8_t bufferVersion = 1;

Expand Down

0 comments on commit 032af87

Please sign in to comment.