|
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 |
|
26 | 27 | #if openPMD_USE_VERIFY |
27 | 28 | #define VERIFY(CONDITION, TEXT) \ |
@@ -86,14 +87,16 @@ void WriteDataset::call(ADIOS2File &ba, detail::BufferedPut &bp) |
86 | 87 | adios2::Variable<T> var = ba.m_impl->verifyDataset<T>( |
87 | 88 | bp.param.offset, bp.param.extent, ba.m_IO, bp.name); |
88 | 89 |
|
89 | | - if (var.Shape() == adios2::Dims{adios2::LocalValue}) |
| 90 | + if (var.Shape() == adios2::Dims{adios2::LocalValueDim}) |
90 | 91 | { |
91 | 92 | if (bp.param.extent != Extent{1}) |
92 | 93 | { |
93 | 94 | throw error::OperationUnsupportedInBackend( |
94 | 95 | "ADIOS2", |
95 | 96 | "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) + "')."); |
97 | 100 | } |
98 | 101 | ba.getEngine().Put(var, *ptr); |
99 | 102 | } |
@@ -157,14 +160,16 @@ struct RunUniquePtrPut |
157 | 160 | auto ptr = static_cast<T const *>(bufferedPut.data.get()); |
158 | 161 | adios2::Variable<T> var = ba.m_impl->verifyDataset<T>( |
159 | 162 | 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}) |
161 | 164 | { |
162 | 165 | if (bufferedPut.extent != Extent{1}) |
163 | 166 | { |
164 | 167 | throw error::OperationUnsupportedInBackend( |
165 | 168 | "ADIOS2", |
166 | 169 | "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) + "')."); |
168 | 173 | } |
169 | 174 | ba.getEngine().Put(var, *ptr); |
170 | 175 | } |
|
0 commit comments