Skip to content

[Experimental PR] Benchmark any Frontier Release on the CI #3

[Experimental PR] Benchmark any Frontier Release on the CI

[Experimental PR] Benchmark any Frontier Release on the CI #3

Workflow file for this run

name: 'Benchmark Frontier Releases'

Check failure on line 1 in .github/workflows/bench-frontier.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/bench-frontier.yml

Invalid workflow file

(Line: 47, Col: 18): Unrecognized function: 'if'. Located at position 1 within expression: if(github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '', github.event.inputs.tag, 'v5.1.3')
concurrency:
group: bench-frontier
cancel-in-progress: false
on:
push:
pull_request:
workflow_dispatch:
inputs:
tag:
description: 'tag to Benchmark'
required: true
default: 'v5.1.3'
jobs:
self:
name: "${{ matrix.name }} (${{ matrix.device }}${{ matrix.interface != 'none' && format('-{0}', matrix.interface) || '' }})"
strategy:
fail-fast: false
matrix:
include:
- cluster: frontier
name: Oak Ridge | Frontier (CCE)
group: phoenix
labels: frontier
flag: f
device: gpu
interface: acc
build_script: "bash .github/workflows/frontier/build.sh gpu acc bench"
# - cluster: frontier
# name: Oak Ridge | Frontier (CCE)
# group: phoenix
# labels: frontier
# flag: f
# device: gpu
# interface: omp
# build_script: "bash .github/workflows/frontier/build.sh gpu omp bench"
runs-on:
group: ${{ matrix.group }}
labels: ${{ matrix.labels }}
timeout-minutes: 480
env:
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
BENCH_TAG: ${{ if(github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '', github.event.inputs.tag, 'v5.1.3') }}
steps:
- name: Clone - PR
uses: actions/checkout@v4
with:
path: pr
- name: Clone - Master
uses: actions/checkout@v4
with:
repository: MFlowCode/MFC
ref: ${{ env.BENCH_TAG }}
path: master
- name: Checkout PR repo
uses: actions/checkout@v3
with:
path: pr
- name: Prepare Docker context
run: |
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo mkdir -p /home/runner/tmp
export TMPDIR=/home/runner/tmp
free -h
sudo mkdir -p master
sudo chmod 777 master
rm -rf master/*
cp -r mfc/* master/
cp -r mfc/.git master/.git
cp pr/.github/Dockerfile master/
cp pr/.github/.dockerignore master/
cp pr/toolchain/dependencies/Silo.patch master/toolchain/dependencies/Silo.patch
cp pr/.github/scripts/run_parallel_benchmarks.sh master/.github/scripts/run_parallel_benchmarks.sh
- name: Replace old SILO block in CMakeLists.txt
run: |
if [ -f master/toolchain/pyproject.toml ]; then
sed -i 's/"cantera",/"cantera==3.0.1",/g' master/toolchain/pyproject.toml
fi
sed -i '/# SILO/,/^endif()/{
r /dev/stdin
d
}' master/toolchain/dependencies/CMakeLists.txt <<'EOF'
# SILO
if (MFC_SILO)
find_package(SILO)
if (SILO_FOUND)
message(STATUS "SILO found.")
add_custom_target(silo)
else()
find_package(Git REQUIRED)
ExternalProject_Add(silo
GIT_REPOSITORY "https://github.com/LLNL/Silo"
GIT_TAG 9af504ef4fb79153e1fbf3bdb75421b6b65f6dc4
GIT_PROGRESS ON
PATCH_COMMAND "${GIT_EXECUTABLE}" stash
&& "${GIT_EXECUTABLE}" apply "${CMAKE_SOURCE_DIR}/Silo.patch"
CMAKE_ARGS -DSILO_ENABLE_SHARED=OFF
-DSILO_ENABLE_SILOCK=OFF
-DSILO_ENABLE_BROWSER=OFF
-DFIND_LIBRARY_USE_LIB64_PATHS=ON
"-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
"-DCMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH}"
"-DCMAKE_FIND_PACKAGE_REDIRECTS_DIR=${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}"
"-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
"$<$<STREQUAL:${CMAKE_Fortran_COMPILER_ID},Cray>:-DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/../cmake/cce>"
)
endif()
endif()
EOF
- name: Setup & Build
run: |
(cd master && ${{ matrix.build_script }}) &
wait %1
- name: Bench (Master)
run: bash master/.github/scripts/run_parallel_benchmarks.sh ${{ matrix.device }} ${{ matrix.cluster }}
- name: Print Logs
if: always()
run: |
cat master/bench-${{ matrix.device }}.* 2>/dev/null || true
- name: Archive Logs (Frontier)
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.cluster }}-${{ matrix.device }}
path: |
master/bench-${{ matrix.device }}.*
master/build/benchmarks/*