Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have HDF5 write raise error if operator(s) requested #3951

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions source/adios2/toolkit/interop/hdf5/HDF5Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,16 @@ void HDF5Common::StaticGetAdiosStepString(std::string &stepName, size_t ts)
stepName = "/Step" + std::to_string(ts);
}

void HDF5Common::CheckVariableOperations(const core::VariableBase &variable) const
{
if (!variable.m_Operations.empty())
{
helper::Throw<std::runtime_error>("Toolkit", "interop::hdf5::HDF5Common",
"CheckVariableOperations",
"ADIOS2 Operators are not supported for HDF5 engine");
}
}

#define declare_template_instantiation(T) \
template void HDF5Common::Write(core::Variable<T> &, const T *);

Expand Down
2 changes: 2 additions & 0 deletions source/adios2/toolkit/interop/hdf5/HDF5Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ class HDF5Common
void GetHDF5SpaceSpec(const core::Variable<T> &variable, std::vector<hsize_t> &,
std::vector<hsize_t> &, std::vector<hsize_t> &);

void CheckVariableOperations(const core::VariableBase &variable) const;

bool m_WriteMode = false;

size_t m_NumAdiosSteps = 0;
Expand Down
2 changes: 2 additions & 0 deletions source/adios2/toolkit/interop/hdf5/HDF5Common.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace interop
template <class T>
void HDF5Common::DefineDataset(core::Variable<T> &variable)
{
CheckVariableOperations(variable);
size_t dimSize = std::max(variable.m_Shape.size(), variable.m_Count.size());
hid_t h5Type = GetHDF5Type<T>();

Expand Down Expand Up @@ -118,6 +119,7 @@ template <class T>
void HDF5Common::Write(core::Variable<T> &variable, const T *values)
{
CheckWriteGroup();
CheckVariableOperations(variable);
size_t dimSize = std::max(variable.m_Shape.size(), variable.m_Count.size());
hid_t h5Type = GetHDF5Type<T>();

Expand Down
Loading