|
22 | 22 | #include "openPMD/IO/ADIOS/ADIOS2File.hpp" |
23 | 23 | #include "openPMD/IO/ADIOS/ADIOS2IOHandler.hpp" |
24 | 24 | #include "openPMD/auxiliary/Environment.hpp" |
| 25 | +#include "openPMD/auxiliary/StringManip.hpp" |
25 | 26 | #include <adios2/common/ADIOSTypes.h> |
26 | 27 |
|
27 | 28 | #if openPMD_USE_VERIFY |
@@ -87,14 +88,16 @@ void WriteDataset::call(ADIOS2File &ba, detail::BufferedPut &bp) |
87 | 88 | adios2::Variable<T> var = ba.m_impl->verifyDataset<T>( |
88 | 89 | bp.param.offset, bp.param.extent, ba.m_IO, bp.name); |
89 | 90 |
|
90 | | - if (var.Shape() == adios2::Dims{adios2::LocalValue}) |
| 91 | + if (var.Shape() == adios2::Dims{adios2::LocalValueDim}) |
91 | 92 | { |
92 | 93 | if (bp.param.extent != Extent{1}) |
93 | 94 | { |
94 | 95 | throw error::OperationUnsupportedInBackend( |
95 | 96 | "ADIOS2", |
96 | 97 | "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) + "')."); |
98 | 101 | } |
99 | 102 | ba.getEngine().Put(var, *ptr); |
100 | 103 | } |
@@ -158,14 +161,16 @@ struct RunUniquePtrPut |
158 | 161 | auto ptr = static_cast<T const *>(bufferedPut.data.get()); |
159 | 162 | adios2::Variable<T> var = ba.m_impl->verifyDataset<T>( |
160 | 163 | 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}) |
162 | 165 | { |
163 | 166 | if (bufferedPut.extent != Extent{1}) |
164 | 167 | { |
165 | 168 | throw error::OperationUnsupportedInBackend( |
166 | 169 | "ADIOS2", |
167 | 170 | "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) + "')."); |
169 | 174 | } |
170 | 175 | ba.getEngine().Put(var, *ptr); |
171 | 176 | } |
|
0 commit comments