Batch Benchmark Execution

EarthBox.BenchmarksManager.run_benchmarksFunction
run_benchmarks(
    test_dict::OrderedDict{Symbol, Bool};
    mumps_solver_dict::Union{Dict{Symbol, Vector{Any}}, Nothing} = nothing,
    kwargs...
)::Benchmarks

Run the benchmarks specified in the test_dict.

Arguments

  • test_dict::OrderedDict{Symbol, Bool}:
    • Dictionary of benchmarks to run. The key is the benchmark name and the value is a boolean indicating if the benchmark should be run.
  • mumps_solver_dict::Union{Dict{Symbol, Vector{Any}}, Nothing} = nothing:
    • Dictionary of benchmarks to run with MUMPS solver. The key is the benchmark name and the value is a vector of two elements. The first element is a boolean indicating if the benchmark should be run with MUMPS solver and the second element is the number of processors to use.

Optional Keyword Arguments:

  • run_model::Bool:
    • Set to true to run the model. Default is true.
  • run_post_processing::Bool:
    • Set to true to run post processing. Default is true.
  • base_path::String:
    • Base path for the output directory. EarthBox creates a time-stamped subdirectory in this path. Default is the present working directory (pwd()).
  • old_date_stamp::String:
    • Old date stamp for the output directory. If equal to nothing, a new date stamp will be generated. If a old time stamp is provided, the output directory will use the old time stamp. This is useful if you want to re-run post processing on a previous run. The format of the time stamp is YYYY-MM-DDHH-MM-SS. For example: "2024-04-2012-53-59". Default is nothing.
  • make_backup::Bool:
    • Set to true to make backup model files with each output step. This is useful for testing model restart functionality. Default is false.
  • restart_from_backup::Bool:
    • Set to true to restart from a backup file. Default is false.

Returns

  • Nothing

Returns

  • bench::Benchmarks:
    • Benchmarks object containing the results of the benchmarks.
source

Example: Running Multiple "Fast" Benchmark Cases

This example shows how multiple benchmarks can be run in batch mode with output being sent to the present working directory. Check terminal output for a quick look at test results and for the path to where results were written to file.


using DataStructures: OrderedDict
using EarthBox

test_dict = OrderedDict(
    benchmark_names.couette_flow_viscous_heating        => true,
    benchmark_names.channel_flow_non_newtonian          => true,
    benchmark_names.channel_flow_variable_conductivity  => true,
    benchmark_names.channel_flow_non_steady_temperature => true,
    benchmark_names.solid_body_rotation                 => true,
    benchmark_names.rayleigh_taylor_instability         => true,
);
BenchmarksManager.run_benchmarks(test_dict);

This code will produce an output directory with a time-stamped name like earthbox_benchmark_results_2025-11-07_08-48-04 that contains model output, benchmark plots and a summary file of test results called test_results.yml.

Example: Running Multiple Benchmark Cases with User Configuration

This example shows how multiple benchmarks can be run in batch mode with control over model execution, post processing, output base path and the use of the MUMPS solver.


using DataStructures: OrderedDict
using EarthBox

benchmark_names = BenchmarksManager.benchmark_names
test_dict = OrderedDict(
    benchmark_names.couette_flow_viscous_heating                          => true,
    benchmark_names.channel_flow_non_newtonian                            => true,
    benchmark_names.channel_flow_variable_conductivity                    => true,
    benchmark_names.channel_flow_non_steady_temperature                   => true,
    benchmark_names.solid_body_rotation                                   => true,
    benchmark_names.rayleigh_taylor_instability                           => true,
    benchmark_names.elastic_slab                                          => true,
    benchmark_names.viscoelastic_stress_buildup                           => true,
    benchmark_names.box_convection_isoviscous_1a                          => true,
    benchmark_names.plasticity_benchmark_kaus10                           => true,
    benchmark_names.viscoelastic_extension                                => false,
    benchmark_names.viscoelastic_extension_asymmetric                     => false,
    benchmark_names.viscoelastic_extension_depth_dependent                => false,
    benchmark_names.viscoelastic_extension_inflow_and_outflow_along_sides => false,
    benchmark_names.viscoelastic_contraction                              => false,
    benchmark_names.viscoelastic_contraction_asymmetric                   => false,
    benchmark_names.simple_sedimentation                                  => false,
    benchmark_names.seafloor_spreading                                    => false,
    benchmark_names.flexure_triangular_hole                               => true
)
# Dictionary used to activate the mumps solver for large models
# For each dictionary key the value is a vector with two elements:
# [1] Bool: Activate/deactivate mumps solver
# [2] Int: Number of processors to use
mumps_solver_dict = Dict{Symbol, Vector{Any}}(
    benchmark_names.flexure_triangular_hole => [true, 8]
)
BenchmarksManager.run_benchmarks(
    test_dict,
    mumps_solver_dict   = mumps_solver_dict,
    run_model           = true,
    run_post_processing = true,
    base_path           = "/mnt/extradrive1",
    make_backup         = false,
    restart_from_backup = false
)