Skip to content

Runbenchmarks?

Runbenchmarks? #492

name: Continuous Integration
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
workflow_dispatch:
jobs:
compile:
name: Compile on ${{ matrix.os }} with ${{ matrix.cxx }} (BLAS ${{ matrix.blas }}, FFTW ${{ matrix.fftw }}, MPFR ${{ matrix.mpfr }}, C++ ${{ matrix.cpp }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cc: ../llvm/bin/clang
cxx: ../llvm/bin/clang++
clangVer: "15.0"
blas: off
fftw: off
mpfr: on
cpp: 20
pretty: "LibRapid_Ubuntu_Clang_C++20_MPFR"
- os: ubuntu-latest
cc: ../llvm/bin/clang
cxx: ../llvm/bin/clang++
clangVer: "15.0"
blas: on
fftw: on
mpfr: on
cpp: 20
pretty: "LibRapid_Ubuntu_Clang_C++20_BLAS_FFTW_MPFR"
- os: ubuntu-latest
cc: gcc-10
cxx: g++-10
blas: off
fftw: off
mpfr: on
cpp: 20
pretty: "LibRapid_Ubuntu_Clang_C++20_MPFR"
- os: ubuntu-latest
cc: gcc-10
cxx: g++-10
blas: on
fftw: on
mpfr: on
cpp: 20
pretty: "LibRapid_Ubuntu_Clang_C++20_BLAS_FFTW_MPFR"
- os: ubuntu-latest
cc: gcc-10
cxx: g++-10
blas: off
fftw: off
mpfr: on
cpp: 23
pretty: "LibRapid_Ubuntu_Clang_C++23_MPFR"
- os: ubuntu-latest
cc: gcc-10
cxx: g++-10
blas: on
fftw: on
mpfr: on
cpp: 23
pretty: "LibRapid_Ubuntu_Clang_C++23_BLAS_FFTW_MPFR"
- os: ubuntu-latest
cc: gcc-11
cxx: g++-11
blas: off
fftw: off
mpfr: on
cpp: 20
pretty: "LibRapid_Ubuntu_Clang_C++20_MPFR"
- os: ubuntu-latest
cc: gcc-11
cxx: g++-11
blas: on
fftw: on
mpfr: on
cpp: 20
pretty: "LibRapid_Ubuntu_Clang_C++20_BLAS_FFTW_MPFR"
- os: ubuntu-latest
cc: gcc-11
cxx: g++-11
blas: off
fftw: off
mpfr: on
cpp: 23
pretty: "LibRapid_Ubuntu_Clang_C++23_MPFR"
- os: ubuntu-latest
cc: gcc-11
cxx: g++-11
blas: on
fftw: on
mpfr: on
cpp: 23
pretty: "LibRapid_Ubuntu_Clang_C++23_BLAS_FFTW_MPFR"
- os: macos-latest
cc: ../llvm/bin/clang
cxx: ../llvm/bin/clang++
clangVer: "15.0"
blas: off
fftw: off
mpfr: on
cpp: 20
pretty: "LibRapid_MacOS_Clang++_C++20_MPFR"
- os: macos-latest
cc: ../llvm/bin/clang
cxx: ../llvm/bin/clang++
clangVer: "15.0"
blas: on
fftw: on
mpfr: on
cpp: 20
pretty: "LibRapid_MacOS_Clang++_C++20_BLAS_FFTW_MPFR"
- os: macos-latest
cc: gcc-11
cxx: g++-11
blas: off
fftw: off
mpfr: on
cpp: 20
pretty: "LibRapid_MacOS_GCC-11_C++20_MPFR"
- os: macos-latest
cc: gcc-11
cxx: g++-11
blas: on
fftw: on
mpfr: on
cpp: 20
pretty: "LibRapid_MacOS_GCC-11_C++20_BLAS_FFTW_MPFR"
- os: macos-latest
cc: gcc-11
cxx: g++-11
blas: off
fftw: off
mpfr: on
cpp: 23
pretty: "LibRapid_MacOS_GCC-11_C++23_MPFR"
- os: macos-latest
cc: gcc-11
cxx: g++-11
blas: on
fftw: on
mpfr: on
cpp: 23
pretty: "LibRapid_MacOS_GCC-11_C++23_BLAS_FFTW_MPFR"
- os: windows-latest
cc: ../llvm/clang
cxx: ../llvm/clang++
clangVer: "15.0"
blas: off
fftw: off
mpfr: on
cpp: 20
pretty: "LibRapid_Windows_Clang_C++20_MPFR"
- os: windows-latest
cc: ../llvm/clang
cxx: ../llvm/clang++
clangVer: "15.0"
blas: on
fftw: on
mpfr: on
cpp: 20
pretty: "LibRapid_Windows_Clang_C++20_BLAS_FFTW_MPFR"
- os: windows-latest
cc: ./llvm/clang
cxx: ./llvm/clang++
clangVer: "15.0"
blas: off
fftw: off
mpfr: on
cpp: 23
pretty: "LibRapid_Windows_Clang_C++23_MPFR"
- os: windows-latest
cc: ./llvm/clang
cxx: ./llvm/clang++
clangVer: "15.0"
blas: on
fftw: on
mpfr: on
cpp: 23
pretty: "LibRapid_Windows_Clang_C++23_BLAS_FFTW_MPFR"
- os: windows-latest
cc: msvc
cxx: msvc
blas: off
fftw: off
mpfr: on
cpp: 20
pretty: "LibRapid_Windows-Latest_MSVC_C++20"
- os: windows-latest
cc: msvc
cxx: msvc
blas: on
fftw: on
mpfr: on
cpp: 20
pretty: "LibRapid_Windows-Latest_MSVC_C++20"
- os: windows-latest
cc: msvc
cxx: msvc
blas: off
fftw: off
mpfr: on
cpp: 23
pretty: "LibRapid_Windows-Latest_MSVC_C++23"
- os: windows-latest
cc: msvc
cxx: msvc
blas: on
fftw: on
mpfr: on
cpp: 23
pretty: "LibRapid_Windows-Latest_MSVC_C++23"
steps:
- name: Checkout LibRapid
uses: actions/checkout@v3
with:
submodules: recursive
# - name: Install Clang
# if: matrix.clangVer != null
# uses: KyleMayes/install-llvm-action@v1
# with:
# version: ${{ matrix.clangVer }}
# directory: "./llvm"
# env: on
# - name: Install XCode
# if: matrix.os == 'macos-latest'
# uses: maxim-lobanov/[email protected]
# # Tests must pass in both debug and release mode
# - name: Compile (Debug)
# run: |
# mkdir buildDebug
# cd buildDebug
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=${{ matrix.cpp }} -DLIBRAPID_BUILD_EXAMPLES=on -DLIBRAPID_BUILD_TESTS=on -DLIBRAPID_GET_BLAS=${{ matrix.blas }} -DLIBRAPID_USE_MULTIPREC=${{ matrix.mpfr }}
# cmake --build . --config Debug
# env:
# CC: ${{ matrix.cc }}
# CXX: ${{ matrix.cxx }}
# - name: Run Tests (Debug)
# run: |
# cd buildDebug
# ctest -C Debug --output-on-failure
# - name: Compile (Release)
# run: |
# mkdir buildRelease
# cd buildRelease
# cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=${{ matrix.cpp }} -DLIBRAPID_BUILD_EXAMPLES=on -DLIBRAPID_BUILD_TESTS=on -DLIBRAPID_GET_BLAS=${{ matrix.blas }} -DLIBRAPID_USE_MULTIPREC=${{ matrix.mpfr }}
# cmake --build . --config Release
# env:
# CC: ${{ matrix.cc }}
# CXX: ${{ matrix.cxx }}
# - name: Run Tests (Release)
# run: |
# cd buildRelease
# ctest -C Release --output-on-failure
build-docs:
name: Build Documentation Locally
runs-on: ubuntu-latest
steps:
- name: Checkout LibRapid
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get latest CMake and ninja
uses: lukka/get-cmake@latest
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
# - name: Install Clang
# uses: KyleMayes/install-llvm-action@v1
# with:
# version: "15.0"
# directory: "./llvm"
# env: on
# - name: Build Doxygen
# id: build_doxygen
# continue-on-error: true
# run: |
# git clone --recursive https://github.com/doxygen/doxygen.git
# cd doxygen
# git checkout Release_1_9_7
# mkdir build
# cd build
# cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles"
# cmake --build . --config Release
# sudo make install
# env:
# CC: gcc
# CXX: g++
# - name: Install Doxygen on Error
# if: steps.build_doxygen.outcome != 'success'
# run: |
# sudo apt install doxygen
# - name: Upgrade Source Distribution
# continue-on-error: true
# run: |
# sudo apt update
# sudo apt upgrade -y
# sudo apt autoremove -y
# - name: Install LaTeX
# continue-on-error: true
# run: |
# sudo apt-get install -y texlive-full
# - name: Install Requirements
# continue-on-error: true
# run: |
# cd docs
# pip install -r requirements.txt
# - name: Force install Sphinx Build
# run: |
# sudo apt-get install python3-sphinx
# - name: Configure Files
# run: |
# touch .is_local
# - name: Build HTML Documentation
# run: |
# cd docs
# make html
# - name: Build PDf Documentation
# # continue-on-error: true
# run: |
# cd docs
# make latexpdf
# - name: Store Artifacts
# uses: actions/upload-artifact@v3
# with:
# name: Documentation
# path: docs/build/**
run-benchmarks:
name: Run Benchmarks on ${{ matrix.os }} with ${{ matrix.cxx }}
needs: [ compile, build-docs ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cc: ../../llvm/bin/clang
cxx: ../../llvm/bin/clang++
clangVer: "15.0"
smallArrays: ON
pretty: "LibRapid_Ubuntu_Clang_OptimiseSmallArrays"
- os: ubuntu-latest
cc: ../../llvm/bin/clang
cxx: ../../llvm/bin/clang++
clangVer: "15.0"
smallArrays: OFF
pretty: "LibRapid_Ubuntu_Clang"
- os: ubuntu-latest
cc: gcc-11
cxx: g++-11
smallArrays: ON
pretty: "LibRapid_Ubuntu_GCC_OptimiseSmallArrays"
- os: ubuntu-latest
cc: gcc-11
cxx: g++-11
smallArrays: OFF
pretty: "LibRapid_Ubuntu_GCC"
- os: macos-latest
cc: ../../llvm/bin/clang
cxx: ../../llvm/bin/clang++
clangVer: "15.0"
smallArrays: ON
pretty: "LibRapid_MacOS_Clang_OptimiseSmallArrays"
- os: macos-latest
cc: ../../llvm/bin/clang
cxx: ../../llvm/bin/clang++
clangVer: "15.0"
smallArrays: OFF
pretty: "LibRapid_MacOS_Clang"
- os: macos-latest
cc: gcc-11
cxx: g++-11
smallArrays: ON
pretty: "LibRapid_MacOS_GCC_OptimiseSmallArrays"
- os: macos-latest
cc: gcc-11
cxx: g++-11
smallArrays: OFF
pretty: "LibRapid_MacOS_GCC"
- os: windows-latest
cc: ../../llvm/clang
cxx: ../../llvm/clang++
clangVer: "15.0"
smallArrays: ON
pretty: "LibRapid_Windows_Clang_OptimiseSmallArrays"
- os: windows-latest
cc: ../../llvm/clang
cxx: ../../llvm/clang++
clangVer: "15.0"
smallArrays: OFF
pretty: "LibRapid_Windows_Clang"
- os: windows-latest
cc: msvc
cxx: msvc
smallArrays: ON
pretty: "LibRapid_Windows_MSVC_OptimiseSmallArrays"
- os: windows-latest
cc: msvc
cxx: msvc
smallArrays: OFF
pretty: "LibRapid_Windows_MSVC"
steps:
- name: Install Clang
if: matrix.clangVer != null
uses: KyleMayes/install-llvm-action@v1
with:
version: ${{ matrix.clangVer }}
directory: "./llvm"
env: on
- name: Install XCode
if: matrix.os == 'macos-latest'
uses: maxim-lobanov/[email protected]
- name: Clone Benchmark Repository
run: |
git clone https://github.com/LibRapid/BenchmarksCPP.git --recursive
- name: Update LibRapid Submodule
run: |
cd BenchmarksCPP
cd vendor/librapid
git checkout ${{ github.head_ref || github.ref_name }} || git checkout ${{ github.ref }}
git pull
git submodule update --init --recursive
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install Requirements
run: |
cd BenchmarksCPP
pip install -r requirements.txt
- name: Compile Benchmarks
run: |
cd BenchmarksCPP
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DUSING_GITHUB_ACTIONS=ON -DLIBRAPID_OPTIMISE_SMALL_ARRAYS=${{ matrix.smallArrays }}
cmake --build . --config Release
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
# On Windows, the generated executable is in "build/Release"
- name: Run Benchmarks
if: matrix.os == 'windows-latest'
run: |
cd BenchmarksCPP/build/Release
./BenchmarksCPP.exe
# On Unix systems, the generated executable is in "build"
- name: Run Benchmarks
if: matrix.os != 'windows-latest'
run: |
cd BenchmarksCPP/build
./BenchmarksCPP
- name: Generate Benchmark Graphs
if: matrix.os == 'windows-latest'
run: |
cd BenchmarksCPP/scripts
python dataProcessor.py --directory ../build/Release --output ../../${{ matrix.pretty }} --relative Eigen --verbose
- name: Generate Benchmark Graphs
if: matrix.os != 'windows-latest'
run: |
cd BenchmarksCPP/scripts
python dataProcessor.py --directory ../build --output ../../${{ matrix.pretty }} --relative Eigen --verbose
- name: Upload Intermediate Benchmark Results
uses: actions/upload-artifact@v3
with:
name: BenchmarkResult_${{ matrix.pretty }}
path: ${{ matrix.pretty }}
upload-benchmarks:
name: Upload Benchmark Results
needs: run-benchmarks
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Checkout LibRapid
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Intermediate Benchmark Results
uses: actions/download-artifact@v2
with:
name: BenchmarkResult_*
path: BECHMARK_RESULTS
- name: Upload Benchmark Results
uses: actions/upload-artifact@v3
with:
name: LibRapid_Benchmark_SHA_${{ github.sha }}
path: BECHMARK_RESULTS
quodona:
name: Run Qodana
needs: [ compile, upload-benchmarks ]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout LibRapid
uses: actions/checkout@v3
with:
submodules: recursive
# - name: Qodana Scan
# uses: JetBrains/qodana-action@main
# env:
# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
code-coverage:
name: Code Coverage
needs: [ compile, upload-benchmarks ]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout LibRapid
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get latest CMake and ninja
uses: lukka/get-cmake@latest
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install Coverage Tools
run: |
sudo apt install lcov
sudo apt install gcovr
- name: Compile and Run
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DLIBRAPID_CODE_COV=on -DLIBRAPID_BUILD_EXAMPLES=on -DLIBRAPID_BUILD_TESTS=on -DLIBRAPID_GET_BLAS=ON -DLIBRAPID_GET_FFTW=on -DLIBRAPID_USE_MULTIPREC=on
cmake --build .
env:
CC: gcc-11
CXX: g++-11
- name: Run Tests
run: |
cd build
ctest -C Debug --output-on-failure
- name: Upload Coverage Reports
uses: codecov/codecov-action@v3
trigger-docs:
name: Trigger Documentation Build
needs: [ compile, build-docs, quodona, code-coverage ]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Checkout LibRapid
uses: actions/checkout@v3
with:
submodules: recursive
- name: Trigger RTDs build
uses: dfm/rtds-action@v1
with:
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }}
commit_ref: ${{ github.ref }}
success:
name: Success
needs: trigger-docs
runs-on: ubuntu-latest
steps:
- name: Print Success
run: |
echo "Success!"