cyto_cli/map/
runtime.rs

1use clap::Parser;
2
3#[derive(Debug, Clone, Copy, Parser)]
4#[clap(next_help_heading = "Runtime Options")]
5pub struct RuntimeOptions {
6    /// Number of threads to use
7    ///
8    /// If 0, the number of threads will be set to the maximum number of threads.
9    #[clap(short = 'T', long, default_value = "8")]
10    pub num_threads: usize,
11
12    /// Output runtime information
13    #[clap(short, long)]
14    pub verbose: bool,
15}
16impl RuntimeOptions {
17    pub fn num_threads(&self) -> usize {
18        if self.num_threads == 0 {
19            num_cpus::get()
20        } else {
21            self.num_threads
22        }
23    }
24}