From 562646e5ce75db1bf6873a90e49ae24326a33349 Mon Sep 17 00:00:00 2001 From: Seyed Ali Ghasemi Date: Tue, 23 Jan 2024 13:55:10 +0100 Subject: [PATCH] Run benchmarks sequentially for each compiler --- .github/workflows/CI_benchmark_dot.yml | 233 ++++++++++++++++++++++--- 1 file changed, 207 insertions(+), 26 deletions(-) diff --git a/.github/workflows/CI_benchmark_dot.yml b/.github/workflows/CI_benchmark_dot.yml index 4b9727d..3552a9a 100644 --- a/.github/workflows/CI_benchmark_dot.yml +++ b/.github/workflows/CI_benchmark_dot.yml @@ -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 @@ -50,18 +43,17 @@ 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: | @@ -69,22 +61,211 @@ jobs: - 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}}" \ No newline at end of file + 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" \ No newline at end of file