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

Revive CI tests for release mode #2

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 18 additions & 14 deletions .github/workflows/linux_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

# Install OpenMPI
- name: Install OpenMPI
run: sudo apt-get install openmpi-bin libopenmpi-dev -y

# Test debug mode
- name: Build gf debug
run: |
cd ref
rm -rf build
mkdir build
cd build
export OMP_NUM_THREADS=4
export CC=gcc
export FC=gfortran
cmake -DCMAKE_BUILD_TYPE=debug ..
make
ctest --output-on-failure
#- name: Build gf debug
# run: |
# cd ref
# rm -rf build
# mkdir build
# cd build
# export OMP_NUM_THREADS=4
# export CC=gcc
# export FC=gfortran
# cmake -DCMAKE_BUILD_TYPE=debug ..
# make
# ctest --output-on-failure

# Test release mode
- name: Build gf release
Expand All @@ -42,9 +46,9 @@ jobs:
rm -rf build
mkdir build
cd build
export OMP_NUM_THREADS=4
#export OMP_NUM_THREADS=4
export CC=gcc
export FC=gfortran
cmake -DCMAKE_BUILD_TYPE=release ..
cmake -DCMAKE_BUILD_TYPE=release -DENABLE_GPU=off ..
make
ctest --output-on-failure
58 changes: 32 additions & 26 deletions .github/workflows/linux_intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest

env:
LINUX_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/17764/l_HPCKit_p_2021.2.0.2997_offline.sh
CC: icc
FC: ifort
CXX: icpc
LINUX_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d4e49548-1492-45c9-b678-8268cb0f1b05/l_HPCKit_p_2024.2.0.635_offline.sh
CC: icx
FC: ifx
CXX: icx

steps:
# Cache Intel HPC Toolkit
Expand Down Expand Up @@ -47,28 +47,28 @@ jobs:
- name: Check compiler install
run: |
source /opt/intel/oneapi/setvars.sh
which icc
which ifort
which icx
which ifx

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2

# Test debug mode
- name: Build gf debug
run: |
source /opt/intel/oneapi/setvars.sh
cd ref
rm -rf build
mkdir build
cd build
export OMP_NUM_THREADS=4
export CC=icc
export FC=ifort
cmake -DCMAKE_BUILD_TYPE=debug ..
make
ulimit -s unlimited
ctest --output-on-failure
#- name: Build gf debug
# run: |
# source /opt/intel/oneapi/setvars.sh
# cd ref
# rm -rf build
# mkdir build
# cd build
# export OMP_NUM_THREADS=4
# export CC=icx
# export FC=ifx
# cmake -DCMAKE_BUILD_TYPE=debug ..
# make
# ulimit -s unlimited
# ctest --output-on-failure

# Test release mode
- name: Build gf release
Expand All @@ -78,10 +78,16 @@ jobs:
rm -rf build
mkdir build
cd build
export OMP_NUM_THREADS=4
export CC=icc
export FC=ifort
cmake -DCMAKE_BUILD_TYPE=release ..
make
ulimit -s unlimited
#export OMP_NUM_THREADS=4
export CC=icx
export FC=ifx
cmake -DCMAKE_BUILD_TYPE=release -DENABLE_GPU=off ..
make VERBOSE=1
ctest --output-on-failure
-
name: Debug session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
with:
limit-access-to-actor: true
2 changes: 1 addition & 1 deletion ref/cmake/compiler_flags_GNU_Fortran.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
####################################################################
# COMMON FLAGS
####################################################################
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbacktrace -ffp-contract=off ")
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbacktrace -ffp-contract=off -fno-sign-zero ")

####################################################################
# RELEASE FLAGS
Expand Down
4 changes: 2 additions & 2 deletions ref/cmake/gf_compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add_definitions( -DSINGLE_PREC )
# Set flags depending on which compiler is used
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
include("compiler_flags_GNU_Fortran")
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
elseif (CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
include("compiler_flags_Intel_Fortran")
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI")
include("compiler_flags_PGI_Fortran")
Expand All @@ -15,7 +15,7 @@ endif()
# Set flags depending on which compiler iis used
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
include("compiler_flags_GNU_C")
elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel")
elseif (CMAKE_C_COMPILER_ID MATCHES "^Intel")
include("compiler_flags_Intel_C")
elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI")
include("compiler_flags_PGI_C")
Expand Down
3 changes: 2 additions & 1 deletion ref/src/cu_gf_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,8 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
gdc(i,k,1)= max(0.,tun_rad_shall(i)*cupclws(i,k)*cutens(i)) ! my mod
!gdc2(i,k,1)=max(0.,tun_rad_deep(i)*(cupclwm(i,k)*cutenm(i)+cupclw(i,k)*cuten(i)))
!gdc2(i,k,1)=max(0.,tun_rad_mid(i)*cupclwm(i,k)*cutenm(i)+tun_rad_deep(i)*cupclw(i,k)*cuten(i)+tun_rad_shall(i)*cupclws(i,k)*cutens(i))
gdc2(i,k,1) = min(0.1, max(0.01, tun_rad_mid(i)*frhm(i)))*cupclwm(i,k)*cutenm(i) + min(0.1, max(0.01, tun_rad_deep(i)*(frhd(i))))*cupclw(i,k)*cuten(i) + tun_rad_shall(i)*cupclws(i,k)*cutens(i)
gdc2(i,k,1) = min(0.1, max(0.01, tun_rad_mid(i)*frhm(i)))*cupclwm(i,k)*cutenm(i) + &
min(0.1, max(0.01, tun_rad_deep(i)*(frhd(i))))*cupclw(i,k)*cuten(i) + tun_rad_shall(i)*cupclws(i,k)*cutens(i)
qci_conv(i,k)=gdc2(i,k,1)
gdc(i,k,2)=(outt(i,k))*86400.
gdc(i,k,3)=(outtm(i,k))*86400.
Expand Down
4 changes: 4 additions & 0 deletions ref/src/gf_test.F90
Original file line number Diff line number Diff line change
Expand Up @@ -618,4 +618,8 @@ program test_gf
!$acc exit data delete( cap_suppress(s:e,:) )
#endif

#ifdef MPI
CALL MPI_FINALIZE(ierror)
#endif

end program test_gf
4 changes: 2 additions & 2 deletions ref/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(COMPARE_SH ${CMAKE_BINARY_DIR}/bin/gf_compare.sh)

# CPU kernel
add_test(NAME cpu_kernel
COMMAND bash -c "../src/gf_kernel_cpu > test_output/gf_kernel_cpu.log")
COMMAND bash -c "${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${MPIEXEC_PREFLAGS} ../src/gf_kernel_cpu > test_output/gf_kernel_cpu.log")
add_test(NAME compare_cpu_kernel
COMMAND ${COMPARE_SH} test_output/gf_kernel_cpu.log test_output/output.test)

Expand All @@ -27,7 +27,7 @@ if ( ENABLE_GPU )

# GPU kernel version 1
add_test(NAME gpu_kernel
COMMAND bash -c "../src/gf_kernel_gpu > test_output/gf_kernel_gpu.log")
COMMAND bash -c "${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${MPIEXEC_PREFLAGS} ../src/gf_kernel_gpu > test_output/gf_kernel_gpu.log")
add_test(NAME compare_gpu_kernel
COMMAND ${COMPARE_SH} test_output/gf_kernel_gpu.log test_output/output.test)

Expand Down
Loading
Loading