Skip to content

Commit

Permalink
Add API call to reset memory selection (ornladios#4169)
Browse files Browse the repository at this point in the history
* Add API to reset memory selection
  • Loading branch information
franzpoeschel authored and vicentebolea committed May 28, 2024
1 parent ee179ef commit 83112ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/CXX11/adios2/cxx11/Variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Variable
* variable.Count() = {Ny,Nx}, then memoryCount = {Ny+2,Nx+2}
* </pre>
*/
void SetMemorySelection(const adios2::Box<adios2::Dims> &memorySelection);
void SetMemorySelection(const adios2::Box<adios2::Dims> &memorySelection = {{}, {}});

/**
* Sets a step selection modifying current startStep, countStep
Expand Down
7 changes: 7 additions & 0 deletions source/adios2/core/VariableBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ void VariableBase::SetMemorySelection(const Box<Dims> &memorySelection)
const Dims &memoryStart = memorySelection.first;
const Dims &memoryCount = memorySelection.second;

if (memoryStart.empty() && memoryCount.empty())
{
m_MemoryStart.clear();
m_MemoryCount.clear();
return;
}

if (m_SingleValue)
{
helper::Throw<std::invalid_argument>("Core", "VariableBase", "SetMemorySelection",
Expand Down

0 comments on commit 83112ab

Please sign in to comment.