Skip to content

Commit 9494ad5

Browse files
committed
#2551 Update changelog and some integration tests aspects
1 parent 8aece1f commit 9494ad5

6 files changed

Lines changed: 40 additions & 28 deletions

File tree

.github/workflows/nemo_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ jobs:
231231
num_omp_threads: '"$OMP_NUM_THREADS"', elapsed_time: '"$VAR_TIME"'})'
232232
233233
# PSyclone, compile and run MetOffice NEMO with OpenMP for GPUs with Asynchronous directives
234-
- name: NEMO MetOffice OpenMP for GPU
234+
- name: NEMO MetOffice OpenMP for GPU with async
235235
run: |
236236
. .runner_venv/bin/activate
237237
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
@@ -256,5 +256,5 @@ jobs:
256256
--password ${{ secrets.MONGODB_PASSWORD }} \
257257
--eval 'db.GitHub_CI.insertOne({branch_name: "'"$GITHUB_REF_NAME"'", commit: "'"$GITHUB_SHA"'",
258258
github_job: "'"$GITHUB_RUN_ID"'"-"'"$GITHUB_RUN_ATTEMPT"'",
259-
ci_test: "NEMOv4 OpenMP for GPU", nemo_version: "NEMO MO 4.0.2", system: "GlaDos",
259+
ci_test: "NEMOv4 OpenMP for GPU Async", nemo_version: "NEMO MO 4.0.2", system: "GlaDos",
260260
compiler:"nvhpc-'"$NVFORTRAN_VERSION"'", date: new Date(), elapsed_time: '"$VAR_TIME"'})'

