From 8cc7fee7508b46349549004261c9940cf3cb0f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 28 Feb 2023 13:02:03 +0100 Subject: [PATCH] Throw errors if unsupported --- src/IO/ADIOS/ADIOS2IOHandler.cpp | 8 ++++++++ src/IO/ADIOS/CommonADIOS1IOHandler.cpp | 6 ++++++ src/IO/HDF5/HDF5IOHandler.cpp | 6 ++++++ src/IO/JSON/JSONIOHandlerImpl.cpp | 6 ++++++ 4 files changed, 26 insertions(+) diff --git a/src/IO/ADIOS/ADIOS2IOHandler.cpp b/src/IO/ADIOS/ADIOS2IOHandler.cpp index 44d1f27d71..43a109ac5e 100644 --- a/src/IO/ADIOS/ADIOS2IOHandler.cpp +++ b/src/IO/ADIOS/ADIOS2IOHandler.cpp @@ -65,6 +65,7 @@ namespace openPMD #if openPMD_HAVE_ADIOS2 #define HAS_ADIOS_2_8 (ADIOS2_VERSION_MAJOR * 100 + ADIOS2_VERSION_MINOR >= 208) +#define HAS_ADIOS_2_9 (ADIOS2_VERSION_MAJOR * 100 + ADIOS2_VERSION_MINOR >= 209) namespace { @@ -623,6 +624,13 @@ void ADIOS2IOHandlerImpl::createDataset( "[ADIOS2] Creating a dataset in a file opened as read " "only is not possible."); } +#if !HAS_ADIOS_2_9 + if (parameters.joinedDimension.has_value()) + { + error::throwOperationUnsupportedInBackend( + "ADIOS1", "Joined Arrays require ADIOS2 >= v2.9"); + } +#endif if (!writable->written) { /* Sanitize name */ diff --git a/src/IO/ADIOS/CommonADIOS1IOHandler.cpp b/src/IO/ADIOS/CommonADIOS1IOHandler.cpp index f15ab0fdd4..bdc37b5366 100644 --- a/src/IO/ADIOS/CommonADIOS1IOHandler.cpp +++ b/src/IO/ADIOS/CommonADIOS1IOHandler.cpp @@ -539,6 +539,12 @@ void CommonADIOS1IOHandlerImpl::createDataset( "[ADIOS1] Creating a dataset in a file opened as read only is not " "possible."); + if (parameters.joinedDimension.has_value()) + { + error::throwOperationUnsupportedInBackend( + "ADIOS1", "Joined Arrays currently only supported in ADIOS2"); + } + if (!writable->written) { /* ADIOS variable definitions require the file to be (re-)opened to take diff --git a/src/IO/HDF5/HDF5IOHandler.cpp b/src/IO/HDF5/HDF5IOHandler.cpp index 5421187f03..f9e65a5f4e 100644 --- a/src/IO/HDF5/HDF5IOHandler.cpp +++ b/src/IO/HDF5/HDF5IOHandler.cpp @@ -419,6 +419,12 @@ void HDF5IOHandlerImpl::createDataset( "[HDF5] Creating a dataset in a file opened as read only is not " "possible."); + if (parameters.joinedDimension.has_value()) + { + error::throwOperationUnsupportedInBackend( + "ADIOS1", "Joined Arrays currently only supported in ADIOS2"); + } + if (!writable->written) { /* Sanitize name */ diff --git a/src/IO/JSON/JSONIOHandlerImpl.cpp b/src/IO/JSON/JSONIOHandlerImpl.cpp index e17e4929eb..80baa9b413 100644 --- a/src/IO/JSON/JSONIOHandlerImpl.cpp +++ b/src/IO/JSON/JSONIOHandlerImpl.cpp @@ -189,6 +189,12 @@ void JSONIOHandlerImpl::createDataset( "[JSON] Creating a dataset in a file opened as read only is not " "possible."); } + if (parameter.joinedDimension.has_value()) + { + error::throwOperationUnsupportedInBackend( + "ADIOS1", "Joined Arrays currently only supported in ADIOS2"); + } + if (!writable->written) { /* Sanitize name */