Skip to content

Commit f65a151

Browse files
authored
Merge pull request #17 from MultiSimOLab/bench-ci
[Step 2/3] Added benchmark to CI
2 parents 66fd53d + d58446c commit f65a151

9 files changed

Lines changed: 26 additions & 60 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://astroautomata.com/AirspeedVelocity.jl/stable/
2+
3+
name: Benchmark
4+
5+
on: [pull_request, workflow_dispatch]
6+
7+
permissions:
8+
pull-requests: write # need to post comments
9+
10+
jobs:
11+
bench:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: MilesCranmer/AirspeedVelocity.jl@action-v1
15+
with:
16+
julia-version: '1'

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "1.0.0-DEV"
66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
88
AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a"
9-
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
109
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
1110
DrWatson = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1"
1211
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
@@ -24,6 +23,5 @@ Profile = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"
2423
ProfileView = "c46f51b8-102a-5cf2-8d2c-8597cb0e0da7"
2524
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
2625
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
27-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2826
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
2927
WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"

test/Project.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[deps]
2+
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
3+
Gridap = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
4+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
5+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
6+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

test/TestConstitutiveModels/PhysicalModels.jl

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ using JSON
44
using StaticArrays
55
using Test
66
using HyperFEM.PhysicalModels
7-
using BenchmarkTools
87

98

109
import Base: -
@@ -39,31 +38,6 @@ function test_derivatives_3D_(model::PhysicalModel; rtol=1e-14, kwargs...)
3938
end
4039

4140

42-
function benchmark_derivatives__(model::PhysicalModel, ∇u)
43-
Ψ, ∂Ψu, ∂Ψuu = model()
44-
∂Ψu_(F) = TensorValue(ForwardDiff.gradient(Ψ, get_array(F)))
45-
∂Ψuu_(F) = TensorValue(ForwardDiff.hessian(Ψ, get_array(F)))
46-
47-
F, _, _ = get_Kinematics(model.Kinematic)
48-
print("Analyitical ∂Ψu | ")
49-
@btime $∂Ψu($F($∇u))
50-
print("Numerical ∂Ψu | ")
51-
@btime $∂Ψu_($F($∇u))
52-
print("Analyitical ∂Ψuu | ")
53-
@btime $∂Ψuu($F($∇u))
54-
print("Numerical ∂Ψuu | ")
55-
@btime $∂Ψuu_($F($∇u))
56-
end
57-
58-
function benchmark_derivatives_2D_(model::PhysicalModel)
59-
benchmark_derivatives__(model, ∇u2)
60-
end
61-
62-
function benchmark_derivatives_3D_(model::PhysicalModel)
63-
benchmark_derivatives__(model, ∇u3)
64-
end
65-
66-
6741
@testset "NonlinearMooneyRivlin_CV" begin
6842
model = NonlinearMooneyRivlin_CV=3.0, μ1=1.0, μ2=1.0, α=2.0, β=1.0, γ=6.0)
6943
test_derivatives_3D_(model, rtol=1e-13)

test/TestConstitutiveModels/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using HyperFEM
22

3-
@testset "ConstitutiveModels" verbose = true begin
3+
@testset "ConstitutiveModels" begin
44

55
@time begin
66
include("PhysicalModels.jl")

test/TestTensorAlgebra/TensorAlgebra.jl

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ using Gridap.TensorValues
22
using Gridap.Arrays
33
using HyperFEM.TensorAlgebra
44
using Test
5-
using BenchmarkTools
65

76

87
@testset "Jacobian regularization" begin
@@ -31,21 +30,6 @@ end
3130
end
3231

3332

34-
# @benchmark (A ⊗₁₃²⁴ B)
35-
# @benchmark (A ⊗₁₂³ V1)
36-
# @benchmark (A ⊗₁₃² V1)
37-
# @benchmark (V1 ⊗₁²³ A)
38-
# @benchmark (A ⊗₁₃²⁴ B)
39-
# @benchmark (D × A)
40-
41-
# @code_warntype (A ⊗₁₃²⁴ B)
42-
# @code_warntype (A ⊗₁₂³ V1)
43-
# @code_warntype (A ⊗₁₃² V1)
44-
# @code_warntype (V1 ⊗₁²³ A)
45-
# @code_warntype (A ⊗₁₃²⁴ B)
46-
# @code_warntype (D × A)
47-
48-
4933
@testset "cross" begin
5034
A = TensorValue(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0) * 1e-3
5135
B = TensorValue(4.6, 2.1, 1.7, 3.2, 6.5, 1.4, 9.2, 8.0, 9.0) * 1e-3
@@ -106,10 +90,6 @@ end
10690
@test I3_ == I3
10791
@test I4_ == I4
10892
@test I9_ == I9
109-
# @benchmark I2_
110-
# @benchmark I2
111-
# @benchmark I9_
112-
# @benchmark I9
11393
end
11494

11595

test/TestTensorAlgebra/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testset "TensorAlgebra" verbose = true begin
1+
@testset "TensorAlgebra" begin
22

33
@time begin
44
include("TensorAlgebra.jl")

test/TestWeakForms/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testset "WeakForms" verbose = true begin
1+
@testset "WeakForms" begin
22

33
@time begin
44
include("WeakForms.jl")

test/runtests.jl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
using HyperFEM
22
using Test
3-
using Profile
4-
using Gridap, GridapGmsh, GridapSolvers, DrWatson, TimerOutputs
5-
using GridapSolvers.NonlinearSolvers
6-
using Gridap.FESpaces
7-
using Gridap.CellData
8-
using Gridap.TensorValues
9-
using HyperFEM: jacobian, IterativeSolver, solve!
10-
using BenchmarkTools
3+
using Gridap
114

125

136
@testset "HyperFEMTests" verbose = true begin
@@ -23,4 +16,3 @@ using BenchmarkTools
2316
end
2417

2518
end;
26-

0 commit comments

Comments
 (0)