Skip to content

Commit 1208c03

Browse files
Add API call to reset memory selection (#4169)
* Add API to reset memory selection
1 parent 90b8ab0 commit 1208c03

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

bindings/CXX11/adios2/cxx11/Variable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class Variable
214214
* variable.Count() = {Ny,Nx}, then memoryCount = {Ny+2,Nx+2}
215215
* </pre>
216216
*/
217-
void SetMemorySelection(const adios2::Box<adios2::Dims> &memorySelection);
217+
void SetMemorySelection(const adios2::Box<adios2::Dims> &memorySelection = {{}, {}});
218218

219219
/**
220220
* Sets a step selection modifying current startStep, countStep

source/adios2/core/VariableBase.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@ void VariableBase::SetMemorySelection(const Box<Dims> &memorySelection)
221221
const Dims &memoryStart = memorySelection.first;
222222
const Dims &memoryCount = memorySelection.second;
223223

224+
if (memoryStart.empty() && memoryCount.empty())
225+
{
226+
m_MemoryStart.clear();
227+
m_MemoryCount.clear();
228+
return;
229+
}
230+
224231
if (m_SingleValue)
225232
{
226233
helper::Throw<std::invalid_argument>("Core", "VariableBase", "SetMemorySelection",

0 commit comments

Comments
 (0)