Skip to content

Commit 64dee19

Browse files
authored
Merge pull request #403 from ksahlin/one-thread
Set default number of threads to 1
2 parents 11aaa5c + ddfae2b commit 64dee19

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Strobealign Changelog
22

3+
## development version
4+
5+
* #401: The default number of threads is now 1 instead of 3.
6+
37
## v0.13.0 (2024-03-04)
48

59
* #394: Added option `--aemb` (abundance estimation for metagenomic binning),

src/cmdline.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ CommandLineOptions parse_command_line_arguments(int argc, char **argv) {
1919
args::ActionFlag version(parser, "version", "Print version and exit", {"version"}, []() { throw Version(); });
2020

2121
// Threading
22-
args::ValueFlag<int> threads(parser, "INT", "Number of threads [3]", {'t', "threads"});
22+
args::ValueFlag<int> threads(parser, "INT", "Number of threads [1]", {'t', "threads"});
2323
args::ValueFlag<int> chunk_size(parser, "INT", "Number of reads processed by a worker thread at once [10000]", {"chunk-size"}, args::Options::Hidden);
2424

2525
args::Group io(parser, "Input/output:");

src/cmdline.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <utility>
77

88
struct CommandLineOptions {
9-
int n_threads { 3 };
9+
int n_threads { 1 };
1010
int chunk_size { 10000 };
1111

1212
// Input/output

src/main.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,14 @@ int run_strobealign(int argc, char **argv) {
316316

317317
std::vector<AlignmentStatistics> log_stats_vec(opt.n_threads);
318318

319-
logger.info() << "Running in " << (opt.is_SE ? "single-end" : "paired-end") << " mode" << std::endl;
319+
logger.info() << "Processing " << (opt.is_SE ? "single-end" : "paired-end") << " reads ";
320+
if (map_param.output_format == OutputFormat::PAF) {
321+
logger.info() << "in mapping-only mode ";
322+
}
323+
if (map_param.output_format == OutputFormat::Abundance) {
324+
logger.info() << "in abundance estimation mode ";
325+
}
326+
logger.info() << "using " << opt.n_threads << " thread" << (opt.n_threads != 1 ? "s" : "") << std::endl;
320327

321328
OutputBuffer output_buffer(out);
322329
std::vector<std::thread> workers;

0 commit comments

Comments
 (0)