Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update compat branch #73

Merged
merged 5 commits into from
Nov 26, 2024
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
12 changes: 6 additions & 6 deletions 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 All @@ -23,17 +23,17 @@ SparseMatricesCSR = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1"

[compat]
BenchmarkTools = "1"
BlockArrays = "0.16"
BlockArrays = "1"
ChainRulesCore = "1"
CircularArrays = "1"
FillArrays = "0.8.4,1"
FillArrays = "1"
Gridap = "0.18"
GridapDistributed = "0.4"
GridapPETSc = "0.5"
GridapSolvers = "0.3"
GridapSolvers = "0.4"
JLD2 = "0.4"
MPI = "0.19, 0.20"
PartitionedArrays = "0.3"
MPI = "0.16, 0.17, 0.18, 0.19, 0.20"
PartitionedArrays = "0.3.3"
SparseMatricesCSR = "0.6.6"
julia = "1.6.7"

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
Loading