Skip to content

Zalbanob refactor#58

Draft
loganoz wants to merge 19 commits into
developfrom
zalbanob-refactor
Draft

Zalbanob refactor#58
loganoz wants to merge 19 commits into
developfrom
zalbanob-refactor

Conversation

@loganoz

@loganoz loganoz commented May 12, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors portions of the Navier–Stokes split-form volumetric contribution to reduce duplication (via an include template) and adds several OpenACC-focused updates across time integration, DG integrals, mesh device-data management, and element/face prolongation routines.

Changes:

  • Refactors split-form volumetric contribution into multiple averaging variants that share a common include template, with a dispatcher based on whichAverage.
  • Updates explicit time integration to dispatch step routines via RKStep_key (avoiding procedure-pointer issues with nvfortran) and adds/extends OpenACC parallelism in explicit methods and limiter code.
  • Adjusts DG integral kernels and mesh/device-data handling for GPU execution (including NodalStorage device copies, wall-distance computation, and gradient-related routines).

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Solver/src/NavierStokesSolver/split_template.inc New shared OpenACC template for split-form volumetric contribution kernels.
Solver/src/NavierStokesSolver/SpatialDiscretization.f90 Adds per-averaging split routines and a whichAverage dispatcher using the shared template.
Solver/src/libs/timeintegrator/TimeIntegrator.f90 Switches explicit stepping to a select case dispatch on RKStep_key.
Solver/src/libs/timeintegrator/ExplicitMethods.f90 Adds OpenACC loops for SSPRK33 save/update and rewrites stage limiter for GPU execution.
Solver/src/libs/physics/navierstokes/RiemannSolvers_NS.f90 Exposes specific two-point flux routines for selection/renaming in callers.
Solver/src/libs/mesh/HexMesh.f90 Tweaks OpenACC copyin/present usage, wall-distance GPU computation, and device data management (incl. NodalStorage ranges).
Solver/src/libs/mesh/HexElementClass.f90 Fixes face prolongation indexing/dimensions, adds NS gradient-variable selector routine, and guards gradient loops for N=0.
Solver/src/libs/discretization/EllipticBR1.f90 Selects NS gradient-variable conversion routine based on grad_vars.
Solver/src/libs/discretization/DGIntegrals.f90 Splits volume integral accumulation by direction and adds conditional handling in face kernels.
.gitignore Ignores NVHPC/OpenACC “-gpu=keep” artifacts and fixes doc output ignore entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

end do ; end do ; end do

enddo
!$acc end parallel loop
Comment on lines +1371 to +1373
integer :: i, j, k, l, eq, eID
real(kind=RP) :: Flux(1:NCONS, 1:NDIM), Q_acc
include 'split_template.inc'
case (SSPRK43_KEY)
CALL TakeSSPRK43Step(sem % mesh, sem % particles, t, dt, ComputeTimeDerivative)
case (EULER_RK3_KEY)
CALL TakeEulerRK3Step(sem % mesh, sem % particles, t, dt, ComputeTimeDerivative, iter=k)
Comment thread Solver/src/libs/discretization/DGIntegrals.f90 Outdated
Comment thread Solver/src/libs/discretization/DGIntegrals.f90 Outdated
Comment on lines +4176 to +4178
else
e % geom % dWall = huge(1.0_RP)
end if
!$acc end parallel loop
!$acc end data
else
fe % geom % dWall = huge(1.0_RP)
@amrueda amrueda mentioned this pull request May 21, 2026

@amrueda amrueda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @zalbanob!
Here an initial review where I suggest the removal of extra checks N > 0.

Comment thread Solver/src/libs/discretization/DGIntegrals.f90 Outdated
Comment thread Solver/src/libs/discretization/DGIntegrals.f90 Outdated
Comment thread Solver/src/libs/discretization/DGIntegrals.f90 Outdated
Comment thread Solver/src/libs/discretization/DGIntegrals.f90 Outdated
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.22312% with 344 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.07%. Comparing base (50c4d23) to head (2e2bc2c).

