Skip to content

ci.yml: use intel-oneapi-compiler-fortran-2024.2 for mpiifort env #925

ci.yml: use intel-oneapi-compiler-fortran-2024.2 for mpiifort env

ci.yml: use intel-oneapi-compiler-fortran-2024.2 for mpiifort env #925

Workflow file for this run

name: DIRAC-CASPT2-CI-test
on:
push:
paths:
# Ref : https://mzqvis6akmakplpmcjx3.hatenablog.com/entry/2021/02/07/134133
# Run CI when only source code, build configuration, test files or files related to CI are modified.
- "**.f90"
- "**.F90"
- "**.cmake"
- "**/CMakeLists.txt"
- "**.py"
- "tools/**"
- ".github/workflows/**"
pull_request:
branches:
- "main"
paths:
# Ref : https://mzqvis6akmakplpmcjx3.hatenablog.com/entry/2021/02/07/134133
# Run CI when only source code, build configuration, test files or files related to CI are modified.
- "**.f90"
- "**.F90"
- "**.cmake"
- "**/CMakeLists.txt"
- "**.py"
- "tools/**"
- ".github/workflows/**"
# Ref : https://github.com/pytest-dev/pytest/issues/7443#issue-650484842
env:
PYTEST_ADDOPTS: "--color=yes"
defaults:
run:
shell: bash
jobs:
test-linux-intel-mpi:
timeout-minutes: 60 # Max execution time (min)
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- {fc: mpiifort, pkgname: intel-oneapi-compiler-fortran-2024.2}
- {fc: mpiifx, pkgname: intel-oneapi-compiler-fortran}
env:
KEYVERSION: v1 # If you don't want to cache (intel fortran), you should change KEYVERSION.
steps:
- uses: actions/checkout@v4
- name: cache install
id: cache-install
uses: actions/cache@v4
with:
path: |
/opt/intel/oneapi
key: ${{ runner.os }}-install-intel-${{ env.KEYVERSION }}
- name: Update packages
run: |
sudo apt-get update
- name: Setup Intel fortran (apt)
if: steps.cache-install.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
- name: Install MKL
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y intel-oneapi-mkl
- name: Install MPI Intel Fortran compiler
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y ${{ matrix.toolchain.pkgname }} intel-oneapi-openmp intel-oneapi-mpi intel-oneapi-mpi-devel
- name: Set Intel oneAPI environments
run: |
source /opt/intel/oneapi/setvars.sh --force
printenv >> $GITHUB_ENV
- name: Install cmake
run: |
sudo apt-get install -y cmake
- run: ${{ matrix.toolchain.fc }} --version
- name: Install python
uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: "x64"
- name: Install pytest for unit test
run: python -m pip install pytest
- name: Build source code (parallel)
run: |
./setup --mpi --omp -j --build --fc ${{ matrix.toolchain.fc }}
- name: Run unittest(parallel, run slowonly tests, pull_request)
if: ${{ github.event_name == 'pull_request' }}
run: |
pytest --slowonly --mpi=2
- name: Run unittest(parallel, run normal and slow tests, push to other than main branch)
if: ${{ github.ref_name != 'main' && github.event_name == 'push' }}
run: |
pytest --mpi=2
- name: Run unittest(parallel, run all tests, push to main branch)
if: ${{ github.ref_name == 'main' && github.event_name == 'push' }}
run: |
pytest --all --mpi=2
test-linux-gfortran:
timeout-minutes: 60 # Max execution time (min)
strategy:
matrix:
toolchain:
- { compiler: gcc, version: 7, image: ubuntu-20.04 }
- { compiler: gcc, version: 8, image: ubuntu-20.04 }
- { compiler: gcc, version: 9, image: ubuntu-22.04 }
- { compiler: gcc, version: 10, image: ubuntu-22.04 }
- { compiler: gcc, version: 11, image: ubuntu-22.04 }
- { compiler: gcc, version: 12, image: ubuntu-22.04 }
runs-on: ${{ matrix.toolchain.image }}
env:
KEYVERSION: v1 # If you don't want to cache (intel fortran), you should change KEYVERSION.
steps:
- uses: actions/checkout@v4
- name: cache install (MKL)
id: cache-install
uses: actions/cache@v4
with:
path: |
/opt/intel/oneapi
key: ${{ runner.os }}-install-gnu-${{ env.KEYVERSION }}
- name: Update packages
run: |
sudo apt-get update
- name: Setup MKL
if: steps.cache-install.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
- name: Install MKL
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y intel-oneapi-mkl
- name: set environment variables
id: setenv
run: |
echo "BUILD_OPTION= --omp " >> "$GITHUB_OUTPUT"
echo "OPENMP_TEST_OPTION= --omp 2" >> "$GITHUB_OUTPUT"
echo "FC=gfortran-${{ matrix.toolchain.version }} " >> "$GITHUB_OUTPUT"
- name: Install cmake
run: |
sudo apt-get install -y cmake
- name: Set Intel oneAPI environments
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- uses: fortran-lang/setup-fortran@8821f57b53846d35d62632eb51c60ac6c4bff4ce # v1.6.1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
- run: ${{ steps.setenv.outputs.FC }} --version
- name: Install python
uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: "x64"
- name: Install pytest for unit test
run: python -m pip install pytest
- name: Build source code
run: |
./setup --fc ${{ steps.setenv.outputs.FC }} ${{ steps.setenv.outputs.BUILD_OPTION }} -j --build
- name: Run unittest(run slowonly tests, pull_request)
if: ${{ github.event_name == 'pull_request' }}
run: |
pytest --slowonly
- name: Run unittest(run normal and slow tests, push to other than main branch)
if: ${{ github.ref_name != 'main' && github.event_name == 'push' }}
run: |
pytest ${{ steps.setenv.outputs.OPENMP_TEST_OPTION }}
- name: Run unittest(run all tests, push to main branch)
if: ${{ github.ref_name == 'main' && github.event_name == 'push' }}
run: |
pytest --all