diff options
author | Thomas White <taw@physics.org> | 2011-06-17 16:13:20 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:29 +0100 |
commit | dd2f61f090793c1f41e091b9bc86e3bcb88bc525 (patch) | |
tree | be8f42c4891d4bbd18711417bf1dab4adcb33d03 /src | |
parent | 65d8b1ac000bba28ed3139a82adba6c80f29e34b (diff) |
Count properly
Diffstat (limited to 'src')
-rw-r--r-- | src/partialator.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/partialator.c b/src/partialator.c index aa4a5c8c..31c17f63 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -143,8 +143,11 @@ static void refine_all(struct image *images, int n_total_patterns, qargs.n_total_patterns = n_total_patterns; qargs.images = images; + /* Don't have threads which are doing nothing */ + if ( n_total_patterns > nthreads ) nthreads = n_total_patterns; + run_threads(nthreads, refine_image, get_image, done_image, - &qargs, n_total_patterns-1, 0, 0, 0); + &qargs, n_total_patterns, 0, 0, 0); } |