-
Notifications
You must be signed in to change notification settings - Fork 111
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 <xtian64@login-phoenix-rh9-3.pace.gatech.edu> Co-authored-by: Spencer Bryngelson <sbryngelson@gmail.com> Co-authored-by: Spencer Bryngelson <shb@gatech.edu>
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 <xtian64@login-phoenix-rh9-3.pace.gatech.edu> Co-authored-by: Spencer Bryngelson <sbryngelson@gmail.com> Co-authored-by: Spencer Bryngelson <shb@gatech.edu> Co-authored-by: mohdsaid497566 <mohdsaid497566@gmail.com> Co-authored-by: Tanush Prathi <tprathi3@login-phoenix-rh9-1.pace.gatech.edu> Co-authored-by: Mohammed S. Al-Mahrouqi <145478595+mohdsaid497566@users.noreply.github.com> Co-authored-by: Ben Wilfong <48168887+wilfonba@users.noreply.github.com>
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 kernels
and 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 format
before 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:
nvtx
ranges 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 create
statements to$:GPU_DECLARE(create='[...]')
format• Replaced
!$acc parallel loop
with$:GPU_PARALLEL_LOOP
macro calls• Updated
!$acc routine seq
to$: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 macros
src/simulation/m_riemann_solvers.fpp
• Replaced OpenACC directives with FYPP GPU macros throughout the file
• Converted
!$acc declare create
statements to$:GPU_DECLARE(create='[...]')
format• Replaced
!$acc parallel loop
with
$:GPU_PARALLEL_LOOP
macro calls• Updated
!$acc loop seq
to$:GPU_LOOP(parallelism='[seq]')
format• Converted
!$acc update
and!$acc enter data
to corresponding GPU macrosm_bubbles_EL.fpp
Replace OpenACC directives with FYPP GPU macros
src/simulation/m_bubbles_EL.fpp
• Added FYPP GPU macros include and replaced OpenACC directives
•
Converted
!$acc declare create
statements to$:GPU_DECLARE(create='[...]')
format• Replaced
!$acc parallel loop
with
$:GPU_PARALLEL_LOOP
macro calls• Updated
!$acc routine seq
to$:GPU_ROUTINE
macro format• Converted
!$acc update
statements to$:GPU_UPDATE
macro callsm_helper_basic.fpp
Add FYPP macros and replace OpenACC routine directives
src/common/m_helper_basic.fpp
• Added FYPP macros include directive at the top of the file
•
Replaced
!$acc routine seq
directives with$:GPU_ROUTINE(parallelism='[seq]')
macro callsm_viscous.fpp
Replace OpenACC directives with FYPP GPU macros in viscous module
src/simulation/m_viscous.fpp
• Replaced OpenACC directives with FYPP GPU macros throughout the file
• Converted
!$acc declare create
to$:GPU_DECLARE(create='[...]')
•
Replaced
!$acc update device
with$:GPU_UPDATE(device='[...]')
•
Converted
!$acc parallel loop
to$:GPU_PARALLEL_LOOP
with appropriateparameters
• Replaced
!$acc loop seq
with$:GPU_LOOP(parallelism='[seq]')
m_rhs.fpp
Replace OpenACC directives with FYPP GPU macros in RHS module
src/simulation/m_rhs.fpp
• Replaced OpenACC directives with FYPP GPU macros for variable
declarations
• Converted
!$acc declare create
to$:GPU_DECLARE(create='[...]')
• Replaced
!$acc enter data
and!$acc
exit data
with corresponding GPU macros• Converted
!$acc parallel
loop
to$:GPU_PARALLEL_LOOP
with collapse and private parameters•
Updated
!$acc loop seq
to$:GPU_LOOP(parallelism='[seq]')
m_cbc.fpp
Replace OpenACC directives with FYPP GPU macros in CBC module
src/simulation/m_cbc.fpp
• Replaced OpenACC directives with FYPP GPU macros for variable
declarations
• Converted
!$acc declare create
to$:GPU_DECLARE(create='[...]')
• Replaced
!$acc update device
with$:GPU_UPDATE(device='[...]')
• Converted
!$acc parallel loop
to$:GPU_PARALLEL_LOOP
with appropriate parameters• Updated
!$acc loop
seq
to$:GPU_LOOP(parallelism='[seq]')
m_mpi_proxy.fpp
Replace OpenACC directives with FYPP GPU macros in MPI proxy
src/simulation/m_mpi_proxy.fpp
• Replaced OpenACC directives with FYPP GPU macros for variable
declarations
• Converted
!$acc declare create
to$:GPU_DECLARE(create='[i_halo_size]')
• Replaced
!$acc update device
with
$:GPU_UPDATE(device='[i_halo_size]')
• Converted
!$acc parallel
loop
to$:GPU_PARALLEL_LOOP
with private parametersm_patches.fpp
Replace OpenACC routine directives with FYPP GPU macros in patches
src/pre_process/m_patches.fpp
• Replaced OpenACC routine directives with FYPP GPU macros
• Converted
!$acc routine seq
to$: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 parameters
src/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 conversion
src/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 macros
src/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 macros
src/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 directives
src/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 macros
src/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 macros
src/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