Skip to content

Commit

Permalink
Merge pull request #587 from tjhei/gwb-grid-default-parallel
Browse files Browse the repository at this point in the history
gwb-grid: use threads by default
  • Loading branch information
MFraters authored Feb 14, 2024
2 parents d5ef343 + 5b4176c commit 0cd9575
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"
<< " -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 0cd9575

Please sign in to comment.