diff --git a/src/IO/ADIOS/ADIOS2File.cpp b/src/IO/ADIOS/ADIOS2File.cpp index adc0a9fff0..fd2dd8255a 100644 --- a/src/IO/ADIOS/ADIOS2File.cpp +++ b/src/IO/ADIOS/ADIOS2File.cpp @@ -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" #if openPMD_USE_VERIFY #define VERIFY(CONDITION, TEXT) \ @@ -86,14 +87,16 @@ void WriteDataset::call(ADIOS2File &ba, detail::BufferedPut &bp) adios2::Variable var = ba.m_impl->verifyDataset( 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); } @@ -157,14 +160,16 @@ struct RunUniquePtrPut auto ptr = static_cast(bufferedPut.data.get()); adios2::Variable var = ba.m_impl->verifyDataset( 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); }