diff --git a/src/IO/ADIOS/ADIOS2IOHandler.cpp b/src/IO/ADIOS/ADIOS2IOHandler.cpp index 08fac073cf..9d19d97013 100644 --- a/src/IO/ADIOS/ADIOS2IOHandler.cpp +++ b/src/IO/ADIOS/ADIOS2IOHandler.cpp @@ -90,7 +90,7 @@ ADIOS2IOHandlerImpl::ADIOS2IOHandlerImpl( MPI_Comm_rank(communicator, &rank); auto throw_error = []() { throw error::BackendConfigSchema( - {"adios2", "attribute_writing_ranks"}, + {"attribute_writing_ranks"}, "Type must be either an integer or an array of integers."); }; if (attribute_writing_ranks.is_array()) @@ -178,6 +178,8 @@ template void ADIOS2IOHandlerImpl::init( json::TracingJSON cfg, Callback &&callbackWriteAttributesFromRank) { + std::cout << "Initializing ADIOS2 with config:\n" + << cfg.json() << std::endl; // allow overriding through environment variable m_engineType = auxiliary::getEnvString("OPENPMD_ADIOS2_ENGINE", m_engineType); @@ -196,6 +198,12 @@ void ADIOS2IOHandlerImpl::init( groupTableViaEnv == 0 ? UseGroupTable::No : UseGroupTable::Yes; } + // Backend-independent options with backend-dependent implementations + if (cfg.json().contains("attribute_writing_ranks")) + { + callbackWriteAttributesFromRank(cfg["attribute_writing_ranks"].json()); + } + if (cfg.json().contains("adios2")) { m_config = cfg["adios2"]; diff --git a/src/Series.cpp b/src/Series.cpp index 84758aaac0..b17d0d9407 100644 --- a/src/Series.cpp +++ b/src/Series.cpp @@ -2175,6 +2175,21 @@ namespace template void Series::parseJsonOptions(TracingJSON &options, ParsedInput &input) { + constexpr std::array + backend_independent_options_with_backend_specific_implementation = { + "attribute_writing_ranks"}; + + for (auto const &opt : + backend_independent_options_with_backend_specific_implementation) + { + // Suppress warnings for these options: The backends might or might not + // take those hints + if (options.json().contains(opt)) + { + options[opt]; + } + } + auto &series = get(); getJsonOption( options, "defer_iteration_parsing", series.m_parseLazily); diff --git a/test/ParallelIOTest.cpp b/test/ParallelIOTest.cpp index a82a300b0e..92f01c2e45 100644 --- a/test/ParallelIOTest.cpp +++ b/test/ParallelIOTest.cpp @@ -1173,9 +1173,10 @@ doshuffle = "BLOSC_BITSHUFFLE" std::string writeConfigBP4 = R"END( +attribute_writing_ranks = 0 + [adios2] unused = "parameter" -attribute_writing_ranks = 0 )END" #if openPMD_HAS_ADIOS_2_9 "use_group_table = true"