MCPcopy Create free account
hub / github.com/Open-Quant/openquant / validate_config

Function validate_config

crates/openquant/src/hpc_parallel.rs:440–453  ·  view source on GitHub ↗
(cfg: HpcParallelConfig)

Source from the content-addressed store, hash-verified

438}
439
440fn validate_config(cfg: HpcParallelConfig) -> Result<(), HpcParallelError> {
441 if cfg.mp_batches == 0 {
442 return Err(HpcParallelError::InvalidConfig("mp_batches must be > 0"));
443 }
444 if cfg.progress_every == 0 {
445 return Err(HpcParallelError::InvalidConfig("progress_every must be > 0"));
446 }
447 if let ExecutionMode::Threaded { num_threads } = cfg.mode {
448 if num_threads == 0 {
449 return Err(HpcParallelError::InvalidConfig("num_threads must be > 0"));
450 }
451 }
452 Ok(())
453}
454
455fn default_threads() -> usize {
456 thread::available_parallelism().map_or(1, |n| n.get().max(1))

Callers 1

run_parallelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected