Skip to content

Commit

Permalink
Merge pull request #3157 from JasonRuonanWang/MgardPlus
Browse files Browse the repository at this point in the history
MgardPlus: check for empty mesh file
  • Loading branch information
JasonRuonanWang authored Apr 4, 2022
2 parents 6313d31 + d4a52b2 commit c285239
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions source/adios2/operator/compress/CompressMGARDPlus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ size_t CompressMGARDPlus::Operate(const char *dataIn, const Dims &blockStart,
{

// 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);
if (!m_Parameters["MeshFile"].empty())
{
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;
Expand Down

0 comments on commit c285239

Please sign in to comment.