Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/Benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Benchmarks
on:
pull_request_target:
branches: [main]
workflow_dispatch:
permissions:
pull-requests: write
jobs:
bench:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version:
- "1"
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: MilesCranmer/AirspeedVelocity.jl@action-v1
with:
julia-version: ${{ matrix.version }}
bench-on: ${{ github.event.pull_request.head.sha }}
69 changes: 0 additions & 69 deletions .github/workflows/benchmarks_and_downstream.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
docs/Manifest.toml
test/Manifest.toml
docs/build/
test/downstream/Manifest.toml
benchmark/Manifest.toml
File renamed without changes.
30 changes: 15 additions & 15 deletions test/downstream/test-all-benchmarks.jl → benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Pkg
Pkg.activate(dirname(@__FILE__))
Pkg.develop(PackageSpec(path=dirname(dirname(@__DIR__))))
Pkg.add(url="https://github.com/VEZY/PlantBiophysics.jl", rev="dev")
Pkg.add(url="https://github.com/PalmStudio/XPalm.jl", rev="dev")
#Pkg.develop(PackageSpec(path=dirname(dirname(@__DIR__))))
Pkg.add(url="https://github.com/VEZY/PlantBiophysics.jl", rev="master")
Pkg.add(url="https://github.com/PalmStudio/XPalm.jl", rev="main")
Pkg.resolve()
Pkg.instantiate()

Expand All @@ -24,31 +24,31 @@ elseif Sys.isapple()
elseif Sys.islinux()
suite_name = suite_name * "linux"
end
suite = BenchmarkGroup()
suite[suite_name] = BenchmarkGroup(["PSE", "PBP", "XPalm"])
const SUITE = BenchmarkGroup()
SUITE[suite_name] = BenchmarkGroup(["PSE", "PBP", "XPalm"])

# "PSE benchmark"
include("test-PSE-benchmark.jl")
suite[suite_name]["PSE"] = @benchmarkable do_benchmark_on_heavier_mtg()
SUITE[suite_name]["PSE"] = @benchmarkable do_benchmark_on_heavier_mtg()

# "PBP benchmark"
include("test-plantbiophysics.jl")
suite[suite_name]["PBP"] = @benchmarkable benchmark_plantbiophysics()
SUITE[suite_name]["PBP"] = @benchmarkable benchmark_plantbiophysics()

leaf, meteo = setup_benchmark_plantbiophysics_multitimestep()
suite[suite_name]["PBP_multiple_timesteps_MT"] = @benchmarkable benchmark_plantbiophysics_multitimestep_MT($leaf, $meteo)
suite[suite_name]["PBP_multiple_timesteps_ST"] = @benchmarkable benchmark_plantbiophysics_multitimestep_ST($leaf, $meteo)
SUITE[suite_name]["PBP_multiple_timesteps_MT"] = @benchmarkable benchmark_plantbiophysics_multitimestep_MT($leaf, $meteo)
SUITE[suite_name]["PBP_multiple_timesteps_ST"] = @benchmarkable benchmark_plantbiophysics_multitimestep_ST($leaf, $meteo)

# "XPalm benchmark"
include("test-xpalm.jl")
suite[suite_name]["XPalm_setup"] = @benchmarkable xpalm_default_param_create() seconds = 120
SUITE[suite_name]["XPalm_setup"] = @benchmarkable xpalm_default_param_create() seconds = 120

palm, models, out_vars, meteo = xpalm_default_param_create()
sim_outputs = xpalm_default_param_run(palm, models, out_vars, meteo)

suite[suite_name]["XPalm_run"] = @benchmarkable xpalm_default_param_run($palm, $models, $out_vars, $meteo) seconds = 120
suite[suite_name]["XPalm_convert_outputs"] = @benchmarkable xpalm_default_param_convert_outputs($sim_outputs) seconds = 120
SUITE[suite_name]["XPalm_run"] = @benchmarkable xpalm_default_param_run($palm, $models, $out_vars, $meteo) seconds = 120
SUITE[suite_name]["XPalm_convert_outputs"] = @benchmarkable xpalm_default_param_convert_outputs($sim_outputs) seconds = 120

tune!(suite)
results = run(suite, verbose=true)
BenchmarkTools.save(dirname(@__FILE__) * "/output.json", median(results))
#tune!(SUITE)
#results = run(SUITE, verbose=true)
#BenchmarkTools.save(dirname(@__FILE__) * "/output.json", median(results))
File renamed without changes.
File renamed without changes.
Loading