Add /dev/shm space check before shared memory allocation in global adaptivity #217#227
Open
AdityaGupta716 wants to merge 1 commit intoprecice:developfrom
Open
Add /dev/shm space check before shared memory allocation in global adaptivity #217#227AdityaGupta716 wants to merge 1 commit intoprecice:developfrom
AdityaGupta716 wants to merge 1 commit intoprecice:developfrom
Conversation
Author
|
@IshaanDesai please review |
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.