Zalbanob refactor#58
Conversation
There was a problem hiding this comment.
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 |
| 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) |
| 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) |
Zalbanob refactor
Fix for SSPRK33/SSPRK43
Co-authored-by: Andrés Rueda-Ramírez <am.rueda@upm.es>
Co-authored-by: Andrés Rueda-Ramírez <am.rueda@upm.es>
Co-authored-by: Andrés Rueda-Ramírez <am.rueda@upm.es>
| - 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 |
There was a problem hiding this comment.
These two cases are failing because they use the 2D mode, which is apparently not working in the GPU version of the code.
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 ☂️ |
No description provided.