diff --git a/src/IO/ADIOS/ADIOS2IOHandler.cpp b/src/IO/ADIOS/ADIOS2IOHandler.cpp index 6596ad4626..0baa504883 100644 --- a/src/IO/ADIOS/ADIOS2IOHandler.cpp +++ b/src/IO/ADIOS/ADIOS2IOHandler.cpp @@ -1512,7 +1512,6 @@ adios2::Mode ADIOS2IOHandlerImpl::adios2AccessMode( if (auxiliary::directory_exists(fullPath) || auxiliary::file_exists(fullPath)) { -#if openPMD_HAS_ADIOS_2_8 switch (m_handler->m_encoding) { @@ -1523,7 +1522,11 @@ adios2::Mode ADIOS2IOHandlerImpl::adios2AccessMode( case adios_defs::OpenFileAs::Create: return adios2::Mode::Write; case adios_defs::OpenFileAs::Open: +#if openPMD_HAS_ADIOS_2_8 return adios2::Mode::ReadRandomAccess; +#else + return adios2::Mode::Read; +#endif case adios_defs::OpenFileAs::Reopen: return adios2::Mode::Append; } @@ -1533,9 +1536,6 @@ adios2::Mode ADIOS2IOHandlerImpl::adios2AccessMode( return adios2::Mode::Read; } break; -#else - return adios2::Mode::Read; -#endif } else { diff --git a/test/Files_SerialIO/close_iteration_test.cpp b/test/Files_SerialIO/close_iteration_test.cpp index efaeaf712b..f4ab333636 100644 --- a/test/Files_SerialIO/close_iteration_test.cpp +++ b/test/Files_SerialIO/close_iteration_test.cpp @@ -64,9 +64,16 @@ auto run_test_filebased( E_x.storeChunk(data, {0}, {5}); it.close(); - it.open(); - it.setTimeUnitSI(2.0); - it.close(); +#if !openPMD_HAS_ADIOS_2_8 + if (series.backend() != "ADIOS2") + { +#endif + it.open(); + it.setTimeUnitSI(2.0); + it.close(); +#if !openPMD_HAS_ADIOS_2_8 + } +#endif } series.close();