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

(towards #2671) Parallel array privatisation #2697

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
52888e8
#2671 First implementation of array privatisation
sergisiso Aug 19, 2024
555314b
#2671 Improve the parallel array privatisation implementation
sergisiso Aug 23, 2024
700baa9
#2671 Allow threadprivate arrays to be firstprivate when necessary
sergisiso Aug 24, 2024
d82c4e7
#2671 Improve array privatisation error messages
sergisiso Sep 5, 2024
e1a4aee
#2671 Bring to master
sergisiso Sep 5, 2024
ab36e63
#2671 Fix NEMOv5 integration test for parallel cases
sergisiso Sep 9, 2024
180bb79
#2671 Refactor array_privatisation implementation to keep explicit pr…
sergisiso Sep 12, 2024
bb4790a
Merge remote-tracking branch 'origin/master' into 2671_array_privatis…
sergisiso Sep 24, 2024
39b8fc9
#2671 Capture NEMOv5 times and improve integrationt tests
sergisiso Sep 24, 2024
18a5287
#2671 Improve tests and coverage
sergisiso Sep 24, 2024
d79f660
#2671 Fixes to NEMOv5 GPU test
sergisiso Sep 26, 2024
2240ecd
#2671 Add tests for loop explicit local symbols
sergisiso Sep 25, 2024
803c9a6
#2671 Add tests for infer_attributes with explicit local symbols
sergisiso Sep 27, 2024
807f64c
#2671 Add mppini.f90 to the list of excluded NEMO files
sergisiso Sep 27, 2024
565ff8e
Merge remote-tracking branch 'origin/master' into 2671_array_privatis…
sergisiso Oct 1, 2024
4ff41c7
#2671 Revert some changes that impacted integration tests
sergisiso Oct 1, 2024
957fc35
#2671 Remove NEMOv5 excluded file
sergisiso Oct 1, 2024
0d03431
#2671 Fix wrong variable name in github workflow
sergisiso Oct 1, 2024
eb8ba5c
Merge branch '2027_effective_shape_bug' into 2671_array_privatisation
sergisiso Oct 8, 2024
5cbe301
#2671 and xfails for #2727
sergisiso Oct 8, 2024
08a6675
#2671 Merge master
sergisiso Oct 8, 2024
aacd0bf
#2671 Fix the issue to include more nemo files and filter files that …
sergisiso Oct 18, 2024
e10ec85
Merge remote-tracking branch 'origin/master' into 2671_array_privatis…
sergisiso Oct 18, 2024
b6b6ec7
#2671 Rename nemo gfortran results file
sergisiso Oct 18, 2024
f8b399a
#2671 Exclude more files with issues for NEMO nvhpc
sergisiso Oct 18, 2024
95f283c
#2671 Use teamsdistributeparalleldo and private arrays for NEMO gpu o…
sergisiso Oct 22, 2024
d504fae
#2671 Change flags from NEMOv5 integration tests to match KGOs
sergisiso Oct 22, 2024
b07d9d2
#2671 NEMOv4 fixes
sergisiso Oct 24, 2024
3629df4
#2671 Bring to master
sergisiso Nov 1, 2024
a87cd74
Merge remote-tracking branch 'origin/master' into 2671_array_privatis…
sergisiso Nov 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 48 additions & 30 deletions .github/workflows/nemo_v5_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,25 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_PASSTHROUGH_GCC

# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-fdefault-real-8 -O2 -fcray-pointer -ffree-line-length-none -g"

# Clean up and compile
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_GCC clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_GCC -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
add_key "key_nosignedzero" -j 4 -v 1

# Run test
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH_GCC/EXP00
cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
mpirun -np 4 ./nemo
tail run.stat
# This was produced with gfortran, so we can do an exact diff
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.100steps run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.gfortran.small.100steps run.stat

- name: NEMO 5.0 nvidia passthrough
run: |
Expand All @@ -110,24 +109,25 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_PASSTHROUGH_NVHPC

# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-i4 -Mr8 -O2 -Minline -Mcray=pointer -Mpre -g"
export FCFLAGS="-i4 -Mr8 -O2 -g"

# Clean up and compile
# Without key_mpi_off it fails to compile (even without psyclone)
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_NVHPC clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_NVHPC -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
add_key "key_mpi_off key_nosignedzero" -j 4 -v 1

# Run test
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH_NVHPC/EXP00
cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
./nemo
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.100steps run.stat
tail run.stat
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.nvhpc.small.100steps run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME

Expand All @@ -140,25 +140,25 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_PASSTHROUGH_ONEAPI

# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-i4 -r8 -O2 -fp-model precise -fno-alias -g"

# Clean up and compile
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_ONEAPI clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_ONEAPI -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
add_key "key_nosignedzero" -j 4 -v 1

# Run test
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH_ONEAPI/EXP00
cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
mpirun -np 6 ./nemo
tail run.stat
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.100steps run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME
# We don't compare all digits because they are results from a different compiler
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.gfrotran.bench.small.100steps run.stat

- name: NEMO 5.0 gfortran OpenMP for CPUs
run: |
Expand All @@ -169,25 +169,34 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_OMP_THREADING_GCC

# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-fdefault-real-8 -O2 -fcray-pointer -ffree-line-length-none -g -fopenmp"

# Clean up and compile
./makenemo -r BENCH -m linux_spack -n BENCH_OMP_THREADING_GCC clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_OMP_THREADING_GCC -p ${PSYCLONE_NEMO_DIR}/omp_cpu_trans.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/omp_cpu_trans.py \
add_key "key_nosignedzero" -j 4 -v 1

# Run test
cd $NEMO_DIR/tests/BENCH_OMP_THREADING_GCC/EXP00
cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
OMP_NUM_THREADS=4 mpirun -np 1 ./nemo
tail run.stat
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.100steps run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.gfortran.small.100steps run.stat
export TIME_microsec=$(grep "Mean:" timing.output | head -n 1 | awk '{print $2}')
export TIME_sec=$(bc <<< "${TIME_microsec} / 10000")
${HOME}/mongosh-2.1.1-linux-x64/bin/mongosh \
"mongodb+srv://cluster0.x8ncpxi.mongodb.net/PerformanceMonitoring" \
--quiet --apiVersion 1 --username ${{ secrets.MONGODB_USERNAME }} \
--password ${{ secrets.MONGODB_PASSWORD }} \
--eval 'db.GitHub_CI.insertOne({branch_name: "'"$GITHUB_REF_NAME"'", commit: "'"$GITHUB_SHA"'",
github_job: "'"$GITHUB_RUN_ID"'"-"'"$GITHUB_RUN_ATTEMPT"'",
ci_test: "NEMOv5 OpenMP for CPU", nemo_version: "NEMOv5", system: "GlaDos",
compiler:"gfortran-14" , date: new Date(), elapsed_time: '"${TIME_sec}"'})'

