Skip to content

Commit

Permalink
ci: fix for intel, updates for gnu (NOAA-EMC#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMasarik-NOAA authored Sep 11, 2023
1 parent 59c554a commit 97e6a63
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 35 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ concurrency:
cancel-in-progress: true

env:
cache_key: gnu8
cache_key: gnu11
CC: gcc-10
FC: gfortran-10
CXX: g++-10
Expand All @@ -24,14 +24,14 @@ jobs:
steps:
- name: checkout-ww3
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
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@v2
uses: actions/cache@v3
with:
path: |
spack
Expand All @@ -45,7 +45,7 @@ jobs:
run: |
# Install NetCDF, ESMF, g2, etc using Spack
sudo apt install cmake
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create ww3-gnu ww3/model/ci/spack_gnu.yaml
spack env activate ww3-gnu
Expand All @@ -72,18 +72,18 @@ jobs:
needs: setup
strategy:
matrix:
switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF, NUOPC_MESH]
switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF]
runs-on: ubuntu-latest

steps:
- name: checkout-ww3
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ww3

- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
Expand All @@ -101,9 +101,7 @@ jobs:
export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct
mkdir build && cd build
if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then
cmake .. -DUFS_CAP=MULTI_ESMF -DSWITCH=multi_esmf
elif [[ ${{ matrix.switch }} == "NUOPC_MESH" ]]; then
cmake .. -DUFS_CAP=NUOPC_MESH -DSWITCH=meshcap
cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf
else
cmake .. -DSWITCH=${{ matrix.switch }}
fi
Expand Down
37 changes: 18 additions & 19 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ concurrency:

# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran
env:
cache_key: intel7
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
# 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
runs-on: ubuntu-20.04

steps:

- name: checkout-ww3
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
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@v2
uses: actions/cache@v3
with:
path: |
spack
Expand All @@ -51,26 +51,27 @@ jobs:
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-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
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
sudo mv /usr/local /usrlocal_renamed
sudo apt install cmake
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
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
spack external find cmake
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
- name: build-oasis
if: steps.cache-env.outputs.cache-hit != 'true'
Expand All @@ -90,18 +91,18 @@ jobs:
needs: setup
strategy:
matrix:
switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF, NUOPC_MESH]
runs-on: ubuntu-20.04
switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF]
runs-on: ubuntu-20.04

steps:
- name: checkout-ww3
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ww3

- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
Expand All @@ -116,14 +117,12 @@ jobs:
source spack/share/spack/setup-env.sh
spack env activate ww3-intel
cd ww3
export CC=mpicc
export FC=mpif90
export CC=mpiicc
export FC=mpiifort
export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct
mkdir build && cd build
if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then
cmake .. -DUFS_CAP=MULTI_ESMF -DSWITCH=multi_esmf
elif [[ ${{ matrix.switch }} == "NUOPC_MESH" ]]; then
cmake .. -DUFS_CAP=NUOPC_MESH -DSWITCH=meshcap
cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf
else
cmake .. -DSWITCH=${{ matrix.switch }}
fi
Expand Down
3 changes: 2 additions & 1 deletion model/ci/spack_gnu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ spack:
- g2@3.4.5
- bacio@2.4.1
- w3emc@2.9.2
- esmf@8.1.1~pio~pnetcdf~xerces
- parallelio@2.5.9+fortran~pnetcdf
- esmf@8.4.2~debug~xerces+external-parallelio
view: true
concretizer:
unify: when_possible
11 changes: 6 additions & 5 deletions model/ci/spack_intel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ spack:
providers:
mpi: [intel-oneapi-mpi]
specs:
- netcdf-c@4.7.4~dap
- netcdf-fortran@4.5.3
- bacio@2.4.1
- g2@3.4.5
- metis@5.1.0~shared
- parmetis@4.0.3~shared
- scotch@7.0.1+mpi+metis~shared
- netcdf-c@4.7.4~dap
- netcdf-fortran@4.5.3
- jasper@2.0.32
- g2@3.4.5
- bacio@2.4.1
- w3emc@2.9.2
- esmf@8.1.1~pio~pnetcdf~xerces
- parallelio@2.5.9+fortran~pnetcdf
- esmf@8.4.2~debug~xerces+external-parallelio
- intel-oneapi-mpi %intel
view: true
concretizer:
Expand Down

0 comments on commit 97e6a63

Please sign in to comment.