Benchmarking

GridapTopOpt.benchmarkFunction
benchmark(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 repetitions
  • reset!= (x...) -> nothing: Function for resetting inital data (e.g., level-set function $\varphi$).
source

Existing benchmark methods

GridapTopOpt.benchmark_advectionFunction
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 γ. See evolve! for input types.

source
GridapTopOpt.benchmark_reinitialisationFunction
benchmark_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.

source
GridapTopOpt.benchmark_hilbertian_projection_mapFunction
benchmark_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.

source