Fix own mistake in rBd617de965ea20e5d5 from late December 2015.
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 10 May 2016 10:52:44 +0000 (12:52 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 10 May 2016 11:10:21 +0000 (13:10 +0200)
Brain melt here, intention was to reduce number of tasks in case we have not much chunks of data to loop over,
not to increase it!

Note that this only affected dynamic scheduling.

source/blender/blenlib/intern/task.c

index 9fefd715d767c52e9c2284c148c250099ddc0ea7..b47931cdde9043ed1e8d43390c4d1afdf311c4ea 100644 (file)
@@ -914,7 +914,7 @@ static void task_parallel_range_ex(
                state.chunk_size = max_ii(1, (stop - start) / (num_tasks));
        }
 
-       num_tasks = max_ii(1, (stop - start) / state.chunk_size);
+       num_tasks = min_ii(num_tasks, (stop - start) / state.chunk_size);
 
        for (i = 0; i < num_tasks; i++) {
                BLI_task_pool_push(task_pool,