Skip to content

Commit f4b14e5

Browse files
committed
Avoid flush_immediately for Span operations
1 parent d8c38d6 commit f4b14e5

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

include/openPMD/RecordComponent.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ class RecordComponent
482482
void storeChunk_impl(
483483
auxiliary::WriteBuffer buffer,
484484
Datatype datatype,
485-
internal::LoadStoreConfigWithBuffer);
485+
internal::LoadStoreConfigWithBuffer,
486+
std::optional<bool> flush_immediately = std::nullopt);
486487

487488
template <typename T>
488489
DynamicMemoryView<T> storeChunkSpan_impl(internal::LoadStoreConfig);

include/openPMD/RecordComponent.tpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ inline DynamicMemoryView<T> RecordComponent::storeChunkSpanCreateBuffer_impl(
160160
storeChunk_impl(
161161
auxiliary::WriteBuffer(std::move(data)),
162162
getBufferView.dtype,
163-
std::move(ls_cfg));
163+
std::move(ls_cfg),
164+
/*flush_immediately=*/false);
164165
}
165166
// storeChunk(std::move(data), std::move(o), std::move(e));
166167
}

src/RecordComponent.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,8 @@ void RecordComponent::readBase()
702702
void RecordComponent::storeChunk_impl(
703703
auxiliary::WriteBuffer buffer,
704704
Datatype dtype,
705-
internal::LoadStoreConfigWithBuffer cfg)
705+
internal::LoadStoreConfigWithBuffer cfg,
706+
std::optional<bool> flush_immediately)
706707
{
707708
auto [o, e, memorySelection] = std::move(cfg);
708709
verifyChunk(dtype, o, e);
@@ -715,7 +716,7 @@ void RecordComponent::storeChunk_impl(
715716
/* std::static_pointer_cast correctly reference-counts the pointer */
716717
dWrite.data = std::move(buffer);
717718
auto &rc = get();
718-
rc.push_chunk(IOTask(this, std::move(dWrite)));
719+
rc.push_chunk(IOTask(this, std::move(dWrite)), flush_immediately);
719720
}
720721

721722
void RecordComponent::verifyChunk(

0 commit comments

Comments
 (0)