Skip to content

Commit a342b5d

Browse files
committed
Fixes
1 parent ee17a33 commit a342b5d

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
#include <adios2/common/ADIOSTypes.h>
2627

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

90-
if (var.Shape() == adios2::Dims{adios2::LocalValue})
91+
if (var.Shape() == adios2::Dims{adios2::LocalValueDim})
9192
{
9293
if (bp.param.extent != Extent{1})
9394
{
9495
throw error::OperationUnsupportedInBackend(
9596
"ADIOS2",
9697
"Can only write a single element to LocalValue "
97-
"variables (extent == Extent{1}).");
98+
"variables (extent == Extent{1}, but extent of '" +
99+
bp.name + " was " +
100+
auxiliary::format_vec(bp.param.extent) + "').");
98101
}
99102
ba.getEngine().Put(var, *ptr);
100103
}
@@ -158,14 +161,16 @@ struct RunUniquePtrPut
158161
auto ptr = static_cast<T const *>(bufferedPut.data.get());
159162
adios2::Variable<T> var = ba.m_impl->verifyDataset<T>(
160163
bufferedPut.offset, bufferedPut.extent, ba.m_IO, bufferedPut.name);
161-
if (var.Shape() == adios2::Dims{adios2::LocalValue})
164+
if (var.Shape() == adios2::Dims{adios2::LocalValueDim})
162165
{
163166
if (bufferedPut.extent != Extent{1})
164167
{
165168
throw error::OperationUnsupportedInBackend(
166169
"ADIOS2",
167170
"Can only write a single element to LocalValue "
168-
"variables (extent == Extent{1}).");
171+
"variables (extent == Extent{1}, but extent of '" +
172+
bufferedPut.name + " was " +
173+
auxiliary::format_vec(bufferedPut.extent) + "').");
169174
}
170175
ba.getEngine().Put(var, *ptr);
171176
}

0 commit comments

Comments
 (0)