Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds multiple Kokkos-based implementations of the Shallow Water Model (SWM), including various execution policies (TeamPolicy, RangePolicy, MDRangePolicy) and a hybrid Kokkos+OpenACC+Fortran version. The implementations have been verified against the C serial version for both CPU and GPU execution. Supporting utilities for verification and performance visualization are also included.
Key Changes:
- Implementation of four distinct Kokkos policy variations for performance comparison
- Hybrid Kokkos+Fortran+OpenACC implementation demonstrating interoperability
- Python utilities for result validation and performance plotting
- CMake integration for building Kokkos implementations
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| swm_kokkos/various_policy_impls/shallow_teampolicy.cpp | TeamPolicy-based SWM implementation with hierarchical parallelism |
| swm_kokkos/various_policy_impls/shallow_rangepolicy_flat.cpp | RangePolicy implementation using flattened index calculations |
| swm_kokkos/various_policy_impls/shallow_rangepolicy.cpp | RangePolicy implementation with inner serial loops |
| swm_kokkos/various_policy_impls/shallow_mdrangepolicy.cpp | MDRangePolicy implementation for multi-dimensional parallelism |
| swm_kokkos/utils/plot.py | Performance visualization script for comparing implementations |
| swm_kokkos/utils/data/O2/kokkos_teampolicy.csv | Benchmark data for TeamPolicy implementation |
| swm_kokkos/utils/data/O2/kokkos_rangepolicy.csv | Benchmark data for RangePolicy implementation |
| swm_kokkos/utils/data/O2/kokkos_mdrangepolicy.csv | Benchmark data for MDRangePolicy implementation |
| swm_kokkos/utils/comparison_results.sh | Shell script for automated result verification |
| swm_kokkos/utils/comparison_results.py | Python script for numerical comparison of outputs |
| swm_kokkos/kokkos_fortran_openacc/shallow_mdrangepolicy.cpp | C++ wrapper for Kokkos+Fortran+OpenACC hybrid implementation |
| swm_kokkos/kokkos_fortran_openacc/shallow_fortran_acc.F90 | Fortran module with OpenACC directives for time loop |
| swm_kokkos/CMakeLists.txt | Build configuration for Kokkos implementations |
| CMakeLists.txt | Top-level CMake configuration with SWM_KOKKOS option |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| path1="/glade/derecho/scratch/sunjian/SWM_KOKKOS_CUDA_BUILD/swm_c/c/" | ||
| path2="/glade/derecho/scratch/sunjian/SWM_KOKKOS_CUDA_BUILD/swm_kokkos/kokkos_fortran_openacc/" |
There was a problem hiding this comment.
Hard-coded absolute paths reduce script portability. Consider using relative paths or environment variables to make the script usable across different systems and user configurations.
| path1="/glade/derecho/scratch/sunjian/SWM_KOKKOS_CUDA_BUILD/swm_c/c/" | |
| path2="/glade/derecho/scratch/sunjian/SWM_KOKKOS_CUDA_BUILD/swm_kokkos/kokkos_fortran_openacc/" | |
| # Use environment variables SWM_C_PATH and SWM_KOKKOS_PATH if set, otherwise use current directory as default | |
| path1="${SWM_C_PATH:-./swm_c/c/}" | |
| path2="${SWM_KOKKOS_PATH:-./swm_kokkos/kokkos_fortran_openacc/}" |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request introduces the multiple implementations of Kokkos based SWM (e.g., different policies, Kokkos+OpenACC).
All the CPU and GPU answers are verified against the C serial version.
It also includes some util python scripts for verification check and visualization.