From a342b5dac6e83d29e60aff6e22068a258eb9a5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 12 Mar 2024 10:57:09 +0100 Subject: [PATCH] Fixes --- src/IO/ADIOS/ADIOS2File.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/IO/ADIOS/ADIOS2File.cpp b/src/IO/ADIOS/ADIOS2File.cpp index 15cc2ab241..71c5102840 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" #include #if openPMD_USE_VERIFY @@ -87,14 +88,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); } @@ -158,14 +161,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); }