Merge default walltime options with target-specific overrides
(
default: Option<&WalltimeOptions>,
target: Option<&WalltimeOptions>,
)
| 6 | |
| 7 | /// Merge default walltime options with target-specific overrides |
| 8 | fn merge_walltime_options( |
| 9 | default: Option<&WalltimeOptions>, |
| 10 | target: Option<&WalltimeOptions>, |
| 11 | ) -> exec_harness::walltime::WalltimeExecutionArgs { |
| 12 | let default_args = default.map(walltime_options_to_args); |
| 13 | let target_args = target.map(walltime_options_to_args); |
| 14 | |
| 15 | match (default_args, target_args) { |
| 16 | (None, None) => exec_harness::walltime::WalltimeExecutionArgs::default(), |
| 17 | (Some(d), None) => d, |
| 18 | (None, Some(t)) => t, |
| 19 | (Some(d), Some(t)) => exec_harness::walltime::WalltimeExecutionArgs { |
| 20 | warmup_time: t.warmup_time.or(d.warmup_time), |
| 21 | max_time: t.max_time.or(d.max_time), |
| 22 | min_time: t.min_time.or(d.min_time), |
| 23 | max_rounds: t.max_rounds.or(d.max_rounds), |
| 24 | min_rounds: t.min_rounds.or(d.min_rounds), |
| 25 | }, |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | /// Convert project config WalltimeOptions to exec-harness WalltimeExecutionArgs |
| 30 | fn walltime_options_to_args( |
no outgoing calls