From 26e5a49d8e0407ff2730c1965006577e6ce65f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 29 Feb 2024 14:32:20 +0100 Subject: [PATCH] Fixes for ADIOS2 v2.7 --- src/IO/ADIOS/ADIOS2IOHandler.cpp | 8 ++++---- test/Files_SerialIO/close_iteration_test.cpp | 13 ++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) 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();