From ef2042fd461b6e6d2737682d8277ca8f86d5db43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Wed, 16 Jul 2025 11:48:33 +0200 Subject: [PATCH 1/2] Deactivate Span API by default in BP5 --- src/IO/ADIOS/ADIOS2IOHandler.cpp | 16 +++++++++++++++- .../iterate_nonstreaming_series.cpp | 12 +++++++++++- test/SerialIOTest.cpp | 11 ++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/IO/ADIOS/ADIOS2IOHandler.cpp b/src/IO/ADIOS/ADIOS2IOHandler.cpp index 44e862ffe2..6be0413945 100644 --- a/src/IO/ADIOS/ADIOS2IOHandler.cpp +++ b/src/IO/ADIOS/ADIOS2IOHandler.cpp @@ -1247,6 +1247,11 @@ void ADIOS2IOHandlerImpl::getBufferView( Writable *writable, Parameter ¶meters) { // @todo check access mode + /* + * We will check BP5 again below. BP5 fundamentally supports the Span API, + * but runs into this bug https://github.com/ornladios/ADIOS2/issues/4586, + * so we treat the Span API as opt-in there. + */ std::string optInEngines[] = {"bp4", "bp5", "file", "filestream"}; if (std::none_of( begin(optInEngines), @@ -1270,7 +1275,16 @@ void ADIOS2IOHandlerImpl::getBufferView( return; case UseSpan::Auto: if (switchAdios2VariableType( - parameters.dtype, name, ba.m_IO)) + parameters.dtype, name, ba.m_IO) +#if ( \ + ADIOS2_VERSION_MAJOR * 1000 + ADIOS2_VERSION_MINOR * 10 + \ + ADIOS2_VERSION_PATCH) <= 2102 + || + // Deactivate the Span API in BP5 by default due to this bug + // https://github.com/ornladios/ADIOS2/issues/4586, + this->realEngineType() == "bp5" +#endif + ) { parameters.out->backendManagedBuffer = false; return; diff --git a/test/Files_ParallelIO/iterate_nonstreaming_series.cpp b/test/Files_ParallelIO/iterate_nonstreaming_series.cpp index acce61a162..0d14c3b5d0 100644 --- a/test/Files_ParallelIO/iterate_nonstreaming_series.cpp +++ b/test/Files_ParallelIO/iterate_nonstreaming_series.cpp @@ -21,7 +21,17 @@ static auto run_test( size_t const extent = base_extent * size_t(mpi_size); { - Series writeSeries(file, Access::CREATE, MPI_COMM_WORLD, jsonConfig); + Series writeSeries( + file, + Access::CREATE, + MPI_COMM_WORLD, + /* + * The ADIOS2 backend deactivates the Span API by default due to + * this bug: https://github.com/ornladios/ADIOS2/issues/4586. + * For this test, we enable it. + */ + json::merge( + jsonConfig, R"({"adios2":{"use_span_based_put": true}})")); if (variableBasedLayout) { writeSeries.setIterationEncoding(IterationEncoding::variableBased); diff --git a/test/SerialIOTest.cpp b/test/SerialIOTest.cpp index e4b3dead4f..b12f904487 100644 --- a/test/SerialIOTest.cpp +++ b/test/SerialIOTest.cpp @@ -6394,7 +6394,16 @@ void iterate_nonstreaming_series( { constexpr size_t extent = 100; { - Series writeSeries(file, Access::CREATE, jsonConfig); + Series writeSeries( + file, + Access::CREATE, + /* + * The ADIOS2 backend deactivates the Span API by default due to + * this bug: https://github.com/ornladios/ADIOS2/issues/4586. + * For this test, we enable it. + */ + json::merge( + jsonConfig, R"({"adios2":{"use_span_based_put": true}})")); if (variableBasedLayout) { writeSeries.setIterationEncoding(IterationEncoding::variableBased); From 51bdcd746e3bef53f40e06d990e26d0c3545454a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 17 Jul 2025 16:54:22 +0200 Subject: [PATCH 2/2] Link the fix PR --- src/IO/ADIOS/ADIOS2IOHandler.cpp | 2 ++ test/Files_ParallelIO/iterate_nonstreaming_series.cpp | 3 ++- test/SerialIOTest.cpp | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/IO/ADIOS/ADIOS2IOHandler.cpp b/src/IO/ADIOS/ADIOS2IOHandler.cpp index 6be0413945..71e0e93bfa 100644 --- a/src/IO/ADIOS/ADIOS2IOHandler.cpp +++ b/src/IO/ADIOS/ADIOS2IOHandler.cpp @@ -1250,6 +1250,7 @@ void ADIOS2IOHandlerImpl::getBufferView( /* * We will check BP5 again below. BP5 fundamentally supports the Span API, * but runs into this bug https://github.com/ornladios/ADIOS2/issues/4586, + * fixed by https://github.com/ornladios/ADIOS2/pull/4587, * so we treat the Span API as opt-in there. */ std::string optInEngines[] = {"bp4", "bp5", "file", "filestream"}; @@ -1282,6 +1283,7 @@ void ADIOS2IOHandlerImpl::getBufferView( || // Deactivate the Span API in BP5 by default due to this bug // https://github.com/ornladios/ADIOS2/issues/4586, + // fixed by https://github.com/ornladios/ADIOS2/pull/4587 this->realEngineType() == "bp5" #endif ) diff --git a/test/Files_ParallelIO/iterate_nonstreaming_series.cpp b/test/Files_ParallelIO/iterate_nonstreaming_series.cpp index 0d14c3b5d0..32c4684875 100644 --- a/test/Files_ParallelIO/iterate_nonstreaming_series.cpp +++ b/test/Files_ParallelIO/iterate_nonstreaming_series.cpp @@ -27,7 +27,8 @@ static auto run_test( MPI_COMM_WORLD, /* * The ADIOS2 backend deactivates the Span API by default due to - * this bug: https://github.com/ornladios/ADIOS2/issues/4586. + * this bug: https://github.com/ornladios/ADIOS2/issues/4586, + * fixed by https://github.com/ornladios/ADIOS2/pull/4587. * For this test, we enable it. */ json::merge( diff --git a/test/SerialIOTest.cpp b/test/SerialIOTest.cpp index b12f904487..5f4b0787de 100644 --- a/test/SerialIOTest.cpp +++ b/test/SerialIOTest.cpp @@ -6399,7 +6399,8 @@ void iterate_nonstreaming_series( Access::CREATE, /* * The ADIOS2 backend deactivates the Span API by default due to - * this bug: https://github.com/ornladios/ADIOS2/issues/4586. + * this bug: https://github.com/ornladios/ADIOS2/issues/4586, + * fixed by https://github.com/ornladios/ADIOS2/pull/4587. * For this test, we enable it. */ json::merge(