Skip to content

Commit 2774be1

Browse files
committed
readDataset: use step selection from time of enqueuing
1 parent 08d2179 commit 2774be1

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

include/openPMD/IO/ADIOS/ADIOS2File.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ struct BufferedGet : BufferedAction
6767
{
6868
std::string name;
6969
Parameter<Operation::READ_DATASET> param;
70+
std::optional<size_t> stepSelection;
7071

7172
void run(ADIOS2File &) override;
7273
};

src/IO/ADIOS/ADIOS2File.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void BufferedGet::run(ADIOS2File &ba)
146146
ba.m_IO,
147147
ba.getEngine(),
148148
ba.m_file,
149-
ba.stepSelection());
149+
this->stepSelection);
150150
}
151151

152152
void BufferedPut::run(ADIOS2File &ba)

src/IO/ADIOS/ADIOS2IOHandler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,9 @@ void ADIOS2IOHandlerImpl::readDataset(
10791079
detail::BufferedGet bg;
10801080
bg.name = nameOfVariable(writable);
10811081
bg.param = parameters;
1082+
// need to store the current step selection for deferred reads as the step
1083+
// selection might change again before flushing
1084+
bg.stepSelection = ba.stepSelection();
10821085
ba.enqueue(std::move(bg));
10831086
m_dirty.emplace(std::move(file));
10841087
}

0 commit comments

Comments
 (0)