Files with missing lines Patch % Lines
Solver/src/libs/timeintegrator/ExplicitMethods.f90 5.76% 88 Missing and 10 partials ⚠️
Solver/src/libs/mesh/HexElementClass.f90 6.15% 4 Missing and 57 partials ⚠️
Solver/src/libs/mesh/HexMesh.f90 26.31% 13 Missing and 43 partials ⚠️
Solver/src/NavierStokesSolver/split_template.inc 9.52% 9 Missing and 29 partials ⚠️
...NavierStokes/Cylinderssprk33/SETUP/ProblemFile.f90 47.05% 16 Missing and 20 partials ⚠️
...NavierStokes/Cylinderssprk43/SETUP/ProblemFile.f90 47.05% 16 Missing and 20 partials ⚠️
Solver/src/libs/discretization/DGIntegrals.f90 0.00% 0 Missing and 7 partials ⚠️
Solver/src/libs/discretization/EllipticBR1.f90 14.28% 3 Missing and 3 partials ⚠️
...r/src/NavierStokesSolver/SpatialDiscretization.f90 92.68% 2 Missing and 1 partial ⚠️
Solver/src/libs/timeintegrator/TimeIntegrator.f90 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #58      +/-   ##
===========================================
+ Coverage    20.71%   21.07%   +0.36%     
===========================================
  Files          205      210       +5     
  Lines        40276    40728     +452     
  Branches     19786    19985     +199     
===========================================
+ Hits          8343     8585     +242     
- Misses       25632    25694      +62     
- Partials      6301     6449     +148     
Files with missing lines Coverage Δ
...rc/libs/physics/navierstokes/RiemannSolvers_NS.f90 69.07% <100.00%> (-0.72%) ⬇️
...r/src/NavierStokesSolver/SpatialDiscretization.f90 22.72% <92.68%> (+6.59%) ⬆️
Solver/src/libs/timeintegrator/TimeIntegrator.f90 47.29% <57.14%> (+3.23%) ⬆️
Solver/src/libs/discretization/EllipticBR1.f90 32.85% <14.28%> (+0.26%) ⬆️
Solver/src/libs/discretization/DGIntegrals.f90 7.45% <0.00%> (-0.10%) ⬇️
...NavierStokes/Cylinderssprk33/SETUP/ProblemFile.f90 47.05% <47.05%> (ø)
...NavierStokes/Cylinderssprk43/SETUP/ProblemFile.f90 47.05% <47.05%> (ø)
Solver/src/NavierStokesSolver/split_template.inc 9.52% <9.52%> (ø)
Solver/src/libs/mesh/HexMesh.f90 22.29% <26.31%> (+0.60%) ⬆️
Solver/src/libs/mesh/HexElementClass.f90 23.50% <6.15%> (+0.27%) ⬆️
... and 1 more

... and 9 files with indirect coverage changes

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

Comment on lines +838 to +849
- name: Run ForwardFacingStep_SSPRK33
working-directory: ./Solver/test/NavierStokes/ForwardFacingStep_SSPRK33
run: |
# source /opt/intel/oneapi/setvars.sh || true
mpiexec --oversubscribe -n 8 ./horses3d.ns FFS_SSPRK33.control
if: '!cancelled()'

#
# 24) Forward facing step with SSPRK43
# ------------------------------------
# GPU
# - name: Build ForwardFacingStep_SSPRK43
# working-directory: ./Solver/test/NavierStokes/ForwardFacingStep_SSPRK43/SETUP
# run: |
# # source /opt/intel/oneapi/setvars.sh || true
# make ns MODE=${{matrix.mode}} COMPILER=${{matrix.compiler}} COMM=${{matrix.comm}} ENABLE_THREADS=${{matrix.enable_threads}} WITH_METIS=YES
# if: '!cancelled()'
- name: Build ForwardFacingStep_SSPRK43

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These two cases are failing because they use the 2D mode, which is apparently not working in the GPU version of the code.

@horses-framework horses-framework deleted a comment from codecov Bot Jun 17, 2026
@amrueda amrueda closed this Jun 17, 2026
@amrueda amrueda reopened this Jun 17, 2026
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

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.

5 participants