2929#include " openPMD/auxiliary/ShareRawInternal.hpp"
3030#include " openPMD/auxiliary/TypeTraits.hpp"
3131#include " openPMD/auxiliary/UniquePtr.hpp"
32+ #include " openPMD/backend/Attributable.hpp"
3233
3334#include < memory>
3435#include < type_traits>
@@ -111,18 +112,10 @@ RecordComponent::storeChunk(Offset o, Extent e, F &&createBuffer)
111112 " using storeChunk() (see RecordComponent::resetDataset())." );
112113 }
113114 Parameter<Operation::CREATE_DATASET> dCreate (rc.m_dataset .value ());
114- dCreate.name = rc. m_name ;
115+ dCreate.name = Attributable::get (). m_writable . ownKeyWithinParent ;
115116 IOHandler ()->enqueue (IOTask (this , dCreate));
116117 }
117118
118- if (size == 0 )
119- {
120- // Don't forward this operation to the backend as it might create ugly
121- // zero-blocks in ADIOS2
122- setDirtyRecursive (true );
123- return DynamicMemoryView<T>();
124- }
125-
126119 Parameter<Operation::GET_BUFFER_VIEW> getBufferView;
127120 getBufferView.offset = o;
128121 getBufferView.extent = e;
@@ -136,7 +129,10 @@ RecordComponent::storeChunk(Offset o, Extent e, F &&createBuffer)
136129 // type shared_ptr<T> or shared_ptr<T[]>
137130 auto data = std::forward<F>(createBuffer)(size);
138131 out.ptr = static_cast <void *>(data.get ());
139- storeChunk (std::move (data), std::move (o), std::move (e));
132+ if (size > 0 )
133+ {
134+ storeChunk (std::move (data), std::move (o), std::move (e));
135+ }
140136 }
141137 setDirtyRecursive (true );
142138 return DynamicMemoryView<T>{std::move (getBufferView), size, *this };
0 commit comments