From 30d35fe4ee41c2968736b44b5821d60cd4428297 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Mon, 19 Jan 2026 14:20:53 +0000 Subject: [PATCH 1/4] #3207 Lfric passthrough test uses lfric_atm --- .github/workflows/lfric_test.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lfric_test.yml b/.github/workflows/lfric_test.yml index 1efd3458a0..c3692e3b28 100644 --- a/.github/workflows/lfric_test.yml +++ b/.github/workflows/lfric_test.yml @@ -94,7 +94,7 @@ jobs: cd lfric_apps git checkout ${LFRIC_APPS_HASH} - # PSyclone, compile and run MetOffice LFRic with 6 MPI ranks. + # PSyclone, compile and run MetOffice LFRic Atm with 12 MPI ranks. - name: LFRic passthrough (with DistributedMemory) id: lfric_dist_mem run: | @@ -114,19 +114,22 @@ jobs: export OPT_DIR=${LFRIC_DIR}/applications/gungho_model/optimisation/psyclone-test/psykal mkdir -p ${OPT_DIR} cp ${PSYCLONE_LFRIC_DIR}/does_nothing.py ${OPT_DIR}/global.py + export OPT_DIR=${LFRIC_DIR}/applications/gungho_model/optimisation/psyclone-test/transmute + mkdir -p ${OPT_DIR} + cp ${PSYCLONE_LFRIC_DIR}/does_nothing.py ${OPT_DIR}/global.py # Clean previous version and compile again - rm -rf working-gh-passthrough - ./build/local_build.py -j ${NUM_PARALLEL} -v -p psyclone-test -w working-gh-passthrough gungho_model + rm -rf working-atm-passthrough + ./build/local_build.py -j ${NUM_PARALLEL} -v -p psyclone-test -w working-gh-passthrough gungho_atm # Run - cd applications/gungho_model/example - rm -f timer.txt gungho_model-checksums.txt # In case there were from a previous run + cd applications/lfric_atm/example + rm -f timer.txt lfric_atm-checksums.txt # In case there were from a previous run # Number of OMP threads have to be set even when psyclone does not inject OpenMP # because some psykal-lite routines have it. export OMP_NUM_THREADS=1 mpirun -n 12 ../bin/gungho_model configuration.nml - python ${PSYCLONE_LFRIC_DIR}/compare_ouput.py ${PSYCLONE_LFRIC_DIR}/KGOs/gungho_model-checksums.txt gungho_model-checksums.txt + python ${PSYCLONE_LFRIC_DIR}/compare_ouput.py ${PSYCLONE_LFRIC_DIR}/KGOs/lfric_atm-checksums.txt lfric_atm-checksums.txt cat timer.txt - export VAR_TIME=$(grep "gungho_model" timer.txt | cut -d'|' -f5) + export VAR_TIME=$(grep "lfric_atm" timer.txt | cut -d'|' -f5) echo "time=${VAR_TIME}" >> "${GITHUB_OUTPUT}" # PSyclone, compile and run MetOffice gungho_model on GPU @@ -269,10 +272,10 @@ jobs: ./build/local_build.py -v -p meto-ex1a -j 16 -w working-atm-transmuted lfric_atm export BUILD_ELAPSED=$((${SECONDS}-${BUILD_START})) - # Run the app with 8 threads and no MPI + # Run the app with 12 threads and no MPI # (with MPI it currently fails to initialise the mesh - even with no psyclone) cd applications/lfric_atm/example/ - OMP_NUM_THREADS=8 mpirun -n 1 ../bin/lfric_atm configuration.nml + OMP_NUM_THREADS=12 mpirun -n 1 ../bin/lfric_atm configuration.nml # And compare the results python ${PSYCLONE_LFRIC_DIR}/compare_ouput.py ${PSYCLONE_LFRIC_DIR}/KGOs/lfric_atm-checksums.txt lfric_atm-checksums.txt From fc9971110dd09bd7baefeb88a2bf7ee3149e9f8f Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Mon, 19 Jan 2026 14:33:18 +0000 Subject: [PATCH 2/4] #3207 Continue porting lfric test workflows to git --- .github/workflows/extraction_test.yml | 23 +++++------------------ .github/workflows/lfric_test.yml | 4 +--- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/extraction_test.yml b/.github/workflows/extraction_test.yml index ffbb25a38d..3d72f12ad9 100644 --- a/.github/workflows/extraction_test.yml +++ b/.github/workflows/extraction_test.yml @@ -48,8 +48,7 @@ jobs: if: ${{ github.repository == 'stfc/PSyclone-mirror' }} runs-on: self-hosted env: - LFRIC_APPS_REV: 7536 - LFRIC_CORE_REV: 52054 + LFRIC_APPS_HASH: 152804e4ba768cf54801f034a20131812ecff0f2 PYTHON_VERSION: 3.13 steps: @@ -100,20 +99,10 @@ jobs: cp lib/extract/netcdf/lfric/*90 lfric-baf/infrastructure/build/psyclone/psydata/extract # Fetch the specified version of LFRic apps - source /archive/psyclone-spack/psyclone-spack-Jun25/spack-repo/share/spack/setup-env.sh - spack load fcm/xyl5qxp cd /archive/psyclone-tests/latest-run rm -rf lfric_extraction mkdir lfric_extraction - cd lfric_extraction - fcm co --username ${{ secrets.UKMO_USER }} --password '${{ secrets.UKMO_PASSW }}' \ - -r ${LFRIC_APPS_REV} https://code.metoffice.gov.uk/svn/lfric_apps/main/trunk/ lfric_apps - fcm co --username ${{ secrets.UKMO_USER }} --password '${{ secrets.UKMO_PASSW }}' \ - -r ${LFRIC_CORE_REV} https://code.metoffice.gov.uk/svn/lfric/LFRic/trunk/ lfric_core - sed -i "s|lfric_core_rev=$LFRIC_CORE_REV|lfric_core_rev=|g" lfric_apps/dependencies.sh - sed -i "s|lfric_core_sources=|lfric_core_sources=$PWD/lfric_core|g" lfric_apps/dependencies.sh - sed -i "s|use_xios_io=.true.|use_xios_io=.false.|g" lfric_apps/applications/gungho_model/example/configuration.nml - + git clone --depth 1 --revision ${LFRIC_APPS_HASH} https://github.com/stfc/lfric_apps # Compile GungHo with extraction - name: GungHo Extraction Compilation @@ -131,20 +120,18 @@ jobs: # Set the directory names for the extraction runs: # ----------------------------------------------- export RUNDIR=/archive/psyclone-tests/latest-run/extraction_test - export LFRIC_CORE=${RUNDIR}/lfric_core export LFRIC_APPS=${RUNDIR}/lfric_apps # Copy the lfric source files (BAF copies files into the source tree) # ------------------------------------------------------------------- rm -rf ${RUNDIR} - mkdir -p ${LFRIC_CORE} ${LFRIC_APPS} - cp -r /archive/psyclone-tests/latest-run/lfric_extraction/lfric_core/ ${RUNDIR} + mkdir -p ${LFRIC_APPS} cp -r /archive/psyclone-tests/latest-run/lfric_extraction/lfric_apps/ ${RUNDIR} # Install the BAF scripts into the lfric directories: # --------------------------------------------------- cd lfric-baf - ./install.sh ${LFRIC_CORE} ${LFRIC_APPS} + ./install.sh ${LFRIC_APPS} # Copy the modified extraction script from PSyclone # ------------------------------------------------- @@ -160,7 +147,7 @@ jobs: mkdir -p $PWD/fab_workspace export FAB_WORKSPACE=$PWD/fab_workspace # Run the Fab build script - ${LFRIC_CORE}/build.sh ./fab_gungho_model_extract.py \ + ${LFRIC_APPS}/build.sh ./fab_gungho_model_extract.py \ --profile ${COMPILER_PROFILE} --nproc 4 -fc $LDMPI -ld $LDMPI -cc $CC # Run gungho (which will create the NetCDF kernel data files) diff --git a/.github/workflows/lfric_test.yml b/.github/workflows/lfric_test.yml index c3692e3b28..e855f76102 100644 --- a/.github/workflows/lfric_test.yml +++ b/.github/workflows/lfric_test.yml @@ -90,9 +90,7 @@ jobs: # Fetch the specified version of LFRic apps cd /archive/psyclone-tests/latest-run rm -rf lfric_apps - git clone https://github.com/stfc/lfric_apps - cd lfric_apps - git checkout ${LFRIC_APPS_HASH} + git clone --depth 1 --revision ${LFRIC_APPS_HASH} https://github.com/stfc/lfric_apps # PSyclone, compile and run MetOffice LFRic Atm with 12 MPI ranks. - name: LFRic passthrough (with DistributedMemory) From 29372f08630f3781527eb4e3bfe7d38cbcbdc982 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Mon, 19 Jan 2026 15:50:09 +0000 Subject: [PATCH 3/4] #3207 Revert clonning single commit in lfric workflows --- .github/workflows/extraction_test.yml | 4 +++- .github/workflows/lfric_test.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/extraction_test.yml b/.github/workflows/extraction_test.yml index 3d72f12ad9..5f9e371cb0 100644 --- a/.github/workflows/extraction_test.yml +++ b/.github/workflows/extraction_test.yml @@ -102,7 +102,9 @@ jobs: cd /archive/psyclone-tests/latest-run rm -rf lfric_extraction mkdir lfric_extraction - git clone --depth 1 --revision ${LFRIC_APPS_HASH} https://github.com/stfc/lfric_apps + git clone https://github.com/stfc/lfric_apps + cd lfric_apps + git checkout ${LFRIC_APPS_HASH} # Compile GungHo with extraction - name: GungHo Extraction Compilation diff --git a/.github/workflows/lfric_test.yml b/.github/workflows/lfric_test.yml index e855f76102..c3692e3b28 100644 --- a/.github/workflows/lfric_test.yml +++ b/.github/workflows/lfric_test.yml @@ -90,7 +90,9 @@ jobs: # Fetch the specified version of LFRic apps cd /archive/psyclone-tests/latest-run rm -rf lfric_apps - git clone --depth 1 --revision ${LFRIC_APPS_HASH} https://github.com/stfc/lfric_apps + git clone https://github.com/stfc/lfric_apps + cd lfric_apps + git checkout ${LFRIC_APPS_HASH} # PSyclone, compile and run MetOffice LFRic Atm with 12 MPI ranks. - name: LFRic passthrough (with DistributedMemory) From d965af0d2c2d14bfacae872796cefb328e185c15 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Tue, 20 Jan 2026 08:57:36 +0000 Subject: [PATCH 4/4] #3207 Update lfric test workflows --- .github/workflows/extraction_test.yml | 14 +++++++++++--- .github/workflows/lfric_test.yml | 7 +++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/extraction_test.yml b/.github/workflows/extraction_test.yml index 5f9e371cb0..726c879fcd 100644 --- a/.github/workflows/extraction_test.yml +++ b/.github/workflows/extraction_test.yml @@ -49,6 +49,7 @@ jobs: runs-on: self-hosted env: LFRIC_APPS_HASH: 152804e4ba768cf54801f034a20131812ecff0f2 + LFRIC_CORE_HASH: 022b139434b06c2431cf857f35f6bfa1ab8edeed PYTHON_VERSION: 3.13 steps: @@ -102,9 +103,14 @@ jobs: cd /archive/psyclone-tests/latest-run rm -rf lfric_extraction mkdir lfric_extraction + cd lfric_extraction git clone https://github.com/stfc/lfric_apps cd lfric_apps git checkout ${LFRIC_APPS_HASH} + cd .. + git clone https://github.com/stfc/lfric_core + cd lfric_core + git checkout ${LFRIC_CORE_HASH} # Compile GungHo with extraction - name: GungHo Extraction Compilation @@ -122,18 +128,20 @@ jobs: # Set the directory names for the extraction runs: # ----------------------------------------------- export RUNDIR=/archive/psyclone-tests/latest-run/extraction_test + export LFRIC_CORE=${RUNDIR}/lfric_core export LFRIC_APPS=${RUNDIR}/lfric_apps # Copy the lfric source files (BAF copies files into the source tree) # ------------------------------------------------------------------- rm -rf ${RUNDIR} - mkdir -p ${LFRIC_APPS} + mkdir -p ${RUNDIR} + cp -r /archive/psyclone-tests/latest-run/lfric_extraction/lfric_core/ ${RUNDIR} cp -r /archive/psyclone-tests/latest-run/lfric_extraction/lfric_apps/ ${RUNDIR} # Install the BAF scripts into the lfric directories: # --------------------------------------------------- cd lfric-baf - ./install.sh ${LFRIC_APPS} + ./install.sh ${LFRIC_CORE} ${LFRIC_APPS} # Copy the modified extraction script from PSyclone # ------------------------------------------------- @@ -149,7 +157,7 @@ jobs: mkdir -p $PWD/fab_workspace export FAB_WORKSPACE=$PWD/fab_workspace # Run the Fab build script - ${LFRIC_APPS}/build.sh ./fab_gungho_model_extract.py \ + ${LFRIC_CORE}/build.sh ./fab_gungho_model_extract.py \ --profile ${COMPILER_PROFILE} --nproc 4 -fc $LDMPI -ld $LDMPI -cc $CC # Run gungho (which will create the NetCDF kernel data files) diff --git a/.github/workflows/lfric_test.yml b/.github/workflows/lfric_test.yml index c3692e3b28..75356c3cec 100644 --- a/.github/workflows/lfric_test.yml +++ b/.github/workflows/lfric_test.yml @@ -119,7 +119,7 @@ jobs: cp ${PSYCLONE_LFRIC_DIR}/does_nothing.py ${OPT_DIR}/global.py # Clean previous version and compile again rm -rf working-atm-passthrough - ./build/local_build.py -j ${NUM_PARALLEL} -v -p psyclone-test -w working-gh-passthrough gungho_atm + ./build/local_build.py -j ${NUM_PARALLEL} -v -p psyclone-test -w working-atm-passthrough lfric_atm # Run cd applications/lfric_atm/example rm -f timer.txt lfric_atm-checksums.txt # In case there were from a previous run @@ -272,10 +272,9 @@ jobs: ./build/local_build.py -v -p meto-ex1a -j 16 -w working-atm-transmuted lfric_atm export BUILD_ELAPSED=$((${SECONDS}-${BUILD_START})) - # Run the app with 12 threads and no MPI - # (with MPI it currently fails to initialise the mesh - even with no psyclone) + # Run the app with 2 threads and 6 MPI ranks cd applications/lfric_atm/example/ - OMP_NUM_THREADS=12 mpirun -n 1 ../bin/lfric_atm configuration.nml + OMP_NUM_THREADS=2 mpirun -n 6 ../bin/lfric_atm configuration.nml # And compare the results python ${PSYCLONE_LFRIC_DIR}/compare_ouput.py ${PSYCLONE_LFRIC_DIR}/KGOs/lfric_atm-checksums.txt lfric_atm-checksums.txt