Conversation
| /*--- MPI sync after RK stage to ensure halos have updated solution for next smoothing iteration ---*/ | ||
| solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION); | ||
| solver_fine->CompleteComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION); | ||
| } |
There was a problem hiding this comment.
I don't understand why all the extra comms are necessary.
You only changed the agglomeration and CFL, where is this coming in?
There was a problem hiding this comment.
I checked and they seem to be redundant, I will remove them.
| /*--- Synchronize before each post-smoothing iteration ---*/ | ||
| SU2_OMP_BARRIER |
There was a problem hiding this comment.
All the extra barriers also don't make sense to me.
What changed in the solver operations that made them sensitive to this?
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
| //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
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 hours ago
The problem should be fixed by eliminating the commented-out function calls so that no inactive, outdated code remains in comments. We do not want to change runtime behavior, so we should not re-enable the calls; instead, we should remove only the commented-out code lines while retaining the descriptive multi-line comment that explains the redundancy, as that text is documentation rather than code.
Concretely, in SU2_CFD/src/integration/CMultiGridIntegration.cpp, within CMultiGridIntegration::PreSmoothing, remove lines 437–438:
//solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);
//solver_fine->CompleteComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);Leave the preceding TODO/FIXME block (lines 434–436) unchanged, since it does not contain code syntax and serves as a useful clarification for future maintainers. No new methods, imports, or definitions are needed, as this is strictly a cleanup of commented-out code and does not affect functional behavior.
| @@ -434,9 +434,9 @@ | ||
| /*--- TODO/FIXME: This SOLUTION comms is likely redundant because Time_Integration | ||
| * (Explicit_Iteration_impl / CompleteImplicitIteration_impl) already syncs SOLUTION halos. | ||
| * Kept for testing; remove once verified. ---*/ | ||
| //solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION); | ||
| //solver_fine->CompleteComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION); | ||
|
|
||
|
|
||
|
|
||
| } | ||
| } | ||
|
|
| /*--- TODO/FIXME: This SOLUTION comms is likely redundant because Time_Integration | ||
| * (Explicit_Iteration_impl / CompleteImplicitIteration_impl) already syncs SOLUTION halos. | ||
| * Kept for testing; remove once verified. ---*/ | ||
| //solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION); |
Check notice
Code scanning / CodeQL
Commented-out code Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 hours ago
In general, to fix commented‑out code you either (a) delete it if it is no longer needed, relying on version control to recover it, or (b) reinstate it as active code if it is still required for correctness. Here, the surrounding comment already documents that this InitiateComms call is likely redundant and is only “kept for testing”, and the current active behavior is to call only CompleteComms. The best way to resolve the issue without changing existing functionality is to remove just the commented‑out call while preserving the explanatory block comment above it and the existing CompleteComms call.
Concretely, in SU2_CFD/src/integration/CMultiGridIntegration.cpp, inside CMultiGridIntegration::PostSmoothing, delete the single line //solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION);. No additional methods, imports, or definitions are needed because we are not changing the executed logic—only removing dead commented‑out code.
| @@ -483,7 +483,6 @@ | ||
| /*--- TODO/FIXME: This SOLUTION comms is likely redundant because Time_Integration | ||
| * (Explicit_Iteration_impl / CompleteImplicitIteration_impl) already syncs SOLUTION halos. | ||
| * Kept for testing; remove once verified. ---*/ | ||
| //solver_fine->InitiateComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION); | ||
| solver_fine->CompleteComms(geometry_fine, config, MPI_QUANTITIES::SOLUTION); | ||
|
|
||
| } |
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 --allto 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.