diff --git a/src/IO/ADIOS/ADIOS2IOHandler.cpp b/src/IO/ADIOS/ADIOS2IOHandler.cpp index a9af92e4a0..14f4d163ef 100644 --- a/src/IO/ADIOS/ADIOS2IOHandler.cpp +++ b/src/IO/ADIOS/ADIOS2IOHandler.cpp @@ -97,6 +97,16 @@ ADIOS2IOHandlerImpl::ADIOS2IOHandlerImpl( init(std::move(cfg)); } +static constexpr char const *warningADIOS2NoGroupbasedEncoding = &R"( +[Warning] Use of group-based encoding in ADIOS2 is discouraged as it can lead +to drastic performance issues, especially when **not** used in conjunction with +IO steps. +We advise you to pick either file-based encoding or variable-based +iteration encoding for use with ADIOS2. +For more details, refer to +https://openpmd-api.readthedocs.io/en/latest/usage/concepts.html#iteration-and-series)" + [1]; + ADIOS2IOHandlerImpl::~ADIOS2IOHandlerImpl() { /* @@ -508,6 +518,14 @@ void ADIOS2IOHandlerImpl::createFile( if (!writable->written) { + + if (!printedWarningsAlready.noGroupBased && + parameters.encoding == IterationEncoding::groupBased) + { + std::cerr << warningADIOS2NoGroupbasedEncoding << std::endl; + printedWarningsAlready.noGroupBased = true; + } + std::string name = parameters.name + fileSuffix(); auto res_pair = getPossiblyExisting(name); @@ -779,6 +797,13 @@ void ADIOS2IOHandlerImpl::openFile( "Supplied directory is not valid: " + m_handler->directory); } + if (!printedWarningsAlready.noGroupBased && + parameters.encoding == IterationEncoding::groupBased) + { + std::cerr << warningADIOS2NoGroupbasedEncoding << std::endl; + printedWarningsAlready.noGroupBased = true; + } + std::string name = parameters.name + fileSuffix(); auto file = std::get(getPossiblyExisting(name)); diff --git a/src/Iteration.cpp b/src/Iteration.cpp index f4f7498fd0..83f76a83c5 100644 --- a/src/Iteration.cpp +++ b/src/Iteration.cpp @@ -206,6 +206,7 @@ void Iteration::flushFileBased( /* create file */ Parameter fCreate; fCreate.name = filename; + fCreate.encoding = s.iterationEncoding(); IOHandler()->enqueue(IOTask(&s.writable(), fCreate)); /* create basePath */ diff --git a/src/Series.cpp b/src/Series.cpp index 4a22330179..0b8664d3f3 100644 --- a/src/Series.cpp +++ b/src/Series.cpp @@ -1195,6 +1195,7 @@ void Series::readOneIterationFileBased(std::string const &filePath) Parameter aRead; fOpen.name = filePath; + fOpen.encoding = iterationEncoding(); IOHandler()->enqueue(IOTask(this, fOpen)); IOHandler()->flush(internal::defaultFlushParams); series.iterations.parent() = getWritable(this);