Skip to content

Commit 88b01e8

Browse files
committed
Fixes
1 parent 77746fb commit 88b01e8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/IO/ADIOS/ADIOS2File.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "openPMD/IO/ADIOS/ADIOS2File.hpp"
2323
#include "openPMD/IO/ADIOS/ADIOS2IOHandler.hpp"
2424
#include "openPMD/auxiliary/Environment.hpp"
25+
#include "openPMD/auxiliary/StringManip.hpp"
2526

2627
#if openPMD_USE_VERIFY
2728
#define VERIFY(CONDITION, TEXT) \
@@ -86,14 +87,16 @@ void WriteDataset::call(ADIOS2File &ba, detail::BufferedPut &bp)
8687
adios2::Variable<T> var = ba.m_impl->verifyDataset<T>(
8788
bp.param.offset, bp.param.extent, ba.m_IO, bp.name);
8889

89-
if (var.Shape() == adios2::Dims{adios2::LocalValue})
90+
if (var.Shape() == adios2::Dims{adios2::LocalValueDim})
9091
{
9192
if (bp.param.extent != Extent{1})
9293
{
9394
throw error::OperationUnsupportedInBackend(
9495
"ADIOS2",
9596
"Can only write a single element to LocalValue "
96-
"variables (extent == Extent{1}).");
97+
"variables (extent == Extent{1}, but extent of '" +
98+
bp.name + " was " +
99+
auxiliary::format_vec(bp.param.extent) + "').");
97100
}
98101
ba.getEngine().Put(var, *ptr);
99102
}
@@ -157,14 +160,16 @@ struct RunUniquePtrPut
157160
auto ptr = static_cast<T const *>(bufferedPut.data.get());
158161
adios2::Variable<T> var = ba.m_impl->verifyDataset<T>(
159162
bufferedPut.offset, bufferedPut.extent, ba.m_IO, bufferedPut.name);
160-
if (var.Shape() == adios2::Dims{adios2::LocalValue})
163+
if (var.Shape() == adios2::Dims{adios2::LocalValueDim})
161164
{
162165
if (bufferedPut.extent != Extent{1})
163166
{
164167
throw error::OperationUnsupportedInBackend(
165168
"ADIOS2",
166169
"Can only write a single element to LocalValue "
167-
"variables (extent == Extent{1}).");
170+
"variables (extent == Extent{1}, but extent of '" +
171+
bufferedPut.name + " was " +
172+
auxiliary::format_vec(bufferedPut.extent) + "').");
168173
}
169174
ba.getEngine().Put(var, *ptr);
170175
}

0 commit comments

Comments
 (0)