Skip to content

Commit

Permalink
Merge pull request #73 from zjwegert/main
Browse files Browse the repository at this point in the history
Update compat branch
  • Loading branch information
zjwegert authored Nov 26, 2024
2 parents d9c20fb + ded39d8 commit 2fc1840
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GridapTopOpt"
uuid = "27dd0110-1916-4fd6-8b4b-1bc109db1170"
authors = ["Zach Wegert <[email protected]>", "JordiManyer <[email protected]>"]
version = "0.1.1"
version = "0.1.2"

[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Expand Down
16 changes: 8 additions & 8 deletions src/Benchmarks.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
benchmark(f, args, ranks; nreps, reset!)
Benchmark a function `f` that takes arguments `args`.
Benchmark a function `f` that takes arguments `args`.
In MPI mode, benchmark will always return the maximum CPU time across all ranks.
This behaviour can be changed by overwritting `process_timer`.
Expand All @@ -14,7 +14,7 @@ set `ranks = nothing`.
# Optional
- `nreps = 10`: Number of benchmark repetitions
- `reset!= (x...) -> nothing`: Function for resetting inital data (e.g., level-set function ``\\varphi``).
- `reset!= (x...) -> nothing`: Function for resetting inital data (e.g., level-set function ``\\varphi``).
"""
function benchmark(f, args, ranks::Nothing; nreps = 10, reset! = (x...) -> nothing)
t = zeros(Float64,nreps)
Expand Down Expand Up @@ -93,7 +93,7 @@ function benchmark_single_iteration(m::Optimiser,ranks; nreps = 10)
end

φ0 = copy(get_free_dof_values(m.φ0))
λ0 = copy(state.λ); Λ0 = copy(state.Λ)
λ0 = copy(state.λ); Λ0 = copy(state.Λ)
dL0 = copy(state.dL)
function opt_reset!(m::Optimiser)
u = get_free_dof_values(get_state(m.problem));
Expand All @@ -112,7 +112,7 @@ end
"""
benchmark_forward_problem(m::AbstractFEStateMap, φh, ranks; nreps)
Benchmark the forward FE solve given `m::AbstractFEStateMap` and a level-set
Benchmark the forward FE solve given `m::AbstractFEStateMap` and a level-set
function `φh`. See [`forward_solve!`](@ref) for input types.
"""
function benchmark_forward_problem(m::AbstractFEStateMap, φh, ranks; nreps = 10)
Expand All @@ -123,14 +123,14 @@ function benchmark_forward_problem(m::AbstractFEStateMap, φh, ranks; nreps = 10
u = get_free_dof_values(get_state(m));
fill!(u,zero(eltype(u)))
end
return benchmark(f, (m,φh), ranks; nreps)
return benchmark(f, (m,φh), ranks; nreps, reset!)
end

"""
benchmark_advection(stencil::LevelSetEvolution, φ0, v0, γ, ranks; nreps)
Benchmark solving the Hamilton-Jacobi evolution equation given a `stencil`,
level-set function `φ0`, velocity function `v0`, and time step coefficient `γ`.
level-set function `φ0`, velocity function `v0`, and time step coefficient `γ`.
See [`evolve!`](@ref) for input types.
"""
function benchmark_advection(stencil::LevelSetEvolution, φ0, v0, γ, ranks; nreps = 10)
Expand Down Expand Up @@ -183,7 +183,7 @@ end
"""
benchmark_hilbertian_projection_map(m::HilbertianProjectionMap, dV, C, dC, K, ranks; nreps)
Benchmark `update_descent_direction!` for `HilbertianProjectionMap` given a objective
Benchmark `update_descent_direction!` for `HilbertianProjectionMap` given a objective
sensitivity `dV`, constraint values C, constraint sensitivities `dC`, and stiffness
matrix `K` for the velocity-extension.
"""
Expand Down

0 comments on commit 2fc1840

Please sign in to comment.