-
Notifications
You must be signed in to change notification settings - Fork 121
Created FYPP macros to allow for meta-directive parallelization #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Xuzheng Tian <[email protected]> Co-authored-by: Spencer Bryngelson <[email protected]> Co-authored-by: Spencer Bryngelson <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||
|
-$:GPU_UPDATE(device='[idwbuff, idwbuff]') |
|
My PR unfortunately caused a merge error to resolve |
|
Weird, when I merged locally, it didn't show any conflicts. |
Yeah, not sure what GitHub was thinking, but it's actually a straightforward merge. Of course your local git may have made some merge assumptions that the website isn't willing to do, but in either case the resulting new code looks right. We'll see if it passes tests. Want to merge this soon so other people can fix their PRs if needed (which are accumulating...) |
…wCode#883) Co-authored-by: Xuzheng Tian <[email protected]> Co-authored-by: Spencer Bryngelson <[email protected]> Co-authored-by: Spencer Bryngelson <[email protected]> Co-authored-by: mohdsaid497566 <[email protected]> Co-authored-by: Tanush Prathi <[email protected]> Co-authored-by: Mohammed S. Al-Mahrouqi <[email protected]> Co-authored-by: Ben Wilfong <[email protected]>
User description
Description
Added FYPP macros that replace the current OpenACC directives. In a future pull request, the meta-directives will add support for OpenMP. This pull request has replaced all of the ACC directives except
acc kernelsand those inmpi_common.fpp, andsyscheck.fpp.Fixes #(issue) [optional]
Type of change
Please delete options that are not relevant.
Scope
If you cannot check the above box, please split your PR into multiple PRs that each have a common goal.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
Test Configuration:
Checklist
docs/)examples/that demonstrate my new feature performing as expected.They run to completion and demonstrate "interesting physics"
./mfc.sh formatbefore committing my codeIf your code changes any code source files (anything in
src/simulation)To make sure the code is performing as expected on GPU devices, I have:
nvtxranges so that they can be identified in profiles./mfc.sh run XXXX --gpu -t simulation --nsys, and have attached the output file (.nsys-rep) and plain text results to this PR./mfc.sh run XXXX --gpu -t simulation --rsys --hip-trace, and have attached the output file and plain text results to this PR.PR Type
Enhancement
Description
• Created comprehensive FYPP macro library for GPU parallelization directives in
parallel_macros.fpp• Replaced OpenACC directives with FYPP GPU macros across multiple simulation modules
• Converted
!$acc declare createstatements to$:GPU_DECLARE(create='[...]')format• Replaced
!$acc parallel loopwith$:GPU_PARALLEL_LOOPmacro calls• Updated
!$acc routine seqto$:GPU_ROUTINE(parallelism='[seq]')format• Converted data movement directives (
!$acc update,!$acc enter data) to corresponding GPU macros• Applied changes to core simulation modules including Riemann solvers, viscous, RHS, CBC, WENO, and others
• Maintained functionality while preparing codebase for future OpenMP meta-directive support
Changes walkthrough 📝
15 files
m_riemann_solvers.fpp
Replace OpenACC directives with FYPP GPU macrossrc/simulation/m_riemann_solvers.fpp
• Replaced OpenACC directives with FYPP GPU macros throughout the file
• Converted
!$acc declare createstatements to$:GPU_DECLARE(create='[...]')format• Replaced
!$acc parallel loopwith
$:GPU_PARALLEL_LOOPmacro calls• Updated
!$acc loop seqto$:GPU_LOOP(parallelism='[seq]')format• Converted
!$acc updateand!$acc enter datato corresponding GPU macrosm_bubbles_EL.fpp
Replace OpenACC directives with FYPP GPU macrossrc/simulation/m_bubbles_EL.fpp
• Added FYPP GPU macros include and replaced OpenACC directives
•
Converted
!$acc declare createstatements to$:GPU_DECLARE(create='[...]')format• Replaced
!$acc parallel loopwith
$:GPU_PARALLEL_LOOPmacro calls• Updated
!$acc routine seqto$:GPU_ROUTINEmacro format• Converted
!$acc updatestatements to$:GPU_UPDATEmacro callsm_helper_basic.fpp
Add FYPP macros and replace OpenACC routine directivessrc/common/m_helper_basic.fpp
• Added FYPP macros include directive at the top of the file
•
Replaced
!$acc routine seqdirectives with$:GPU_ROUTINE(parallelism='[seq]')macro callsm_viscous.fpp
Replace OpenACC directives with FYPP GPU macros in viscous modulesrc/simulation/m_viscous.fpp
• Replaced OpenACC directives with FYPP GPU macros throughout the file
• Converted
!$acc declare createto$:GPU_DECLARE(create='[...]')•
Replaced
!$acc update devicewith$:GPU_UPDATE(device='[...]')•
Converted
!$acc parallel loopto$:GPU_PARALLEL_LOOPwith appropriateparameters
• Replaced
!$acc loop seqwith$:GPU_LOOP(parallelism='[seq]')m_rhs.fpp
Replace OpenACC directives with FYPP GPU macros in RHS modulesrc/simulation/m_rhs.fpp
• Replaced OpenACC directives with FYPP GPU macros for variable
declarations
• Converted
!$acc declare createto$:GPU_DECLARE(create='[...]')• Replaced
!$acc enter dataand!$accexit datawith corresponding GPU macros• Converted
!$acc parallelloopto$:GPU_PARALLEL_LOOPwith collapse and private parameters•
Updated
!$acc loop seqto$:GPU_LOOP(parallelism='[seq]')m_cbc.fpp
Replace OpenACC directives with FYPP GPU macros in CBC modulesrc/simulation/m_cbc.fpp
• Replaced OpenACC directives with FYPP GPU macros for variable
declarations
• Converted
!$acc declare createto$:GPU_DECLARE(create='[...]')• Replaced
!$acc update devicewith$:GPU_UPDATE(device='[...]')• Converted
!$acc parallel loopto$:GPU_PARALLEL_LOOPwith appropriate parameters• Updated
!$acc loopseqto$:GPU_LOOP(parallelism='[seq]')m_mpi_proxy.fpp
Replace OpenACC directives with FYPP GPU macros in MPI proxysrc/simulation/m_mpi_proxy.fpp
• Replaced OpenACC directives with FYPP GPU macros for variable
declarations
• Converted
!$acc declare createto$:GPU_DECLARE(create='[i_halo_size]')• Replaced
!$acc update devicewith
$:GPU_UPDATE(device='[i_halo_size]')• Converted
!$acc parallelloopto$:GPU_PARALLEL_LOOPwith private parametersm_patches.fpp
Replace OpenACC routine directives with FYPP GPU macros in patchessrc/pre_process/m_patches.fpp
• Replaced OpenACC routine directives with FYPP GPU macros
• Converted
!$acc routine seqto$:GPU_ROUTINE(parallelism='[seq]')• Applied
changes to coordinate conversion functions and helper routines
m_global_parameters.fpp
Replace OpenACC directives with FYPP GPU macros in global parameterssrc/simulation/m_global_parameters.fpp
• Replaced OpenACC directives with FYPP GPU_DECLARE macros for
variable declarations
• Replaced OpenACC update directives with FYPP
GPU_UPDATE macros for device updates
• Replaced OpenACC enter data
directives with FYPP GPU_ENTER_DATA macros
• Consolidated multiple GPU
declarations into fewer macro calls with array syntax
m_variables_conversion.fpp
Convert OpenACC directives to FYPP GPU macros in variables conversionsrc/common/m_variables_conversion.fpp
• Replaced OpenACC routine directives with FYPP GPU_ROUTINE macros
•
Replaced OpenACC parallel loop directives with FYPP GPU_PARALLEL_LOOP
macros
• Replaced OpenACC loop directives with FYPP GPU_LOOP macros
•
Updated data movement directives to use FYPP GPU_ENTER_DATA and
GPU_UPDATE macros
m_weno.fpp
Modernize WENO module with FYPP GPU macrossrc/simulation/m_weno.fpp
• Added GPU_DECLARE macros for WENO-related variable declarations
•
Replaced OpenACC parallel loop directives with FYPP GPU_PARALLEL_LOOP
macros
• Replaced OpenACC loop directives with FYPP GPU_LOOP macros
•
Updated device data updates to use FYPP GPU_UPDATE macros
m_boundary_common.fpp
Convert boundary condition module to FYPP GPU macrossrc/common/m_boundary_common.fpp
• Replaced OpenACC declare directives with FYPP GPU_DECLARE macros
•
Replaced OpenACC parallel loop directives with FYPP GPU_PARALLEL_LOOP
macros
• Replaced OpenACC routine directives with FYPP GPU_ROUTINE
macros
• Updated device data updates to use FYPP GPU_UPDATE macros
parallel_macros.fpp
Create FYPP macro library for GPU parallelization directivessrc/common/include/parallel_macros.fpp
• Added comprehensive FYPP macro definitions for GPU parallelization
•
Implemented macros for OpenACC directives like GPU_PARALLEL_LOOP,
GPU_ROUTINE, GPU_DECLARE
• Added support for various OpenACC clauses
and data management directives
• Included helper functions for
generating proper clause syntax
m_qbmm.fpp
Modernize QBMM module with FYPP GPU macrossrc/simulation/m_qbmm.fpp
• Replaced OpenACC declare directives with FYPP GPU_DECLARE macros
•
Replaced OpenACC parallel loop directives with FYPP GPU_PARALLEL_LOOP
macros
• Replaced OpenACC routine directives with FYPP GPU_ROUTINE
macros
• Updated data movement directives to use FYPP GPU_ENTER_DATA
and GPU_UPDATE macros
m_hypoelastic.fpp
Convert hypoelastic module to FYPP GPU macrossrc/simulation/m_hypoelastic.fpp
• Replaced OpenACC declare directives with FYPP GPU_DECLARE macros
•
Replaced OpenACC parallel loop directives with FYPP GPU_PARALLEL_LOOP
macros
• Replaced OpenACC loop directives with FYPP GPU_LOOP macros
•
Updated device data updates to use FYPP GPU_UPDATE macros
23 files