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

Work Checklist - Prototyping a MPAS-A v8 OpenACC Port #1

Open
10 of 20 tasks
gdicker1 opened this issue Feb 23, 2024 · 9 comments
Open
10 of 20 tasks

Work Checklist - Prototyping a MPAS-A v8 OpenACC Port #1

gdicker1 opened this issue Feb 23, 2024 · 9 comments
Assignees
Labels

Comments

@gdicker1
Copy link
Owner

gdicker1 commented Feb 23, 2024

This issue is meant to collect, discuss, and track efforts to create a new prototype branch of the MPAS-Model.

It is desired that this branch:

  • is based on some version of the v8.x.x MPAS-Dev/MPAS-Model code
  • utilizes heterogeneous computing systems (CPU+GPU), at least through OpenACC directives and other modifications
  • focuses on the general, shared MPAS framework such that it remains interoperable with (and non-specific to) any core
  • (eventually) focuses on the "dynamics" of the atmosphere core such that:
    • various stand-alone configurations are possible (e.g. kessler, convection_permitting, or none for physics schemes)
    • the atmosphere core can be easily used as a "dycore" in various community earth system models (e.g. CAM, CAM-SIMA, EarthWorks)

Current work items:

  • Expand initial work
    • edit the settings of my (this) fork of MPAS-Model for group collaboration
    • create branch based on specific version of MPAS-Dev/MPAS-Model
    • enlist/entrain collaborator(s)
      • invite collaborators on my fork of MPAS-Model
      • tag them in this discussion
    • other...
  • Given the branch based on specific MPAS-Model "version", add a minimal ("hello, world" level) OpenACC test

Incremental Steps

A.k.a. Roadmap

    • (Minimal) Build with OpenACC enabled
    • Verify ability to run on GPU -> "minimal OpenACC test" for 1 MPI rank
    • Identify crucial infrastructure to be ported using OpenACC or created
      • Add routine to map MPI ranks to GPU devices
    • Begin incrementally porting and creating infrastructure routines until "critical point"1
    • Identify crucial routines in core_atmosphere, driver, and elsewhere to port using OpenACC
    • Begin incrementally porting routines until "critical point" using select test cases 2
      • Port atm_compute_solve_diagnostics_work
      • Port atm_advance_scalars_work
      • Port atm_compute_solve_diagnostics
      • Port remaining routines in dycore...
    • Make improvements on the port to at least ensure "robustness" 3
    • [END OF PROJECT] Assess next steps and how to integrate this to other projects (e.g. EarthWorks, MPAS-Dev/MPAS-Model repo)

Footnotes

  1. Here "critical point" is to mean some point that is "sufficient" for future work

  2. NOTE: the test cases are TBD and may also be an incremental set of tests

  3. NOTE: this means addressing memory management and maybe any performance issues that need to be addressed.

@gdicker1 gdicker1 added enhancement New feature or request help wanted Extra attention is needed labels Feb 23, 2024
@gdicker1 gdicker1 self-assigned this Feb 23, 2024
@gdicker1
Copy link
Owner Author

  • enlist/entrain collaborator(s)

    • invite collaborators on my fork of MPAS-Model
    • tag them in this discussion

@mgduda, I think this comment satisfies my first check box :) Let me know what you think so far!

@gdicker1 gdicker1 removed the enhancement New feature or request label Feb 23, 2024
@gdicker1
Copy link
Owner Author

  • is based on some version of the v8.x.x MPAS-Dev/MPAS-Model code

This has already been discussed some. The thought is to use "the current version of MPAS-A that is being used in ESCOMP/CAM's cam_development branch"

  • Tag in ESCOMP/CAM that is the current head of cam_development: cam6_3_150
  • Hash for [mpas] within Externals_CAM.cfg: b8c33daa

@mgduda
Copy link
Collaborator

mgduda commented Feb 26, 2024

  • is based on some version of the v8.x.x MPAS-Dev/MPAS-Model code

This has already been discussed some. The thought is to use "the current version of MPAS-A that is being used in ESCOMP/CAM's cam_development branch"

* Tag in ESCOMP/CAM that is the current head of cam_development: [cam6_3_150](https://github.com/ESCOMP/CAM/tree/cam6_3_150)

* Hash for `[mpas]` within Externals_CAM.cfg: [b8c33daa](https://github.com/ESCOMP/CAM/blob/f9b91b90d1a085bcd99f1df005569954c4cf036b/Externals_CAM.cfg#L71C8-L71C16)

I think we should create the branch based on b8c33daa in this case.

@mgduda
Copy link
Collaborator

mgduda commented Feb 26, 2024

To restate the goal of this work as I see it, we want an OpenACC port of the MPAS-A dycore -- starting from b8c33da -- that works in stand-alone MPAS-A as well as in CAM-SIMA. Along the way, we'll very likely need to do some minor infrastructure development, and we should also implement some tests of that infrastructure. All infrastructure tests (along with the initial "Is OpenACC working at a basic level" test) will go in the test core.

@gdicker1 Can you expand the list of incremental developments that might get us to this end goal? This is of course a first cut, and we'll refine it over time.

@gdicker1
Copy link
Owner Author

@gdicker1 Can you expand the list of incremental developments that might get us to this end goal? ...

@mgduda what do you think of the new "Incremental Steps" heading so far?

@mgduda
Copy link
Collaborator

mgduda commented Feb 29, 2024

The "Incremental Steps" are looking good. For (2), I think we could specify at that point we are only concerned with 1 MPI rank. Then, there could be a step (2.5) (or just make it (3) and shift the numbering of later steps) to add a routine to map MPI ranks to ACC devices. This routine could initially just apply a simple mapping (e.g., mod(rank, num_devices)), but would provide a place where more sophisticated logic -- like that in atm_component_role could be implemented later as needed. This rank-mapping routine should probably be placed in shared code, though, so it could be tested by the test core or so that it could ensure a conflict-free mapping for different MPAS components.

@mgduda
Copy link
Collaborator

mgduda commented Feb 29, 2024

As an idea for some sub-tasks under (6), we could:

  • Port atm_compute_solve_diagnostics_work (nice because it isn't unwieldy and it contains no MPI communication)
  • Port atm_advance_scalars_work (to see whether the strategy taken for atm_compute_solve_diagnostics_work applies to other dynamics routines
  • Port atm_advance_scalars_mono_work (initially just do D->H transfers, halo exchanges, then H->D; but after computation in the routine has been ported, switch back to infrastructure and port halo exchange routines)
  • Port remaining routines in dycore

@gdicker1
Copy link
Owner Author

  • create branch based on specific version of MPAS-Dev/MPAS-Model

The development branch for this work will be in: gdicker1/MPAS-Model:v8_oacc/develop. Features will be merged into it over time - especially by Pull Request and Review for OpenACC features.

@gdicker1
Copy link
Owner Author

The development branch for this work will be in: gdicker1/MPAS-Model:v8_oacc/develop. Features will be merged into it over time - especially by Pull Request and Review for OpenACC features.

Note: since my last update some OpenACC work has been merged into the main MPAS-Dev/MPAS-Model:develop branch. I will use that (or at least where PR MPAS-Dev#1175 has been merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants