Skip to content

Commit

Permalink
Local comm var; elif
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoon committed May 29, 2024
1 parent 8f11c8c commit 1fc8f9e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ jobs:
build:
name: Build ESMF ${{ matrix.esmf_version }}
with GCC ${{ matrix.gcc_major_version }}
(${{ matrix.comm }})
(${{ matrix.esmf_comm }})
runs-on: ubuntu-22.04
strategy:
matrix:
gcc_major_version: ["12"]
esmf_version: ["8.3.1", "8.4.2", "8.5.0", "8.6.1"]
comm: ["mpiuni", "mpi"]
esmf_comm: ["mpiuni", "mpi"]

steps:
- name: Check out
Expand All @@ -26,25 +26,26 @@ jobs:
- name: Build ESMF
run: |
v="${{ matrix.esmf_version }}" # ESMF
comm="${{ matrix.esmf_comm }}"
gcc="${{ matrix.gcc_major_version }}"
esmf_base=$HOME/esmf
export ESMF_DIR=${esmf_base}/${v}-gcc-${gcc}-${{ matrix.comm }}
export ESMF_DIR=${esmf_base}/${v}-gcc-${gcc}-${comm}
mkdir -p $ESMF_DIR
cd $esmf_base
wget https://github.com/esmf-org/esmf/archive/refs/tags/v${v}.tar.gz
tar xzvf v${v}.tar.gz --directory=/tmp && mv /tmp/esmf-${v}/* $ESMF_DIR
export ESMF_COMPILER=gfortran
export ESMF_LAPACK=netlib
export ESMF_COMM=${{ matrix.comm }}
export ESMF_COMM=${comm}
export ESMF_PIO=internal
export ESMF_NETCDF=nc-config
if [ "${{ matrix.comm }}" == "mpiuni" ]; then
if [ "${comm}" == "mpiuni" ]; then
export ESMF_F90COMPILER=gfortran-${gcc}
export ESMF_CCOMPILER=gcc-${gcc}
export ESMF_CXXCOMPILER=g++-${gcc}
else if [ "${{ matrix.comm }}" == "mpi" ]; then
elif [ "${comm}" == "mpi" ]; then
export OMPI_FC=gfortran-${gcc}
export OMPI_CC=gcc-${gcc}
export OMPI_CXX=g++-${gcc}
Expand All @@ -59,7 +60,7 @@ jobs:
cd $ESMF_DIR
make -j lib
echo "ESMFMKFILE=${ESMF_DIR}/lib/libO/Linux.gfortran.64.${{ matrix.comm }}.default/esmf.mk" >> "$GITHUB_ENV"
echo "ESMFMKFILE=${ESMF_DIR}/lib/libO/Linux.gfortran.64.${comm}.default/esmf.mk" >> "$GITHUB_ENV"
echo "ESMF_DIR=${ESMF_DIR}" >> "$GITHUB_ENV"
- name: Compress ESMF dir
Expand All @@ -71,7 +72,7 @@ jobs:
- name: Upload ESMF dir as artifact
uses: actions/upload-artifact@v4
with:
name: esmf-${{ matrix.esmf_version }}-gcc-${{ matrix.gcc_major_version }}-${{ matrix.comm }}
name: esmf-${{ matrix.esmf_version }}-gcc-${{ matrix.gcc_major_version }}-${{ matrix.esmf_comm }}
path: ${{ env.ESMF_DIR }}.tar.gz
retention-days: 1

Expand Down

0 comments on commit 1fc8f9e

Please sign in to comment.