Skip to content

IPC Shared Memory Release#1061

Open
kab163 wants to merge 6 commits into
developfrom
feature/shared-mem-reset
Open

IPC Shared Memory Release#1061
kab163 wants to merge 6 commits into
developfrom
feature/shared-mem-reset

Conversation

@kab163

@kab163 kab163 commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread examples/ipc_shared_memory_release.cpp Outdated
@kab163 kab163 marked this pull request as ready for review April 6, 2026 21:05
@kab163 kab163 requested a review from davidbeckingsale April 6, 2026 21:06
@kab163 kab163 requested review from adayton1 and rhornung67 June 4, 2026 18:47
{
const std::size_t ps = page_size();
for (std::size_t i = 0; i < bytes; i += ps) {
buffer[i] = static_cast<std::uint8_t>(buffer[i] + 1);

@adayton1 adayton1 Jun 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not simplify to ++buffer[i];?

allocator.release();

const std::size_t rss_after_release = umpire::get_process_memory_usage();
std::cout << "RSS after allocator.release(): " << format_bytes(rss_after_release) << "\n";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"allocator.release()" should probably be changed to "release" to match the other output.

Comment thread src/umpire/Umpire.cpp

#include "umpire/ResourceManager.hpp"
#include "umpire/config.hpp"
#if defined(UMPIRE_ENABLE_IPC_SHARED_MEMORY)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it a different file included for MPI shared memory?

const std::size_t ps = page_size();

for (std::size_t i = 0; i < bytes; i += ps) {
buffer[i] = static_cast<std::uint8_t>(buffer[i] + 1);

@adayton1 adayton1 Jun 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not simplify to ++buffer[i];?

Comment thread src/umpire/resource/HostSharedMemoryResourceImpl.hpp
@adayton1

adayton1 commented Jun 4, 2026

Copy link
Copy Markdown
Member

I've got a use case where I need to read a mesh from a file, make the mesh accessible on every MPI rank, do some processing, then completely free all memory associated with the mesh. Is that accomplished by calling release or some other way?

In a related scenario I could imagine keeping a shared memory allocator around with enough memory for the largest mesh in a collection of meshes. Each mesh is read in, processed, then discarded. Would shared memory usage keep growing without release?

@adayton1

adayton1 commented Jun 4, 2026

Copy link
Copy Markdown
Member

I'm approving, but please address my remaining comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants