Skip to content
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

Add OpenACC directives in the semi-implicit barotropic mode solver #5583

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

hyungyukang
Copy link
Contributor

The semi-implicit barotropic solver in E3SM ocean component has been ported on GPU by adding OpenACC directives.

Running and testing have been done for the stand-alone MPAS-O on Summit only at this moment, and how to run and test on Summit is documented in E3SM Confluence: https://acme-climate.atlassian.net/wiki/spaces/OO/pages/3718087262/Running+MPAS-Ocean+with+a+GPU-accelerated+semi-implicit+barotropic+mode+solver+option

To compile MPAS-O with MAGMA or CUBLAS for GPU-accelerated linear algebras, some additions (USE_MAGMA, USE_CUBLAS) have been made to mpas-framework/Makefile

A subroutine si_halo_exch is added in the semi-implicit solver code, which is very experimental, to use GPU-aware MPI for local halo exchanges during solver iterations. It currently works on GPU but much slower than the data staging halo exchange. The subroutine will be further optimized.

The semi-implicit barotropic mode solver is a stealth function, so it does not affect to default configurations.

@hyungyukang hyungyukang added mpas-ocean BFB PR leaves answers BFB Stealth PR has feature which, if turned on, could change climate. fka FCC OpenACC labels Apr 6, 2023
@hyungyukang hyungyukang changed the title Add OpenACC directives for the semi-implicit barotropic mode solver Add OpenACC directives in the semi-implicit barotropic mode solver Apr 6, 2023
@grnydawn
Copy link
Contributor

@hyungyukang, I will leave code review to whom knows this code well. My comment is about the list of git commits. It looks that there are many small git commits which will be shown in E3SM commit history. It may be good if you combine them as one or two commits before merging master branch.

@hyungyukang
Copy link
Contributor Author

@hyungyukang, I will leave code review to whom knows this code well. My comment is about the list of git commits. It looks that there are many small git commits which will be shown in E3SM commit history. It may be good if you combine them as one or two commits before merging master branch.

@grnydawn , Agreed. There would be more commits, so I will combine all of my commits before merging into master. Thanks for your suggestions!

Copy link
Contributor

@grnydawn grnydawn left a comment

Choose a reason for hiding this comment

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

it looks good to me

Copy link
Contributor

@philipwjones philipwjones left a comment

Choose a reason for hiding this comment

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

This looks fine to me. Approve based on code inspection and Hyun testing.

@sarats sarats self-requested a review April 11, 2023 19:13
jonbob added a commit that referenced this pull request Apr 11, 2023
Add OpenACC directives in the semi-implicit barotropic mode solver

The semi-implicit barotropic solver in E3SM ocean component has been
ported on GPU by adding OpenACC directives.

To compile MPAS-O with MAGMA or CUBLAS for GPU-accelerated linear
algebra, some additions (USE_MAGMA, USE_CUBLAS) have been made to
mpas-framework/Makefile. A subroutine si_halo_exch is added in the
semi-implicit solver code, which is very experimental, to use GPU-aware
MPI for local halo exchanges during solver iterations.

The semi-implicit barotropic mode solver is not currently used in E3SM,
so it does not affect default configurations.

[BFB]
@jonbob
Copy link
Contributor

jonbob commented Apr 11, 2023

passes:

  • SMS_D_Ld3.T62_oQU120.CMPASO-IAF.chrysalis_intel
  • ERS.ne11_oQU240.WCYCL1850NS.chrysalis_intel
  • SMS_D_Ld1.ne30pg2_EC30to60E2r2.WCYCL1850.chrysalis_intel.allactive-wcprod

merged to next

- Porting the semi-implicit barotropic mode solver on GPU using OpenACC directives
- Update Makefile for MAGMA, CUBLAS, GPU_AWARE_MPI use
- A subroutine 'si_halo_exch' is added in the SI solver code, which is very experimental, to use GPU-aware MPI for local halo exchanges during solver iterations.

Add SI halo exch routine and related codes

Implmentation of si_halo_exch

Add SI solver opencacc code
@hyungyukang hyungyukang force-pushed the hkang/ocean/si-openacc branch from 5681515 to a6b2f55 Compare April 11, 2023 21:35
@hyungyukang
Copy link
Contributor Author

@sarats , @philipwjones, @grnydawn , and @jonbob , Thanks a lot for reviewing and testing and your approval!

@jonbob jonbob merged commit ad37255 into master Apr 12, 2023
@jonbob jonbob deleted the hkang/ocean/si-openacc branch April 12, 2023 18:44
@jonbob
Copy link
Contributor

jonbob commented Apr 12, 2023

merged to master

xylar added a commit to xylar/compass that referenced this pull request Apr 18, 2023
This merge updates the E3SM-Project submodule from [c292bec000](https://github.com/E3SM-Project/E3SM/tree/c292bec000) to [4b3e611fee](https://github.com/E3SM-Project/E3SM/tree/4b3e611fee).

This update includes the following MPAS-Ocean and MPAS-Frameworks PRs (check mark indicates bit-for-bit with previous PR in the list):
- [ ]  (ocn) E3SM-Project/E3SM#5418
- [ ]  (ocn) E3SM-Project/E3SM#5447
- [ ]  (ocn) E3SM-Project/E3SM#5568
- [ ]  (ocn) E3SM-Project/E3SM#5583
- [ ]  (ocn) E3SM-Project/E3SM#5575
- [ ]  (ocn) E3SM-Project/E3SM#5600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB mpas-ocean OpenACC Stealth PR has feature which, if turned on, could change climate. fka FCC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants