Skip to content

Commit

Permalink
Update CI to test nvidia-hpc compilers (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored Jan 11, 2024
1 parent bb5f2bc commit fa5225e
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 56 deletions.
86 changes: 35 additions & 51 deletions .github/workflows/standalone.yml → .github/workflows/meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,35 @@ on:
types: [opened, synchronize, reopened]
jobs:
build:
name: GALAHAD/${{ matrix.os }}/${{ matrix.fc_cmd }}/${{ matrix.compiler_version }}
name: GALAHAD/${{ matrix.os }}/${{ matrix.compiler }}/${{ matrix.version }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
compiler_version: [12]
version: ['12']
include:
- compiler: gnu
cc_cmd: gcc
fc_cmd: gfortran
cxx_cmd: g++
- compiler: gcc
int64: false
- os: ubuntu-latest
compiler: gnu
compiler_version: 13
cc_cmd: gcc
fc_cmd: gfortran
cxx_cmd: g++
compiler: gcc
version: '13'
int64: true
allow_failure: true
- os: windows-latest
compiler: intel
version: '2023.2'
int64: false
allow_failure: true
- os: ubuntu-latest
compiler: intel
version: '2023.2'
int64: false
allow_failure: true
- os: ubuntu-latest
compiler: intel-llvm
compiler_version: 2023.2.0
cc_cmd: icx
fc_cmd: ifort
cxx_cmd: icpx
compiler: nvidia-hpc
version: '23.11'
int64: false
allow_failure: true
# - os: ubuntu-latest
# compiler: intel-llvm
# compiler_version: 2023.2
# cc_cmd: icx
# fc_cmd: ifx
# cxx_cmd: icpx
# allow_failure: true
runs-on: ${{ matrix.os }}
steps:
- name: Check out GALAHAD
Expand Down Expand Up @@ -100,26 +94,21 @@ jobs:
echo "OMP_CANCELLATION=TRUE" >> $GITHUB_ENV
echo "OMP_PROC_BIND=TRUE" >> $GITHUB_ENV
- name: Install GNU compilers
if: matrix.compiler == 'gnu'
uses: awvwgk/setup-fortran@main
- name: Install compilers
uses: fortran-lang/setup-fortran@main
with:
compiler: gcc
version: ${{ matrix.compiler_version }}
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}

- name: Install classic Intel compilers
- name: Update Intel compilers
if: matrix.compiler == 'intel'
uses: awvwgk/setup-fortran@main
with:
compiler: intel-classic
version: ${{ matrix.compiler_version }}
shell: bash
run: echo "FC=ifort" >> $GITHUB_ENV

- name: Install nextgen Intel compilers
if: matrix.compiler == 'intel-llvm'
uses: awvwgk/setup-fortran@main
with:
compiler: intel
version: ${{ matrix.compiler_version }}
# Uncomment this section to obtain ssh access to VM
# - name: Setup tmate session
# if: matrix.os == 'windows-latest'
# uses: mxschmitt/action-tmate@v3

- name: Setup GALAHAD
shell: bash
Expand All @@ -130,15 +119,15 @@ jobs:
-Dgalahad_int64=true -Dlibblas_path=$DEPS/deps/$LIBDIR \
-Dliblapack_path=$DEPS/deps/$LIBDIR -Dlibblas=openblas64_ \
-Dliblapack=openblas64_
elif [[ "${{matrix.compiler}}" == "nvidia-hpc" ]]; then
meson setup builddir --buildtype=debug -Dexamples=true -Dtests=true \
--prefix=$GITHUB_WORKSPACE/galahad -Dpythoniface=true \
-Dc_std=none -Dcpp_std=none -Dgalahad_int64=false
else
meson setup builddir --buildtype=debug -Dexamples=true -Dtests=true \
--prefix=$GITHUB_WORKSPACE/galahad -Dpythoniface=true \
-Dgalahad_int64=false
fi
env:
CC: ${{ matrix.cc_cmd }}
FC: ${{ matrix.fc_cmd }}
CXX: ${{ matrix.cxx_cmd }}
- name: Build GALAHAD
shell: bash
Expand All @@ -147,7 +136,7 @@ jobs:
- uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.fc_cmd }}_${{ matrix.compiler_version }}_meson-log.txt
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.version }}_meson-log.txt
path: builddir/meson-logs/meson-log.txt

- name: Install GALAHAD
Expand All @@ -157,20 +146,15 @@ jobs:
- uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.fc_cmd }}_${{ matrix.compiler_version }}_install-log.txt
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.version }}_install-log.txt
path: builddir/meson-logs/install-log.txt

