nalu-wind
nalu-wind copied to clipboard
Nalu-Wind Kernels – GPU transition
Tracking the progress of conversion of Nalu-Wind kernels for execution on GPUs. The basic process of converting a non-HO Kernel to GPU can be seen in commits 1e9382f66f4823 (volume master element) and 5ee617e3ad555 (surface master element). The steps are:
- Switch base class from
KerneltoNGPKernel<T<AlgTraits>>whereT = MomentumMassElemKernelfor example. - Replace private/deleted default constructor with a
defaultpublicconstructor that has theKOKKOS_FUNCTIONdecorator. - Add
KOKKOS_FUNCTIONdecorator to destructor, and usedefaultwhere possible. - Remove all non-POD data types from the Kernel, i.e., remove
Kokkos::Viewand any references (e.g., CoriosSrc stores a reference to SolutionOptions, this needs to be removed). - Remove any pointers to
stk::mesh::FieldBaseand replace them with field ordinals. - Switch the statement getting
meSCSandmeSCVpointer to use the templatedget_surface_master_elementandget_volume_master_elementversion; store a reference to this pointer in the instance variables for access inKernel::executemethod - Replace shape function logic by registering
SCS_SHAPE_FCNtoElemDataRequestsand accessing it viaScratchViewsinKernel::executeimplementation. Access adjacentNodes and nodeMap variables via themeSCS_andmeSCV_instances in theexecutemethod. - Add
DeviceShmemandDeviceTeamHandleTypetemplate parameters to arguments to theKernel::executemethod. - Convert the unit test and add an
NGP_prefix for easy filtering.
# Run only NGP-ready unit tests on GPU
$ ./unittest --gtest_filter=*.NGP*
Note that #186 may need to be resolved before some of the Kernels can be fully converted.
Non high-order kernels
- [x]
AssembleElemSolverAlgorithm(5016c5e208, c553311966) - [x]
AssembleFaceElemSolverAlgorithm(#219)
Interior algorithms; ready for conversion
- [x]
kernel/ContinuityAdvElemKernel(#194) - [x]
kernel/ContinuityMassElemKernel(#188) - [x]
kernel/MomentumAdvDiffElemKernel(#195) - [x]
kernel/MomentumMassElemKernel(#195) - [x]
kernel/ScalarMassElemKernel(#203) - [x]
kernel/ScalarAdvDiffElemKernel(#200) - [x]
kernel/TurbKineticEnergySSTDESSrcElemKernel(#212) - [x]
kernel/TurbKineticEnergySSTSrcElemKernel(#209) - [x]
kernel/SpecificDissipationRateSSTSrcElemKernel(#211) - [x]
kernel/WallDistElemKernel(#204)
Requires additional infrastructure (addressed in #220)
- [x]
kernel/MomentumUpwAdvDiffElemKernel - [x]
kernel/ScalarUpwAdvDiffElemKernel(#220)
Boundary conditions (ready for conversion after #219)
- [x]
kernel/ContinuityInflowElemKernel(#417) - [ ]
kernel/ContinuityOpenElemKernel - [ ]
kernel/MomentumOpenAdvDiffElemKernel - [ ]
kernel/MomentumSymmetryElemKernel - [ ]
kernel/MomentumWallFunctionElemKernel - [ ]
kernel/ScalarOpenAdvElemKernel
Interior algorithms (2); ready for conversion
- [x]
kernel/MomentumActuatorSrcElemKernel(#216) - [x]
kernel/MomentumBuoyancyBoussinesqSrcElemKernel(#217) - [x]
kernel/MomentumBuoyancySrcElemKernel(#218) - [x]
kernel/MomentumCoriolisSrcElemKernel(reference toSolutionOptionsneeds to be removed) - [x]
kernel/TurbKineticEnergyKsgsSrcElemKernel(#213) - [x]
kernel/TurbKineticEnergyKsgsDesignOrderSrcElemKernel(#214) - [x]
kernel/MomentumHybridTurbElemKernel(#215) - [ ]
nso/MomentumNSOElemKernel - [ ]
nso/MomentumNSOKeElemKernel - [ ]
nso/MomentumNSOSijElemKernel - [ ]
nso/ScalarNSOElemKernel - [ ]
nso/ScalarNSOKeElemKernel
- [ ]
kernel/ScalarDiffElemKernel - [ ]
kernel/ScalarDiffFemKernel - [ ]
kernel/ScalarFluxPenaltyElemKernel - [ ]
user_functions/SteadyThermal3dContactSrcElemKernel - [ ]
pmr/RadTransAbsorptionBlackBodyElemKernel - [ ]
pmr/RadTransAdvectionSUCVElemKernel - [ ]
pmr/RadTransIsotropicScatteringElemKernel - [ ]
pmr/RadTransWallElemKernel
HO Kernels
Needs HO master elements
- [ ]
AssembleElemSolverAlgorithmHO - [ ]
kernel/ContinuityMassHOElemKernel - [ ]
kernel/MomentumAdvDiffHOElemKernel - [ ]
kernel/MomentumBuoyancySrcHOElemKernel - [ ]
kernel/MomentumMassHOElemKernel - [ ]
kernel/PressurePoissonHOElemKernel - [ ]
kernel/ProjectedNodalGradientHOElemKernel - [ ]
kernel/ScalarAdvDiffHOElemKernel - [ ]
kernel/ScalarDiffHOElemKernel - [ ]
kernel/ScalarMassHOElemKernel - [ ]
user_functions/SteadyThermalContactSrcHOElemKernel - [ ]
user_functions/TGMMSHOElemKernel - [ ]
user_functions/VariableDensityContinuityMMSHOElemKernel - [ ]
user_functions/VariableDensityEnthalpyMMSHOElemKernel - [ ]
user_functions/VariableDensityMomentumMMSHOElemKernel
I'm currently working on kernel/ScalarMassElemKernel. (It's done and passing regression tests, but I don't have it unit-tested yet.)
@alanw0 Thanks, I'll use the [x] box to indicate someone is working on the kernel and then add the commit/pull-request ID to mark the kernel as DONE.
AssembleFaceElemSolverAlgorithm in progress by @alanw0
I am working on kernel/MomentumUpwAdvDiffElemKernel
I think I got kernel/TurbKineticEnergySSTSrcElemKernel with #209 . I'm going to try the rest of the SST kernels as well.
A note for when we return to element-based GPU conversion: Regarding AssembleFaceElemSolverAlgorithm. The run_algorithm method is converted and unit-tested, but the execute method needs to be converted next. Need to convert the unit-tests in UnitTestFaceElemBasic.C which call faceElemAlg.execute().
#829 removed these kernels