Skip to content

Bugfix: Fix mesh handle tests for 5 processes - #2440

Open
lenaploetzke wants to merge 6 commits into
mainfrom
fix_bug_in_dg_competence
Open

lenaploetzke wants to merge 6 commits into
mainfrom
fix_bug_in_dg_competence

Conversation

@lenaploetzke

@lenaploetzke lenaploetzke commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #2441

Describe your changes here:
The dg competence test for the mesh handle failed with 5 processes because the leaf neighbors of ghosts does not work as intended (See #2438). This test now works without using the neighbor of ghost elements.
The interpolation test failed because the mesh was partitioned before the data interpolation (implicit in the set_balance function because of the no_repartition=false flag). This cannot happen now.

All these boxes must be checked by the AUTHOR before requesting review:

  • The PR is small enough to be reviewed easily. If not, consider splitting up the changes in multiple PRs.
  • The title starts with one of the following prefixes: Documentation:, Bugfix:, Feature:, Improvement: or Other:.
  • If the PR is related to an issue, make sure to link it.
  • The author made sure that, as a reviewer, he/she would check all boxes below.

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

  • The reviewer executed the new code features at least once and checked the results manually.
  • The code follows the t8code coding guidelines.
  • New source/header files are properly added to the CMake files.
  • The code is well documented. In particular, all function declarations, structs/classes and their members have a proper doxygen documentation. Make sure to add a file documentation for each file!
  • README.md files are updated if necessary.
  • All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue).

Tests

  • The code is covered in an existing or new test case using Google Test.
  • The code coverage of the project (reported in the CI) should not decrease. If coverage is decreased, make sure that this is reasonable and acceptable.
  • Valgrind doesn't find any bugs in the new code. This script can be used to check for errors; see also this wiki article.

If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):

  • Should this use case be added to the github action?
  • If not, does the specific use case compile and all tests pass (check manually).

Scripts and Wiki

  • If a new directory with source files is added, it must be covered by the scripts/internal/find_all_source_files.sh to check the indentation of these files.
  • If this PR introduces a new feature, it must be covered in an example or tutorial and a Wiki article.

License

  • The author added a BSD statement to doc/ (or already has one).

@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.65%. Comparing base (a65e38a) to head (9239a56).

Files with missing lines Patch % Lines
mesh_handle/mesh.hxx 84.61% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2440   +/-   ##
=======================================
  Coverage   82.65%   82.65%           
=======================================
  Files         132      132           
  Lines       21502    21515   +13     
=======================================
+ Hits        17772    17783   +11     
- Misses       3730     3732    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@spenke91 spenke91 self-assigned this Sep 28, 2026
@spenke91
spenke91 self-requested a review September 28, 2026 13:24

@spenke91 spenke91 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fix! I just have two minor remarks and am pretty sure I will accept the next iteration :-)

Comment thread mesh_handle/mesh.hxx
Comment on lines +441 to +447
if (!no_repartition && !this->set_partition_called ()) {
this->m_partition_for_coarsening = false;
t8_global_errorf (
"WARNING: The mesh handle is intended to interpolate data after adaptation. "
"Therefore, repartitioning is required to happen AFTER interpolation. The balance function is called with "
"no_repartition = false, so the flag is set to true and partitioning is performed automatically after "
"interpolation.\n");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this maybe a candidate for throwing an error rather than a warning? I'd argue that if it othersise (a) crashes, it is better to have a clean abort here or (b) computes garbage, it's even more important to abort here. My experience is that warnings have a tendency to be overlooked by the users.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hm i dont know. Isnt it in this case just fine to set the flag silently? Because this should always be the intend of the user in this case.

EXPECT_EQ ((*mesh)[face.sides[iside].element_id].get_level (), elem_first.get_level () + 1)
<< "MORTAR Small side must be one level finer.";
}
// TODO: If the neighbors of ghost work again, the following checks can be enables also for ghost large sides.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// TODO: If the neighbors of ghost work again, the following checks can be enables also for ghost large sides.
// TODO: If the neighbors of ghost work again, the checks above can be enabled also for ghost large sides.

Or which checks do you mean?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually the checks below, we theoretically can just delete the break.

@spenke91 spenke91 assigned lenaploetzke and unassigned spenke91 Sep 28, 2026

This branch has not been deployed

No deployments
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.

Bugfix: Fix mesh handle tests for 5 processes

2 participants