Skip to content

Commit

Permalink
Correct multithreading jobs option
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Apr 4, 2022
1 parent b3ccade commit 143ac7d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions src/cmd/frequency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ frequency options:
an index already created. Note that a file handle
is opened for each job.
When set to '0', the number of jobs is set to the
number of CPUs detected divided by 3.
When set to '-1', the number of jobs is set to the
number of CPUs detected.
[default: 0]
Expand Down Expand Up @@ -201,8 +199,9 @@ impl Args {
}

fn njobs(&self) -> usize {
if self.flag_jobs == 0 {
util::num_cpus()
let num_cpus = util::num_cpus();
if self.flag_jobs == 0 || self.flag_jobs > num_cpus {
num_cpus
} else {
self.flag_jobs
}
Expand Down
7 changes: 3 additions & 4 deletions src/cmd/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ split options:
an index already created. Note that a file handle
is opened for each job.
When set to '0', the number of jobs is set to the
number of CPUs detected divided by 3.
When set to '-1', the number of jobs is set to the
number of CPUs detected.
[default: 0]
--filename <filename> A filename template to use when constructing
Expand Down Expand Up @@ -148,8 +146,9 @@ impl Args {
}

fn njobs(&self) -> usize {
if self.flag_jobs == 0 {
util::num_cpus()
let num_cpus = util::num_cpus();
if self.flag_jobs == 0 || self.flag_jobs > num_cpus {
num_cpus
} else {
self.flag_jobs
}
Expand Down
7 changes: 3 additions & 4 deletions src/cmd/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ stats options:
This works only when the given CSV has an index.
Note that a file handle is opened for each job.
When set to '0', the number of jobs is set to the
number of CPUs detected divided by 3.
When set to '-1', the number of jobs is set to the
number of CPUs detected.
[default: 0]
Expand Down Expand Up @@ -224,8 +222,9 @@ impl Args {
}

fn njobs(&self) -> usize {
if self.flag_jobs == 0 {
util::num_cpus()
let num_cpus = util::num_cpus();
if self.flag_jobs == 0 || self.flag_jobs > num_cpus {
num_cpus
} else {
self.flag_jobs
}
Expand Down

0 comments on commit 143ac7d

Please sign in to comment.