Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Mar 12, 2024
1 parent ee17a33 commit a342b5d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/IO/ADIOS/ADIOS2File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "openPMD/IO/ADIOS/ADIOS2File.hpp"
#include "openPMD/IO/ADIOS/ADIOS2IOHandler.hpp"
#include "openPMD/auxiliary/Environment.hpp"
#include "openPMD/auxiliary/StringManip.hpp"
#include <adios2/common/ADIOSTypes.h>

#if openPMD_USE_VERIFY
Expand Down Expand Up @@ -87,14 +88,16 @@ void WriteDataset::call(ADIOS2File &ba, detail::BufferedPut &bp)
adios2::Variable<T> var = ba.m_impl->verifyDataset<T>(
bp.param.offset, bp.param.extent, ba.m_IO, bp.name);

if (var.Shape() == adios2::Dims{adios2::LocalValue})
if (var.Shape() == adios2::Dims{adios2::LocalValueDim})
{
if (bp.param.extent != Extent{1})
{
throw error::OperationUnsupportedInBackend(
"ADIOS2",
"Can only write a single element to LocalValue "
"variables (extent == Extent{1}).");
"variables (extent == Extent{1}, but extent of '" +
bp.name + " was " +
auxiliary::format_vec(bp.param.extent) + "').");
}
ba.getEngine().Put(var, *ptr);
}
Expand Down Expand Up @@ -158,14 +161,16 @@ struct RunUniquePtrPut
auto ptr = static_cast<T const *>(bufferedPut.data.get());
adios2::Variable<T> var = ba.m_impl->verifyDataset<T>(
bufferedPut.offset, bufferedPut.extent, ba.m_IO, bufferedPut.name);
if (var.Shape() == adios2::Dims{adios2::LocalValue})
if (var.Shape() == adios2::Dims{adios2::LocalValueDim})
{
if (bufferedPut.extent != Extent{1})
{
throw error::OperationUnsupportedInBackend(
"ADIOS2",
"Can only write a single element to LocalValue "
"variables (extent == Extent{1}).");
"variables (extent == Extent{1}, but extent of '" +
bufferedPut.name + " was " +
auxiliary::format_vec(bufferedPut.extent) + "').");
}
ba.getEngine().Put(var, *ptr);
}
Expand Down

0 comments on commit a342b5d

Please sign in to comment.