An automation tool for executing parametric measurement series with rusty_fluid_solver.
rusty_measurement_runner automates the execution of rusty_fluid_solver across a predefined set of simulation parameter combinations. It reads a measurement configuration file, either generates all parameter permutations or zips all parameter lists, and runs the solver for each combination — collecting .csv measurement outputs into a destination folder.
This is useful for:
- Parameter sweeps (e.g. varying viscosity, particle spacing, time step size)
- Generating reproducible measurement series for analysis
- Batch simulation runs without manual intervention
- Parse measurement config (.csv / .toml)
- Zip parameters or compute cartesian product of parameter combinations
- For each combination:
- Patch the scene config file with current parameters
- Write a temporary config file
- Spawn rusty_fluid_solver as a subprocess
- Stream solver output to terminal
- Collect .csv measurement results
- Clean up temporary files
measurement_destination_folder/
├── measurement_config_copy.toml # Copy of the measurement config
├── scene_config_copy.toml # Copy of the original scene config
├── paramA_val1_paramB_val1.csv # Measurement for combination 1
├── paramA_val1_paramB_val2.csv # Measurement for combination 2
├── paramA_val2_paramB_val1.csv # Measurement for combination 3
└── ...
Output filenames are automatically generated from the parameter names and values (sorted alphabetically), e.g. viscosity_0.01_particle_spacing_0.02.csv.
cargo run --release -p rusty_measurement_runner -- [OPTIONS] <MEASUREMENT_FILE>| Argument | Description |
|---|---|
measurement_file |
Path to the measurement configuration file |
| Option | Short | Description |
|---|---|---|
--exit |
-e |
Automatically exit each solver run when the measurement is finished and proceed to the next |
--log <LEVEL> |
-l |
Log severity: TRACE, DEBUG, INFO, WARN, ERROR, OFF (default: INFO) |
# Run a full measurement series with auto-exit
cargo run --release -p rusty_measurement_runner -- measurements.toml --exit
# Run interactively (manually close each solver window to proceed)
cargo run --release -p rusty_measurement_runner -- measurements.toml
# With debug logging
cargo run --release -p rusty_measurement_runner -- measurements.toml --exit --log DEBUGThe measurement configuration file defines:
- General settings — paths, time range, executable location
- Parameter series — which parameters to vary and their values
| Section | Field | Description |
|---|---|---|
general |
config_file |
Path to the base scene configuration .toml file |
general |
executable |
Path to the rusty_fluid_solver binary |
general |
measurement_destination_file_path |
Output folder for results |
general |
start_time |
Simulation time at which measurement begins |
general |
finish_time |
Simulation time at which measurement ends |
general |
state_file |
(Optional) Path to a saved state file to resume from |
parameters |
<param_name> |
List of values to sweep for each parameter, <param_name> can be any field from parameters in the fluid simulations configuration |
[general]
config_file = "scene_config.toml"
executable = "./target/release/rusty_fluid_solver"
measurement_destination_file_path = "output/measurements/"
start_time = 0.0
finish_time = 5.0
state_file = ""
[operation]
type = "Cartesian" # Zip, Cartesian
[parameters]
viscosity = [0.01, 0.05, 0.1]
time_increment = [0.005, 0.01]This configuration produces 3 × 2 = 6 simulation runs, one for each combination of viscosity and time_increment.
- Parameter validation — The runner verifies that each parameter listed in the measurement config exists in the scene config file. If a parameter is not found, the program panics with a descriptive error.
- File preservation — Both the measurement config and the original scene config are copied to the destination folder for reproducibility.
- Temporary files — A temporary patched config file is created during execution and cleaned up after all measurements complete.
- Progress tracking — A progress bar (
indicatif) shows overall completion status and estimated time remaining. - Solver output — stdout from each
rusty_fluid_solverinvocation is streamed above the progress bar.
This tool is a companion program — it does not contain simulation logic itself. It orchestrates multiple runs of rusty_fluid_solver by:
- Modifying the scene config's
[parameters]section for each combination - Passing appropriate CLI flags (
-m,-s,-f,-r,-e,--state) - Collecting the resulting
.csvmeasurement files in one location
This tool is the first step in the measurement pipeline:
rusty_fluid_solver ──► .csv measurement files ──► rusty_plotter ──► plots (.png / .svg)
▲
│
rusty_measurement_runner
rusty_fluid_solverruns a simulation and exports measurements to.csvrusty_measurement_runnerautomates parameter sweeps → multiple.csvfilesrusty_plotterreads the.csvfolder → generates comparison plots
| Crate | Purpose |
|---|---|
clap |
CLI argument parsing |
toml |
Scene config parsing and patching |
tracing / tracing-subscriber |
Structured logging |
indicatif |
Progress bar display |
std::process::Command |
Subprocess management for solver invocation |