Skip to content

Commit

Permalink
#2132 Fix issues with github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Sep 22, 2023
1 parent 1f46fb5 commit 85707e5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
# Although we're using gfortran, we link with the OpenCL lib that comes
# with CUDA.
make -C examples allclean
F90=gfortran F90FLAGS="-ffree-line-length-none -L/apps/packages/compilers/nvidia-hpcsdk/Linux_x86_64/${NVFORTRAN_VERSION}/cuda/${CUDA_VERSION}/targets/x86_64-linux/lib" make -j 4 -C examples compile
F90=gfortran F90FLAGS="-ffree-line-length-none -L/apps/packages/compilers/nvidia-hpcsdk/Linux_x86_64/${NVFORTRAN_VERSION}/cuda/${CUDA_VERSION}/targets/x86_64-linux/lib" make -C examples compile
- name: Tutorials with compilation - gfortran
run: |
module load python/${PYTHON_VERSION}
Expand All @@ -123,7 +123,7 @@ jobs:
make -C examples allclean
module load nvidia-hpcsdk/${NVFORTRAN_VERSION} netcdf_fortran
# We have to tell nvfortran where to find the OpenCL library.
F90=nvfortran F90FLAGS="-acc -Minfo=all -L/apps/packages/compilers/nvidia-hpcsdk/Linux_x86_64/${NVFORTRAN_VERSION}/cuda/${CUDA_VERSION}/targets/x86_64-linux/lib" make -j 4 -C examples compile
F90=nvfortran F90FLAGS="-acc -Minfo=all -L/apps/packages/compilers/nvidia-hpcsdk/Linux_x86_64/${NVFORTRAN_VERSION}/cuda/${CUDA_VERSION}/targets/x86_64-linux/lib" make -C examples compile
- name: Tutorials with compilation - nvfortran
run: |
module load python/${PYTHON_VERSION}
Expand All @@ -132,4 +132,4 @@ jobs:
module load nvidia-hpcsdk/${NVFORTRAN_VERSION} netcdf_fortran
# TODO #2251. Cannot build the LFRic practicals with 23.5/7 of nvfortran
# because the compilation of nan_test.f90 gives an ICE.
F90=nvfortran F90FLAGS="-acc -Minfo=all" make -j 4 -C tutorial/practicals/nemo compile
F90=nvfortran F90FLAGS="-acc -Minfo=all" make -C tutorial/practicals/nemo compile
74 changes: 40 additions & 34 deletions .github/workflows/lfric_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,43 +75,46 @@ jobs:
- name: LFRic passthrough (with DistributedMemory)
run: |
# Set up environment
# source /apps/spack/spack-repo/share/spack/setup-env.sh
# spack env activate lfric-gnu
# export FC="gfortran"
# export FPP="cpp -traditional-cpp"
# export LDMPI="mpif90"
# export FFLAGS="-I$(spack location -e lfric-gnu)/.spack-env/view/include"
# export LDFLAGS="-L$(spack location -e lfric-gnu)/.spack-env/view/lib"
# export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(spack location -e lfric-gnu)/.spack-env/view/lib:$(spack location -e lfric-gnu)/.spack-env/view/lib6
# source .runner_venv/bin/activate
# export PSYCLONE_LFRIC_DIR=${GITHUB_WORKSPACE}/examples/lfric/scripts
source /apps/spack/spack-repo/share/spack/setup-env.sh
spack env activate lfric-gnu
export FC="gfortran"
export CC="gcc"
export CXX="g++"
export FPP="cpp -traditional-cpp"
export LDMPI="mpif90"
export FFLAGS="-I$(spack location -e lfric-gnu)/.spack-env/view/include"
export LDFLAGS="-L$(spack location -e lfric-gnu)/.spack-env/view/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(spack location -e lfric-gnu)/.spack-env/view/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH::$(spack location -e lfric-gnu)/.spack-env/view/lib64"
source .runner_venv/bin/activate
export PSYCLONE_LFRIC_DIR=${GITHUB_WORKSPACE}/examples/lfric/scripts
export MINIAPP_DIR=${HOME}/LFRic_45376/miniapps/gungho_model
export PSYCLONE_CONFIG=${HOME}/lfric_psyclone_config.cfg
cd ${MINIAPP_DIR}
# Compile
# make clean
# make -j 6 build
# # Run
# cd example
# cp ${HOME}/lfric_gunho_configuration.nml configuration.nml
# mpirun -n 1 ../bin/gungho_model configuration.nml |& tee output.txt
# ${PSYCLONE_LFRIC_DIR}/compare_ouput.py ${HOME}/lfric_gunho_configuration_4its_output.txt output.txt
# cat timer.txt
# export VAR_TIME=$(grep "gungho_model" timer.txt | cut -d'|' -f5)
# export VAR_HALOS=$(grep "gungho_model" halo_calls_counter.txt | cut -d'|' -f5)
# echo $GITHUB_REF_NAME $GITHUB_SHA $VAR_TIME $VAR_HALOS >> ${HOME}/lfric_passthrough_performance_history
make clean
make -j 6 build
# Run
cd example
cp ${HOME}/lfric_gunho_configuration_4its.nml configuration.nml
mpirun -n 1 ../bin/gungho_model configuration.nml |& tee output.txt
${PSYCLONE_LFRIC_DIR}/compare_ouput.py ${HOME}/lfric_gunho_configuration_4its_output.txt output.txt
cat timer.txt
export VAR_TIME=$(grep "gungho_model" timer.txt | cut -d'|' -f5)
export VAR_HALOS=$(grep "gungho_model" halo_calls_counter.txt | cut -d'|' -f5)
echo $GITHUB_REF_NAME $GITHUB_SHA $VAR_TIME $VAR_HALOS >> ${HOME}/lfric_passthrough_performance_history
# Upload the results into a Github Gist
# newresults=$(printf "%q" "$(cat ${HOME}/lfric_passthrough_performance_history)")
# {
# printf '{"description":"New LFRic results","files":{"lfric_passthrough.txt":{"content":"'
# echo -n ${newresults:2:-1}
# printf '"}}}'
# }| curl -L -X PATCH \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer ${{ secrets.GIST_TOKEN }}" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://api.github.com/gists/a4049a0fc0a0a11651a5ce6a04d76160 \
# --data-binary @-
newresults=$(printf "%q" "$(cat ${HOME}/lfric_passthrough_performance_history)")
{
printf '{"description":"New LFRic results","files":{"lfric_passthrough.txt":{"content":"'
echo -n ${newresults:2:-1}
printf '"}}}'
}| curl -L -X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GIST_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/gists/a4049a0fc0a0a11651a5ce6a04d76160 \
--data-binary @-
# PSyclone, compile and run MetOffice LFRic with all optimisations and 6 OpenMP threads
- name: LFRic with all transformations
Expand All @@ -120,11 +123,14 @@ jobs:
source /apps/spack/spack-repo/share/spack/setup-env.sh
spack env activate lfric-gnu
export FC="gfortran"
export CC="gcc"
export CXX="g++"
export FPP="cpp -traditional-cpp"
export LDMPI="mpif90"
export FFLAGS="-I$(spack location -e lfric-gnu)/.spack-env/view/include"
export LDFLAGS="-L$(spack location -e lfric-gnu)/.spack-env/view/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(spack location -e lfric-gnu)/.spack-env/view/lib:$(spack location -e lfric-gnu)/.spack-env/view/lib6
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(spack location -e lfric-gnu)/.spack-env/view/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH::$(spack location -e lfric-gnu)/.spack-env/view/lib64"
source .runner_venv/bin/activate
export PSYCLONE_LFRIC_DIR=${GITHUB_WORKSPACE}/examples/lfric/scripts
export MINIAPP_DIR=${HOME}/LFRic_45376/miniapps/gungho_model
Expand All @@ -138,7 +144,7 @@ jobs:
make OPTIMISATION_PATH=${MINIAPP_DIR}/psyclone-test -j 6 build |& tee compiler_output.txt
# Run
cd example
cp ${HOME}/lfric_gunho_configuration.nml configuration.nml
cp ${HOME}/lfric_gunho_configuration_4its.nml configuration.nml
export OMP_NUM_THREADS=6
mpirun -n 1 ../bin/gungho_model configuration.nml |& tee output.txt
${PSYCLONE_LFRIC_DIR}/compare_ouput.py ${HOME}/lfric_gunho_configuration_4its_output.txt output.txt
Expand Down

0 comments on commit 85707e5

Please sign in to comment.