Skip to content

Conversation

guj
Copy link
Contributor

@guj guj commented Aug 27, 2025

So we can aggregate (mainly for BTD) data for a later flush.

introduced an optional but related entry in the input file: <diag>.buffer_flush_limit_btd by default it is 5.

New implementation of #3200 but so far only for fields/meshes. Particles will be a follow-up PR.

this makes it possible to aggregate data for later flush
@guj guj changed the title WIP: use span to allocate mesh data by default use span to allocate mesh data by default Aug 28, 2025
@guj guj requested a review from ax3l August 28, 2025 03:50
@ax3l ax3l self-assigned this Aug 28, 2025
@ax3l ax3l added Performance optimization component: openPMD openPMD I/O component: diagnostics all types of outputs component: boosted frame boosted frame components & logic labels Aug 28, 2025
* if isBTD=true, advice to use ADIOS Put() instead of PDW for better performance.
* in ADIOS, the action will be PerformDataWrite
* if isBTD=true, in ADIOS, the action will be PerformPut
* because no action is taken for the span tasks.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this generally true? You only add spans for fields right now, what if particles are involved?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right BTD particles will be calling PerformPut. Right now particles is not the I/O performance bottleneck for BTD. It will happen when you have enormous amount of particles. I will definitely revisit this issue with another pull request.

});
auto span = dynamicMemoryView.currentBuffer();
amrex::Gpu::dtoh_memcpy_async(span.data(), fab.dataPtr(icomp), local_box.numPts()*sizeof(amrex::Real));
} else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this else branch for D2H? I thought openPMD-api has a fallback implementation for HDF5...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out no. We do need it.

auto span = dynamicMemoryView.currentBuffer();
std::memcpy(span.data(), fab.dataPtr(icomp), local_box.numPts()*sizeof(amrex::Real));
}
else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: I thought openPMD-api has a fallback implementation for Span for backends that do not support it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because the first round of CPU span failed pull request (it uses HDF5) so the fallback does not work with collecting a few buffers (during a snapshot) and then flush out. The fallback works if flushes out immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants