Skip to content

Commit

Permalink
Merge pull request #403 from ksahlin/one-thread
Browse files Browse the repository at this point in the history
Set default number of threads to 1
  • Loading branch information
marcelm authored Mar 6, 2024
2 parents 11aaa5c + ddfae2b commit 64dee19
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Strobealign Changelog

## development version

* #401: The default number of threads is now 1 instead of 3.

## v0.13.0 (2024-03-04)

* #394: Added option `--aemb` (abundance estimation for metagenomic binning),
Expand Down
2 changes: 1 addition & 1 deletion src/cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CommandLineOptions parse_command_line_arguments(int argc, char **argv) {
args::ActionFlag version(parser, "version", "Print version and exit", {"version"}, []() { throw Version(); });

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

args::Group io(parser, "Input/output:");
Expand Down
2 changes: 1 addition & 1 deletion src/cmdline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <utility>

struct CommandLineOptions {
int n_threads { 3 };
int n_threads { 1 };
int chunk_size { 10000 };

// Input/output
Expand Down
9 changes: 8 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,14 @@ int run_strobealign(int argc, char **argv) {

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

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

OutputBuffer output_buffer(out);
std::vector<std::thread> workers;
Expand Down

0 comments on commit 64dee19

Please sign in to comment.