Benchmarking
GridapTopOpt.benchmark
— Functionbenchmark(f, args, ranks; nreps, reset!)
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
.
Important
The input ranks
allows the user to provide the MPI ranks, benchmark
will not function correctly in MPI mode if these are not supplied. In serial, set ranks = nothing
.
Optional
nreps = 10
: Number of benchmark repetitionsreset!= (x...) -> nothing
: Function for resetting inital data (e.g., level-set function $\varphi$).
Existing benchmark methods
GridapTopOpt.benchmark_optimizer
— Functionbenchmark_optimizer(m::Optimiser, niter, ranks; nreps)
Given an optimiser m
, benchmark niter
iterations.
GridapTopOpt.benchmark_single_iteration
— Functionbenchmark_single_iteration(m::Optimiser, ranks; nreps)
Given an optimiser m
, benchmark a single iteration after 0th iteration.
GridapTopOpt.benchmark_forward_problem
— Functionbenchmark_forward_problem(m::AbstractFEStateMap, φh, ranks; nreps)
Benchmark the forward FE solve given m::AbstractFEStateMap
and a level-set function φh
. See forward_solve!
for input types.
GridapTopOpt.benchmark_advection
— Functionbenchmark_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 γ
. See evolve!
for input types.
GridapTopOpt.benchmark_reinitialisation
— Functionbenchmark_reinitialisation(stencil::LevelSetEvolution, φ0, γ_reinit, ranks; nreps)
Benchmark solving the reinitialisation equation given a stencil
, level-set function φ0
, and time step coefficient γ
. See reinit!
for input types.
GridapTopOpt.benchmark_velocity_extension
— Functionbenchmark_velocity_extension(ext::VelocityExtension, v0, ranks; nreps)
Benchmark the Hilbertian velocity-extension method ext
given a RHS v0
. See project!
for input types.
GridapTopOpt.benchmark_hilbertian_projection_map
— Functionbenchmark_hilbertian_projection_map(m::HilbertianProjectionMap, dV, C, dC, K, ranks; nreps)
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.