Skip to content

Commit

Permalink
Merge pull request #3201 from JasonRuonanWang/struct
Browse files Browse the repository at this point in the history
added allowReorganize for InquireStructVariable
  • Loading branch information
JasonRuonanWang authored May 4, 2022
2 parents ad39c37 + 2cff680 commit 04918d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions source/adios2/core/IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,8 @@ VariableStruct *IO::InquireStructVariable(const std::string &name) noexcept
}

VariableStruct *IO::InquireStructVariable(const std::string &name,
const StructDefinition &def) noexcept
const StructDefinition &def,
const bool allowReorganize) noexcept
{
auto ret = InquireStructVariable(name);
if (ret == nullptr)
Expand All @@ -949,7 +950,8 @@ VariableStruct *IO::InquireStructVariable(const std::string &name,
{
return nullptr;
}
if (ret->m_StructDefinition.Offset(i) != def.Offset(i))
if (ret->m_StructDefinition.Offset(i) != def.Offset(i) &&
!allowReorganize)
{
return nullptr;
}
Expand Down
5 changes: 3 additions & 2 deletions source/adios2/core/IO.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ class IO

VariableStruct *InquireStructVariable(const std::string &name) noexcept;

VariableStruct *InquireStructVariable(const std::string &name,
const StructDefinition &def) noexcept;
VariableStruct *
InquireStructVariable(const std::string &name, const StructDefinition &def,
const bool allowReorganize = false) noexcept;

/**
* @brief Returns the type of an existing variable as an string
Expand Down

0 comments on commit 04918d7

Please sign in to comment.