.github/workflows/nemo_v5_tests.yml

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ jobs:
346346
347347
348348
- name: NEMO 5.0 nvidia Async OpenMP for GPUs (BENCH - managed memory)
349+
# Only do this Action if this is a re-run
350+
if: ${{ github.run_attempt != '1' }}
349351
run: |
350352
# Set up environment
351353
source /apps/spack/psyclone-spack-25.3/spack-repo/share/spack/setup-env.sh
@@ -404,10 +406,10 @@ jobs:
404406
--password ${{ secrets.MONGODB_PASSWORD }} \
405407
--eval 'db.GitHub_CI.insertOne({branch_name: "'"$GITHUB_REF_NAME"'", commit: "'"$GITHUB_SHA"'",
406408
github_job: "'"$GITHUB_RUN_ID"'"-"'"$GITHUB_RUN_ATTEMPT"'",
407-
ci_test: "NEMOv5 OpenMP for GPU (BENCH)", nemo_version: "NEMOv5", system: "GlaDos",
409+
ci_test: "NEMOv5 OpenMP for GPU Async (BENCH)", nemo_version: "NEMOv5", system: "GlaDos",
408410
compiler:"nvhpc-24.11" , date: new Date(), elapsed_time: '"${TIME_sec}"'})'
409411
410-
- name: NEMO 5.0 nvidia Async OpenMP for GPUs (UKMO ORCA1 - managed memory)
412+
- name: NEMO 5.0 nvidia Async OpenMP for GPUs (UKMO ORCA2 - managed memory)
411413
run: |
412414
# Set up environment
413415
source /apps/spack/psyclone-spack-25.3/spack-repo/share/spack/setup-env.sh
@@ -416,7 +418,7 @@ jobs:
416418
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
417419
export PSYCLONE_HOME=${PWD}/.runner_venv
418420
export NEMO_DIR=${HOME}/${NEMODIR_NAME}
419-
export TEST_DIR=ORCA1_OMP_OFFLOAD_NVHPC
421+
export TEST_DIR=ORCA2_OMP_OFFLOAD_NVHPC
420422
421423
# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
422424
# We compile at "-O2 -Mnofma -Mnovect -gpu=math_uniform" to permit comparison of the results.
@@ -428,28 +430,28 @@ jobs:
428430
429431
# Clean up and compile
430432
rm -rf cfgs/${TEST_DIR}
431-
./makenemo -r GOSI10p0.0_like_eORCA1 -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/omp_gpu_trans.py \
432-
-j 4 -v 1
433+
./makenemo -r ORCA2_ICE_PISCES -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/omp_gpu_trans.py \
434+
add_key "key_mpi_off key_nosignedzero" -j 4 -v 1
433435
434436
# Run test
435437
cd $NEMO_DIR/cfgs/${TEST_DIR}/EXP00
436-
ln -sf /archive/NEMO_INPUTS/NEMOv5_MO_original_files/ancil/eORCA1/link/* .
437-
# Make sure mpi has been built with cuda support
438-
ompi_info --parsable --all | grep mpi_built_with_cuda_support:value
439-
# Run with round robin allocations of GPUs to MPI ranks
440-
mpirun -n 2 sh -c 'CUDA_VISIBLE_DEVICES=$OMPI_COMM_WORLD_LOCAL_RANK ./nemo'
441-
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.orca1.nvhpc.10steps run.stat
442-
export TIME_sec=$(grep "local MPI proces" timing.output | head -n 1 | awk '{print $5}' | tr -d s)
438+
ln -sf ../../../ORCA2_ICE_v4.2.0/* .
439+
# Uses both, threading and offloading
440+
OMP_NUM_THREADS=4 ./nemo
441+
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.orca2.nvhpc.10steps run.stat
442+
export TIME_sec=$(grep "local proces" timing.output | head -n 1 | awk '{print $4}' | tr -d s)
443443
${HOME}/mongosh-2.1.1-linux-x64/bin/mongosh \
444444
"mongodb+srv://cluster0.x8ncpxi.mongodb.net/PerformanceMonitoring" \
445445
--quiet --apiVersion 1 --username ${{ secrets.MONGODB_USERNAME }} \
446446
--password ${{ secrets.MONGODB_PASSWORD }} \
447447
--eval 'db.GitHub_CI.insertOne({branch_name: "'"$GITHUB_REF_NAME"'", commit: "'"$GITHUB_SHA"'",
448448
github_job: "'"$GITHUB_RUN_ID"'"-"'"$GITHUB_RUN_ATTEMPT"'",
449-
ci_test: "NEMOv5 OpenMP for GPU (ORCA1)", nemo_version: "NEMOv5", system: "GlaDos",
449+
ci_test: "NEMOv5 OpenMP for GPU Async (ORCA2)", nemo_version: "NEMOv5", system: "GlaDos",
450450
compiler:"nvhpc-24.11" , date: new Date(), elapsed_time: '"${TIME_sec}"'})'
451451
452-
- name: NEMO 5.0 nvidia Async OpenMP for GPUs (UKMO ORCA2 - managed memory)
452+
- name: NEMO 5.0 nvidia Async OpenMP for GPUs (UKMO ORCA1 - managed memory)
453+
# Only do this Action if this is a re-run
454+
if: ${{ github.run_attempt != '1' }}
453455
run: |
454456
# Set up environment
455457
source /apps/spack/psyclone-spack-25.3/spack-repo/share/spack/setup-env.sh
@@ -458,7 +460,7 @@ jobs:
458460
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
459461
export PSYCLONE_HOME=${PWD}/.runner_venv
460462
export NEMO_DIR=${HOME}/${NEMODIR_NAME}
461-
export TEST_DIR=ORCA2_OMP_OFFLOAD_NVHPC
463+
export TEST_DIR=ORCA1_OMP_OFFLOAD_NVHPC
462464
463465
# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
464466
# We compile at "-O2 -Mnofma -Mnovect -gpu=math_uniform" to permit comparison of the results.
@@ -470,21 +472,23 @@ jobs:
470472
471473
# Clean up and compile
472474
rm -rf cfgs/${TEST_DIR}
473-
./makenemo -r ORCA2_ICE_PISCES -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/omp_gpu_trans.py \
474-
add_key "key_mpi_off key_nosignedzero" -j 4 -v 1
475+
./makenemo -r GOSI10p0.0_like_eORCA1 -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/omp_gpu_trans.py \
476+
-j 4 -v 1
475477
476478
# Run test
477479
cd $NEMO_DIR/cfgs/${TEST_DIR}/EXP00
478-
ln -sf ../../../ORCA2_ICE_v4.2.0/* .
479-
# Uses both, threading and offloading
480-
OMP_NUM_THREADS=4 ./nemo
481-
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.orca2.nvhpc.10steps run.stat
482-
export TIME_sec=$(grep "local proces" timing.output | head -n 1 | awk '{print $4}' | tr -d s)
480+
ln -sf /archive/NEMO_INPUTS/NEMOv5_MO_original_files/ancil/eORCA1/link/* .
481+
# Make sure mpi has been built with cuda support
482+
ompi_info --parsable --all | grep mpi_built_with_cuda_support:value
483+
# Run with round robin allocations of GPUs to MPI ranks
484+
mpirun -n 2 sh -c 'CUDA_VISIBLE_DEVICES=$OMPI_COMM_WORLD_LOCAL_RANK ./nemo'
485+
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.orca1.nvhpc.10steps run.stat
486+
export TIME_sec=$(grep "local MPI proces" timing.output | head -n 1 | awk '{print $5}' | tr -d s)
483487
${HOME}/mongosh-2.1.1-linux-x64/bin/mongosh \
484488
"mongodb+srv://cluster0.x8ncpxi.mongodb.net/PerformanceMonitoring" \
485489
--quiet --apiVersion 1 --username ${{ secrets.MONGODB_USERNAME }} \
486490
--password ${{ secrets.MONGODB_PASSWORD }} \
487491
--eval 'db.GitHub_CI.insertOne({branch_name: "'"$GITHUB_REF_NAME"'", commit: "'"$GITHUB_SHA"'",
488492
github_job: "'"$GITHUB_RUN_ID"'"-"'"$GITHUB_RUN_ATTEMPT"'",
489-
ci_test: "NEMOv5 OpenMP for GPU (ORCA2)", nemo_version: "NEMOv5", system: "GlaDos",
493+
ci_test: "NEMOv5 OpenMP for GPU Async (ORCA1)", nemo_version: "NEMOv5", system: "GlaDos",
490494
compiler:"nvhpc-24.11" , date: new Date(), elapsed_time: '"${TIME_sec}"'})'

changelog

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
59) PR #2137 towards #1312: adds metadata support for read-only ScalarArrays
1+
60) PR #2967 towards #2551. Adds a barrier minimisation step on the Async
2+
workflow to improve its performance and adds integration tests.
3+
4+
59) PR #2137 towards #1312. Adds metadata support for read-only ScalarArrays
25
in the LFRic DSL.
36

47
58) PR #3057 for 3056. Demote OpenMP lowering error to warning.

examples/nemo/scripts/omp_gpu_trans.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
# asynchronicity.
109109
"fldread.f90",
110110
"trcatf.f90",
111+
"zdfsh2.f90",
111112
]
112113

113114
if ASYNC_PARALLEL:

src/psyclone/psyir/nodes/data_sharing_attribute_mixin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ def infer_sharing_attributes(self) -> \
8383
the directive body as PRIVATE, FIRSTPRIVATE or SHARED NEEDING
8484
SYNCHRONISATION.
8585
'''
86+
# Compute the abs position caches as we'll use these a lot.
87+
# The compute_cached_abs_position will only do this if needed
88+
# so we don't need to check here.
89+
self.compute_cached_abs_positions()
8690

8791
# TODO #598: Improve the handling of scalar variables, there are
8892
# remaining issues when we have accesses of variables after the

src/psyclone/psyir/transformations/async_trans_mixin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def _find_next_dependency(self, nodes: Union[Loop, List[Node]],
6767
directive: Directive) -> Union[List[Statement],
6868
bool]:
6969
'''
70-
Finds the statement with the closest following dependency of
71-
any symbol in the supplied nodes. It can be multiple due to branching,
70+
Finds the statement with the closest following dependency of any symbol
71+
in the supplied nodes. It can be multiple locations due to branching,
7272
and be before the supplied nodes if they are contained inside a
7373
looping construct.
7474

0 commit comments

Comments
 (0)