Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added bp file reading in MgardPlus #3113

Merged
merged 1 commit into from Mar 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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