Skip to content

Commit

Permalink
Throw errors if unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Feb 28, 2023
1 parent d1f1fd1 commit 8cc7fee
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/IO/ADIOS/ADIOS2IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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 */
Expand Down
6 changes: 6 additions & 0 deletions src/IO/ADIOS/CommonADIOS1IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,12 @@ void CommonADIOS1IOHandlerImpl<ChildClass>::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
Expand Down
6 changes: 6 additions & 0 deletions src/IO/HDF5/HDF5IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
6 changes: 6 additions & 0 deletions src/IO/JSON/JSONIOHandlerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 8cc7fee

Please sign in to comment.