-
Notifications
You must be signed in to change notification settings - Fork 548
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f928aa
commit bb51011
Showing
1 changed file
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Intel Linux Build | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
# Cancel in-progress workflows when pushing to a branch | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran | ||
env: | ||
cache_key: intel10 | ||
CC: icc | ||
FC: ifort | ||
CXX: icpc | ||
I_MPI_CC: icc | ||
I_MPI_F90: ifort | ||
|
||
# Split into a dependency build step, and a WW3 build step which | ||
# builds multiple switches in a matrix. The setup is run once and | ||
# the environment is cached so each build of WW3 can share the dependencies. | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
|
||
- name: checkout-ww3 | ||
if: steps.cache-env.outputs.cache-hit != 'true' | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ww3 | ||
|
||
# Cache spack, OASIS, and compiler | ||
# No way to flush Action cache, so key may have # appended | ||
- name: cache-env | ||
id: cache-env | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
spack | ||
~/.spack | ||
work_PR1 | ||
/opt/intel | ||
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_intel.yaml') }} | ||
|
||
- name: install-intel-compilers | ||
if: steps.cache-env.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | ||
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | ||
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | ||
sudo apt-get update | ||
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic | ||
# Build WW3 spack environment | ||
- name: install-dependencies-with-spack | ||
if: steps.cache-env.outputs.cache-hit != 'true' | ||
run: | | ||
# Install NetCDF, ESMF, g2, etc using Spack | ||
. /opt/intel/oneapi/setvars.sh | ||
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git | ||
source spack/share/spack/setup-env.sh | ||
ln -s $(realpath $(which gcc)) spack/lib/spack/env/intel/gcc # spack/make bug in ESMF | ||
spack env create ww3-intel ww3/model/ci/spack_intel.yaml | ||
spack env activate ww3-intel | ||
spack compiler find | ||
sudo apt install cmake | ||
spack external find | ||
spack add intel-oneapi-mpi | ||
spack config add "packages:all:require:['%intel']" | ||
spack concretize | ||
spack install --dirty -v --fail-fast | ||
spack clean --all | ||
regtest: | ||
needs: setup | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: checkout-ww3 | ||
uses: actions/checkout@v3 | ||
with: | ||
path: ww3 | ||
|
||
- name: cache-env | ||
id: cache-env | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
spack | ||
~/.spack | ||
work_PR1 | ||
/opt/intel | ||
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('ww3/model/ci/spack_intel.yaml') }} | ||
|
||
- name: run-ww3 | ||
run: | | ||
. /opt/intel/oneapi/setvars.sh | ||
source spack/share/spack/setup-env.sh | ||
spack env activate ww3-intel | ||
cd ww3/regtests | ||
export CC=mpiicc | ||
export FC=mpiifort | ||
export path_build_root=$(pwd)/build | ||
./bin/run_cmake_test -b slurm -o all -S -T -s PR1 -w work_PR1 ../model ww3_tp2.2 |