Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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