# Uncomment this section to obtain ssh access to VM
# - name: Setup tmate session
# if: matrix.os == 'windows-latest'
# uses: mxschmitt/action-tmate@v3

- name: Test GALAHAD
shell: bash
run: |
meson test -C builddir
- uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.fc_cmd }}_${{ matrix.compiler_version }}_testlog.txt
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.version }}_testlog.txt
path: builddir/meson-logs/testlog.txt
1 change: 1 addition & 0 deletions README.meson
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Non-default compilers can be selected by setting the `CC`, `CXX` and
```
CC=icx CXX=icpx FC=ifort meson setup builddir [options...]
CC=icx CXX=icpx FC=ifx meson setup builddir [options...]
CC=nvc CXX=nvc++ FC=nvfortran meson setup builddir -Dc_std=none -Dcpp_std=none [options...]
```
See https://mesonbuild.com/Reference-tables.html for supported compilers
and linkers.
Expand Down
25 changes: 20 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,23 @@ if fc.get_id() == 'nagfor'
endif

# Preprocessing
if fc.get_id() == 'intel-cl' or fc.get_id() == 'intel-llvm-cl'
output_generator = '/Fi:@OUTPUT@'
else
output_generator = ['-o', '@OUTPUT@']
endif

pp_options = []
if fc.get_id() == 'gcc'
pp_options += ['-cpp', '-E']
elif fc.get_id() == 'intel' or fc.get_id() == 'intel-llvm' or fc.get_id() == 'intel-cl' or fc.get_id() == 'intel-llvm-cl'
elif fc.get_id() == 'intel' or fc.get_id() == 'intel-llvm'
pp_options += ['-fpp', '-P']
elif fc.get_id() == 'intel-cl' or fc.get_id() == 'intel-llvm-cl'
pp_options += ['/fpp', '/P']
elif fc.get_id() == 'nagfor'
pp_options += ['-fpp', '-F']
elif fc.get_id() == 'nvidia_hpc'
pp_options += ['-Mcpp', '-F']
endif

# Options
Expand Down Expand Up @@ -109,7 +119,10 @@ libampl = fc.find_library(libampl_name, dirs : libampl_path, required : false)
lm = cc.find_library('m', required : false)

# OpenMP
if fc.get_id() == 'nagfor'
if fc.get_id() == 'nvidia_hpc'
add_global_arguments('-mp', language : 'fortran')
add_global_link_arguments('-mp', language : 'fortran')
elif fc.get_id() == 'nagfor'
add_global_arguments('-openmp', language : 'fortran')
add_global_link_arguments('-openmp', language : 'fortran')
elif fc.get_id() == 'gcc'
Expand All @@ -122,7 +135,9 @@ elif fc.get_id() == 'intel-cl' or fc.get_id() == 'intel-llvm-cl'
add_global_arguments('/Qopenmp', language : 'fortran')
endif

if cxx.get_id() == 'gcc' or cxx.get_id() == 'clang'
if cxx.get_id() == 'nvidia_hpc'
add_global_arguments('-mp', language : 'cpp')
elif cxx.get_id() == 'gcc' or cxx.get_id() == 'clang'
add_global_arguments('-fopenmp', language : 'cpp')
elif cxx.get_id() == 'intel' or cxx.get_id() == 'intel-cl'
add_global_arguments('-qopenmp', language : 'cpp')
Expand Down Expand Up @@ -328,7 +343,7 @@ if build_single
arguments : pp_options + extra_args_single +
['-I', '@CURRENT_SOURCE_DIR@/include',
'-I', '@CURRENT_SOURCE_DIR@/src/dum/include',
'@INPUT@', '-o', '@OUTPUT@'])
'@INPUT@'] + output_generator)

to_process_single = [libgalahad_src, libgalahad_c_src, libgalahad_ampl_src, libgalahad_mumps_single_src]
if libcutest_single.found()
Expand Down Expand Up @@ -359,7 +374,7 @@ if build_double
arguments : pp_options + extra_args_double +
['-I', '@CURRENT_SOURCE_DIR@/include',
'-I', '@CURRENT_SOURCE_DIR@/src/dum/include',
'@INPUT@', '-o', '@OUTPUT@'])
'@INPUT@'] + output_generator)

to_process_double = [libgalahad_src, libgalahad_c_src, libgalahad_ampl_src, libgalahad_mumps_double_src]
if libcutest_double.found()
Expand Down

0 comments on commit fa5225e

Please sign in to comment.