Skip to content

Commit

Permalink
Run benchmarks sequentially for each compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Jan 23, 2024
1 parent b6f81ca commit 562646e
Showing 1 changed file with 207 additions and 26 deletions.
233 changes: 207 additions & 26 deletions .github/workflows/CI_benchmark_dot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,14 @@ on:

jobs:

Build:
Benchmark_gfortran:
if: github.repository_owner == 'gha3mi'
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
toolchain:
- {compiler: gcc}
- {compiler: intel}
- {compiler: intel-classic}
- {compiler: nvidia-hpc}

steps:
- name: Checkout code
Expand All @@ -50,41 +43,229 @@ jobs:
uses: fortran-lang/setup-fortran@main
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
compiler: gcc

- name: Test
run: fpm @benchmark-dot-test-${{env.FC}}
run: fpm @benchmark-dot-test-gfortran
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
FC: gfortran

- name: Run dot benchmark
run: fpm @benchmark-dot-${{env.FC}}
run: fpm @benchmark-dot-gfortran
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
FC: gfortran

- name: Install Python dependencies
run: |
python -m pip install pandas matplotlib
- name: Results
run: |
cd benchmarks/dot && python results/export.py dot_${{env.FC}}.data && cd ../..
cd benchmarks/dot && python results/export.py dot_gfortran.data && cd ../..
- name: Merge Results
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin
git switch -c results origin/${{ github.event.repository.default_branch }}
git add benchmarks/dot/results/dot_gfortran*.png
git add benchmarks/dot/results/dot_gfortran*.html
git commit -m "Update results gfortran"
git push -u origin results --force-with-lease
- name: Create Pull Request
Benchmark_ifx:
if: github.repository_owner == 'gha3mi'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Fortran Package Manager (fpm)
uses: fortran-lang/setup-fpm@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install LAPACK and BLAS
run: sudo apt-get install -y libblas-dev liblapack-dev

- name: Setup Fortran Compiler
uses: fortran-lang/setup-fortran@main
id: setup-fortran
with:
compiler: gcc

- name: Test
run: fpm @benchmark-dot-test-ifx
env:
FC: ifx

- name: Run dot benchmark
run: fpm @benchmark-dot-ifx
env:
FC: ifx

- name: Install Python dependencies
run: |
python -m pip install pandas matplotlib
- name: Results
run: |
cd benchmarks/dot && python results/export.py dot_ifx.data && cd ../..
- name: Merge Results
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin
git switch -c results origin/${{ github.event.repository.default_branch }}
git add benchmarks/dot/results/dot_ifx*.png
git add benchmarks/dot/results/dot_ifx*.html
git commit -m "Update results ifx"
git push -u origin results --force-with-lease
Benchmark_ifort:
if: github.repository_owner == 'gha3mi'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Fortran Package Manager (fpm)
uses: fortran-lang/setup-fpm@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install LAPACK and BLAS
run: sudo apt-get install -y libblas-dev liblapack-dev

- name: Setup Fortran Compiler
uses: fortran-lang/setup-fortran@main
id: setup-fortran
with:
compiler: gcc

- name: Test
run: fpm @benchmark-dot-test-ifort
env:
FC: ifort

- name: Run dot benchmark
run: fpm @benchmark-dot-ifort
env:
FC: ifort

- name: Install Python dependencies
run: |
python -m pip install pandas matplotlib
- name: Results
run: |
cd benchmarks/dot && python results/export.py dot_ifort.data && cd ../..
- name: Merge Results
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin
git switch -c results origin/${{ github.event.repository.default_branch }}
git add benchmarks/dot/results/dot_ifort*.png
git add benchmarks/dot/results/dot_ifort*.html
git commit -m "Update results ifort"
git push -u origin results --force-with-lease
Benchmark_nvfortran:
if: github.repository_owner == 'gha3mi'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Fortran Package Manager (fpm)
uses: fortran-lang/setup-fpm@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install LAPACK and BLAS
run: sudo apt-get install -y libblas-dev liblapack-dev

- name: Setup Fortran Compiler
uses: fortran-lang/setup-fortran@main
id: setup-fortran
with:
compiler: gcc

- name: Test
run: fpm @benchmark-dot-test-nvfortran
env:
FC: nvfortran

- name: Run dot benchmark
run: fpm @benchmark-dot-nvfortran
env:
FC: nvfortran

- name: Install Python dependencies
run: |
python -m pip install pandas matplotlib
- name: Results
run: |
cd benchmarks/dot && python results/export.py dot_nvfortran.data && cd ../..
- name: Merge Results
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FC: ${{ steps.setup-fortran.outputs.fc }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin
git switch -c results-${{env.FC}} origin/${{ github.event.repository.default_branch }}
git add benchmarks/dot/results/dot_${{env.FC}}*.png
git add benchmarks/dot/results/dot_${{env.FC}}*.html
git commit -m "Update results ${{env.FC}}"
git push -u origin results-${{env.FC}} --force-with-lease
default_branch="${{ github.event.repository.default_branch }}"
gh pr create -B "$default_branch" -H "results-${{env.FC}}" --title "Update results-${{env.FC}}" --body "Update results-${{env.FC}}"
git switch -c results origin/${{ github.event.repository.default_branch }}
git add benchmarks/dot/results/dot_nvfortran*.png
git add benchmarks/dot/results/dot_nvfortran*.html
git commit -m "Update results nvfortran"
git push -u origin results --force-with-lease
Create_PR:
if: github.repository_owner == 'gha3mi'
needs: [Benchmark_gfortran, Benchmark_ifx, Benchmark_ifort, Benchmark_nvfortran]
runs-on: ubuntu-latest
steps:
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr create -B "${{ github.event.repository.default_branch }}" -H "results" --title "Update results" --body "Update results"

0 comments on commit 562646e

Please sign in to comment.