Skip to content

Commit 1639103

Browse files
committed
Remove manual step counting
m_currentStep only necessary for SetStepSelection, it seems
1 parent 04d0627 commit 1639103

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/IO/ADIOS/ADIOS2File.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,6 @@ void ADIOS2File::flush_impl(ADIOS2FlushParams flushParams, bool writeLatePuts)
11721172
}
11731173
engine.EndStep();
11741174
engine.BeginStep();
1175-
// ++m_currentStep; // think we should keep this as the logical step
11761175
m_uniquePtrPuts.clear();
11771176
uncommittedAttributes.clear();
11781177
m_updateSpans.clear();
@@ -1257,14 +1256,14 @@ AdvanceStatus ADIOS2File::advance(AdvanceMode mode)
12571256
uncommittedAttributes.clear();
12581257
m_updateSpans.clear();
12591258
streamStatus = StreamStatus::OutsideOfStep;
1260-
++m_currentStep;
12611259
return AdvanceStatus::OK;
12621260
}
12631261
case AdvanceMode::BEGINSTEP: {
12641262
adios2::StepStatus adiosStatus{};
1263+
auto &engine = getEngine();
12651264

12661265
auto check_bp5 = [&]() -> bool {
1267-
std::string engineType = getEngine().Type();
1266+
std::string engineType = engine.Type();
12681267
std::transform(
12691268
engineType.begin(),
12701269
engineType.end(),
@@ -1273,7 +1272,7 @@ AdvanceStatus ADIOS2File::advance(AdvanceMode mode)
12731272
return engineType == "bp5writer";
12741273
};
12751274

1276-
if (this->m_currentStep == 0)
1275+
if (engine.CurrentStep() == 0)
12771276
{
12781277
int max_steps_from_env =
12791278
auxiliary::getEnvNum("OPENPMD_BP5_GROUPENCODING_MAX_STEPS", -1);
@@ -1293,7 +1292,7 @@ AdvanceStatus ADIOS2File::advance(AdvanceMode mode)
12931292
if (this->m_impl->m_handler->m_encoding ==
12941293
IterationEncoding::groupBased &&
12951294
this->m_max_steps_bp5.has_value() &&
1296-
this->m_currentStep >= *this->m_max_steps_bp5 &&
1295+
engine.CurrentStep() >= *this->m_max_steps_bp5 &&
12971296
(this->m_mode == adios2::Mode::Write ||
12981297
this->m_mode == adios2::Mode::Append) &&
12991298
check_bp5())
@@ -1329,7 +1328,7 @@ Be aware of the performance implications described above.)");
13291328

13301329
if (streamStatus != StreamStatus::DuringStep)
13311330
{
1332-
adiosStatus = getEngine().BeginStep();
1331+
adiosStatus = engine.BeginStep();
13331332
}
13341333
else
13351334
{

0 commit comments

Comments
 (0)