Skip to content

Commit

Permalink
gwb-grid: use threads by default
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhei committed Feb 14, 2024
1 parent 30ae879 commit 5b4176c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/gwb-grid/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ int main(int argc, char **argv)
double z_min = NaN::DSNAN; // z or inner_radius
double z_max = NaN::DSNAN; // z or outer_radius

size_t number_of_threads = 1;
// Conservative choice for the number of threads to use:
size_t number_of_threads = std::min(20u,1+std::thread::hardware_concurrency()/2);

try
{
Expand All @@ -268,7 +269,7 @@ int main(int argc, char **argv)
<< "Usage:\n"
<< argv[0] << " [-j N] example.wb example.grid\n\n"
<< "Other available options:\n"
<< " -j N to specify the number of threads the visualizer is allowed to use. Default: 1.\n"
<< " -j N to specify the number of threads the visualizer is allowed to use. Default: " << number_of_threads << ".\n"

Check warning on line 272 in source/gwb-grid/main.cc

View check run for this annotation

Codecov / codecov/patch

source/gwb-grid/main.cc#L272

Added line #L272 was not covered by tests
<< " -h or --help to get this help screen.\n"
<< " -v or --version to see version information.\n";
return 0;
Expand Down

0 comments on commit 5b4176c

Please sign in to comment.