Skip to content

Fix 1d_stencil_5 partition buffer ownership - #7125

Merged
hkaiser merged 2 commits into
TheHPXProject:masterfrom
LSUDOKO:fix/1d-stencil-5-buffer-ownership
Mar 28, 2026
Merged

hkaiser merged 2 commits into
TheHPXProject:masterfrom
LSUDOKO:fix/1d-stencil-5-buffer-ownership

Conversation

@LSUDOKO

@LSUDOKO LSUDOKO commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7124

What changed

  • replaced std::shared_ptr<double[]> with hpx::serialization::serialize_buffer<double>
  • constructed partition buffers with buffer_type::take
  • simplified serialization by serializing the buffer directly instead of using split save/load

Why

partition_data is passed through actions, so explicit buffer ownership semantics are a better fit here. serialize_buffer
makes ownership transfer clearer and avoids the manual raw-array serialization logic.

Scope

This PR intentionally only touches:

  • examples/1d_stencil/1d_stencil_5.cpp

@LSUDOKO
LSUDOKO requested a review from hkaiser as a code owner March 28, 2026 07:26
@StellarBot

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@hkaiser

hkaiser commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor

While this is nice and everything, stencil_5 is not a fully distributed example, so it will not use serialization at all. I have no issues changing the code as suggested, it may however be misleading. Could you add some comments explaining this, please?

Signed-off-by: LSUDOKO <[email protected]>
@LSUDOKO

LSUDOKO commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor Author

While this is nice and everything, stencil_5 is not a fully distributed example, so it will not use serialization at all. I have no issues changing the code as suggested, it may however be misleading. Could you add some comments explaining this, please?

@hkaiser
thanks, that makes
you're right that 1d_stencil_5 is not a fully distributed example, so in practice this path does not rely on serialization during execution
my intention with the change was only to make the buffer ownership semantics explicit in partition_data, since the type still provides
serialization support for action arguments

@hkaiser hkaiser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

@hkaiser hkaiser added this to the 2.0.0 milestone Mar 28, 2026
@hkaiser
hkaiser merged commit f0b6fed into TheHPXProject:master Mar 28, 2026
111 of 114 checks passed
vaibhavj2006 pushed a commit to vaibhavj2006/hpx that referenced this pull request Mar 30, 2026
…uffer-ownership

Fix 1d_stencil_5 partition buffer ownership
Signed-off-by: Vaibhav Joshi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1d_stencil_5 uses non-owning serialization for partition_data buffer

3 participants