- name: NEMO 5.0 nvidia OpenMP for GPUs (managed memory)
run: |
Expand All @@ -198,24 +207,33 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_OMP_OFFLOAD_NVHPC

# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
# We compile at -O1 to permit comparison of the results.
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-i4 -Mr8 -O3 -Minline -Mcray=pointer -Mpre -g -mp=gpu -gpu=managed"
export FCFLAGS="-i4 -Mr8 -O2 -g -mp=gpu -gpu=managed"

# Clean up and compile
# Without key_mpi_off it fails to compile (even without psyclone)
./makenemo -r BENCH -m linux_spack -n BENCH_OMP_OFFLOAD_NVHPC clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_OMP_OFFLOAD_NVHPC -p ${PSYCLONE_NEMO_DIR}/omp_gpu_trans.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/omp_gpu_trans.py \
add_key "key_mpi_off key_nosignedzero" -j 4 -v 1

# Run test
cd $NEMO_DIR/tests/BENCH_OMP_OFFLOAD_NVHPC/EXP00
cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
./nemo
tail run.stat
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.100steps run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.nvhpc.small.100steps run.stat
export TIME_microsec=$(grep "Mean:" timing.output | head -n 1 | awk '{print $2}')
export TIME_sec=$(bc <<< "${TIME_microsec} / 10000")
${HOME}/mongosh-2.1.1-linux-x64/bin/mongosh \
"mongodb+srv://cluster0.x8ncpxi.mongodb.net/PerformanceMonitoring" \
--quiet --apiVersion 1 --username ${{ secrets.MONGODB_USERNAME }} \
--password ${{ secrets.MONGODB_PASSWORD }} \
--eval 'db.GitHub_CI.insertOne({branch_name: "'"$GITHUB_REF_NAME"'", commit: "'"$GITHUB_SHA"'",
github_job: "'"$GITHUB_RUN_ID"'"-"'"$GITHUB_RUN_ATTEMPT"'",
ci_test: "NEMOv5 OpenMP for GPU", nemo_version: "NEMOv5", system: "GlaDos",
compiler:"nvhpc-24.5" , date: new Date(), elapsed_time: '"${TIME_sec}"'})'
Loading
Loading