Skip to content

Add /dev/shm space check before shared memory allocation in global adaptivity #217#227

Open
AdityaGupta716 wants to merge 1 commit intoprecice:developfrom
AdityaGupta716:fix/shm-size-check
Open

Add /dev/shm space check before shared memory allocation in global adaptivity #217#227
AdityaGupta716 wants to merge 1 commit intoprecice:developfrom
AdityaGupta716:fix/shm-size-check

Conversation

@AdityaGupta716
Copy link

@AdityaGupta716 AdityaGupta716 commented Feb 25, 2026

Closes #217
Problem:
On some systems /dev/shm is limited to 50% of total RAM. When global adaptivity is used with a large number of simulations, the N×N similarity distance matrix allocated via MPI.Win.Allocate_shared can exceed this limit, causing a cryptic MPI internal error with no useful information for the user.
Fix:
Before calling MPI.Win.Allocate_shared, rank 0 now checks the available space in /dev/shm using shutil.disk_usage. If there is not enough space, a clear RuntimeError is raised telling the user exactly how much space is required vs available, and suggests either increasing /dev/shm size or switching to local adaptivity.
Note:
This is a documentation/UX fix — no logic or algorithm changes. The error was always there, it just surfaced as an unhelpful MPI crash. This makes it actionable for the user.

@AdityaGupta716 AdityaGupta716 changed the title Add /dev/shm space check before shared memory allocation in global adaptivity Add /dev/shm space check before shared memory allocation in global adaptivity #217 Feb 25, 2026
@MakisH MakisH added the GSoC Contributed in the context of the Google Summer of Code label Feb 25, 2026
@AdityaGupta716
Copy link
Author

@IshaanDesai please review

@precice-bot
Copy link

This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/gsoc-2026-aditya-gupta/2773/1

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

Labels

GSoC Contributed in the context of the Google Summer of Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global adaptivity is limited to shared memory on device

3 participants