Reduce nloops to avoid very small elapsed time. #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: benchmark_dot | |
on: | |
push: | |
paths: | |
- src/*.f90 | |
- benchmarks/dot/dot.f90 | |
- benchmarks/dot/dot_co.f90 | |
pull_request: | |
paths: | |
- src/*.f90 | |
- benchmarks/dot/dot.f90 | |
- benchmarks/dot/dot_co.f90 | |
# schedule: | |
# - cron: '0 0 1 * *' | |
jobs: | |
Build: | |
if: github.repository_owner == 'gha3mi' | |
runs-on: ${{ matrix.os }} | |
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 | |
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: ${{ matrix.toolchain.compiler }} | |
version: ${{ matrix.toolchain.version }} | |
- name: dot benchmark | |
run: fpm @benchmark-dot-${{env.FC}} | |
env: | |
FC: ${{ steps.setup-fortran.outputs.fc }} | |
- 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 ../.. | |
env: | |
FC: ${{ steps.setup-fortran.outputs.fc }} | |
- name: Create Pull Request | |
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}}" |