Skip to content

Fix multigrid agglomeration#2712

Open
bigfooted wants to merge 71 commits intodevelopfrom
fix_MG_part_1
Open

Fix multigrid agglomeration#2712
bigfooted wants to merge 71 commits intodevelopfrom
fix_MG_part_1

Conversation

@bigfooted
Copy link
Contributor

@bigfooted bigfooted commented Jan 18, 2026

Proposed Changes

Give a brief overview of your contribution here in a few sentences.

Implement multigrid agglomeration according to Nishikawa and Diskin.

  • euler walls are working correctly.

  • mpi seems to be working (can be improved)

  • OMP seems to be working (can be improved)

  • multigrid does not crash anymore

  • I am submitting my contribution to the develop branch.

  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).

  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).

  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.

  • I have added a test case that demonstrates my contribution, if necessary.

  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

@bigfooted bigfooted changed the title [WIP] Fix multigrid agglomeration Fix multigrid agglomeration Jan 28, 2026
bigfooted and others added 12 commits February 3, 2026 19:37
Co-authored-by: Johannes Blühdorn <55186095+jblueh@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Comment on lines +563 to +565
// nijso: check if this can be removed now.
//solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);
//solver_fine->CompleteComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

Copilot Autofix

AI 1 day ago

In general, to fix “commented-out code” issues you either (a) re-enable the code if it is still needed, or (b) delete it entirely if it is obsolete or merely serving as a reminder. If a conceptual description is useful for future readers, that should be expressed as a natural-language comment rather than as disabled code.

For this specific case in SU2_CFD/src/integration/CMultiGridIntegration.cpp, the two lines:

//solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);
//solver_fine->CompleteComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);

are clearly commented-out function calls. The best fix that does not change existing functionality is to remove these two lines entirely while leaving the surrounding smoothing logic unchanged. The preceding comment “/--- MPI sync after RK stage to ensure halos have updated solution for next smoothing iteration ---/” already explains the intended behavior; the extra line // nijso: check if this can be removed now. is more of a personal note. We can keep or slightly rephrase it as a neutral TODO-style comment without any code; to minimize behavioral changes, we will simply keep it. No new methods, imports, or definitions are required.

Concretely:

  • Edit SU2_CFD/src/integration/CMultiGridIntegration.cpp.
  • In the loop where post-smoothing is performed (around line 562), delete the two commented-out lines containing solver_fine->InitiateComms and solver_fine->CompleteComms.
  • Leave all other code and comments intact.
Suggested changeset 1
SU2_CFD/src/integration/CMultiGridIntegration.cpp

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/SU2_CFD/src/integration/CMultiGridIntegration.cpp b/SU2_CFD/src/integration/CMultiGridIntegration.cpp
--- a/SU2_CFD/src/integration/CMultiGridIntegration.cpp
+++ b/SU2_CFD/src/integration/CMultiGridIntegration.cpp
@@ -561,8 +561,6 @@
 
       /*--- MPI sync after RK stage to ensure halos have updated solution for next smoothing iteration ---*/
       // nijso: check if this can be removed now.
-      //solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);
-      //solver_fine->CompleteComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);
 
     }
   }
EOF
@@ -561,8 +561,6 @@

/*--- MPI sync after RK stage to ensure halos have updated solution for next smoothing iteration ---*/
// nijso: check if this can be removed now.
//solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);
//solver_fine->CompleteComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);

}
}
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants