Prepartitioning with threading race condition fix - #450
Open
Matthew Walker (mattatmet) wants to merge 6 commits into
Open
Prepartitioning with threading race condition fix#450Matthew Walker (mattatmet) wants to merge 6 commits into
Matthew Walker (mattatmet) wants to merge 6 commits into
Conversation
Matthew Walker (mattatmet)
requested a review
from Ricky Wong (mo-rickywong)
as a code owner
August 18, 2026 10:15
28 tasks
mo-marqh
approved these changes
Aug 18, 2026
mo-marqh
left a comment
Member
There was a problem hiding this comment.
A change is necessary to fix the observed edge case bug.
This is a neat and well contained alternative that meets requirements
Member
|
ready for code review Benjamin Went (@MetBenjaminWent) |
| type(linked_list_item_type),pointer :: loop => null() | ||
| type(linked_list_item_type),pointer :: loop | ||
|
|
||
| nullify(loop) |
Contributor
There was a problem hiding this comment.
Should this instead be, (for consistency)? : loop => null()
Contributor
Author
There was a problem hiding this comment.
Thanks Benjamin Went (@MetBenjaminWent), agreed, have pushed this change now.
Ricky Wong (mo-rickywong)
approved these changes
Aug 20, 2026
Ricky Wong (mo-rickywong)
left a comment
Contributor
There was a problem hiding this comment.
No issue with this, It's actually recommended practice which we try to remove null() assignments on the declaration statement. This is obviously legacy code that hasn't been revisited.
Matthew Walker (mattatmet)
requested a review
from Benjamin Went (MetBenjaminWent)
August 20, 2026 13:39
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.
PR Summary
Sci/Tech Reviewer: mo-marqh
Code Reviewer: Benjamin Went (@MetBenjaminWent)
This PR is to address a race condition in the threading employed by the partitioning section of the
cubedsphere_mesh_generatorcode. This was originally found using offline partitioning in the apps PR #688 (linked to this one) where a seg fault was occurring for really high partition numbers and a custom mesh decomposition task. I believe that the linked list pointer in theglobal_mesh_map_collectioncode was being overwritten by competing threads and that by separating the declaration and nullification of the pointer, thesaveattribute is no longer being applied, making theloopvariable local to each thread calling the object.Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_core - partitioned_null_pointer_dev_tests/run1
Suite Information
Task Information
✅ succeeded tasks - 431
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review