@@ -52,7 +52,7 @@ namespace openPMD
5252namespace internal
5353{
5454 RecordComponentData::RecordComponentData () = default ;
55- auto RecordComponentData::push_chunk (IOTask &&task) -> void
55+ auto RecordComponentData::push_chunk (IOTask &&task) -> bool
5656 {
5757 Attributable a;
5858 a.setData (std::shared_ptr<AttributableData>{this , [](auto const &) {}});
@@ -76,6 +76,7 @@ namespace internal
7676#endif
7777 a.setDirtyRecursive (true );
7878 m_chunks.push (std::move (task));
79+ return a.IOHandler ()->m_flush_immediately ;
7980 }
8081
8182 static constexpr char const *note_on_deactivating_this_check = R"(
@@ -691,7 +692,10 @@ void RecordComponent::storeChunk_impl(
691692 /* std::static_pointer_cast correctly reference-counts the pointer */
692693 dWrite.data = std::move (buffer);
693694 auto &rc = get ();
694- rc.push_chunk (IOTask (this , std::move (dWrite)));
695+ if (rc.push_chunk (IOTask (this , std::move (dWrite))))
696+ {
697+ seriesFlush ();
698+ }
695699}
696700
697701void RecordComponent::verifyChunk (
@@ -952,7 +956,10 @@ void RecordComponent::loadChunk_impl(
952956 dRead.extent = extent;
953957 dRead.dtype = getDatatype ();
954958 dRead.data = std::static_pointer_cast<void >(data);
955- rc.push_chunk (IOTask (this , dRead));
959+ if (rc.push_chunk (IOTask (this , dRead)))
960+ {
961+ seriesFlush ();
962+ }
956963 }
957964}
958965
0 commit comments