Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gwb-grid: use threads by default #587

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
<< "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
Loading