Fix PFC on root level elements#2280
Merged
Merged
Conversation
…when the pfc message is filled
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2280 +/- ##
==========================================
+ Coverage 82.34% 82.37% +0.02%
==========================================
Files 125 125
Lines 20543 20543
==========================================
+ Hits 16917 16922 +5
+ Misses 3626 3621 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
spenke91
requested changes
Apr 20, 2026
spenke91
left a comment
Collaborator
There was a problem hiding this comment.
Thanks a lot for catching this! :-) I just have one minor suggestion, hope you don't mind...
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 #2281
Describe your changes here:
When partition for coarsening is applied and the border element is a root level element, a PFC-Message is constructed and the parent element therein is the actual pointer to the root element in the mesh. Upon destruction of the PFC-Message, the parent element (in this case the actual root element in the mesh) is destroyed. In all other cases (i.e. the border element is not a root element) additional storage for the parent is allocated and it is filled with the corresponding information and this newly constructed element will be deallocated within the destructor. Currently, this leads to a crash in case the partition boundary falls on a root element. In order to account for this, there needs to be an additional element-allocation for the parent in the root level case as well which is then filled by an element_copy of the actual root element, such that it can be safely dealloacted upon destruction of the mesasge.
In order to re-create the issue, one can just construct a uniform forest with refinement level 0 from a cmesh and call partiton for caoarsening on it.
All these boxes must be checked by the AUTHOR before requesting review:
Documentation:,Bugfix:,Feature:,Improvement:orOther:.All these boxes must be checked by the REVIEWERS before merging the pull request:
As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.
General
Tests
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
scripts/internal/find_all_source_files.shto check the indentation of these files.License
doc/(or already has one).