diff --git a/src/threadpool.c b/src/threadpool.c index d5fa6d10229246d1f687c0e17e62933e01699315..70bb1716d03df870edebaf72a7d5f045a8e2f3bd 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -149,7 +149,10 @@ static void threadpool_chomp(struct threadpool *tp, int tid) { if (chunk_size < 1) chunk_size = 1; /* A chunk cannot exceed INT_MAX, as we use int elements in map_function. */ - if (chunk_size > INT_MAX) chunk_size = INT_MAX; + if (chunk_size > INT_MAX) { + chunk_size = INT_MAX; +. message("chunking down to INT_MAX"); + } /* Get a chunk and check its size. */ size_t task_ind = atomic_add(&tp->map_data_count, chunk_size); @@ -321,7 +324,7 @@ void threadpool_map(struct threadpool *tp, threadpool_map_function map_function, tp->map_data_count = 0; if (chunk == threadpool_auto_chunk_size) { tp->map_data_chunk = - max((int)(N / (tp->num_threads * threadpool_default_chunk_ratio)), 1); + max((N / (tp->num_threads * threadpool_default_chunk_ratio)), 1); } else if (chunk == threadpool_uniform_chunk_size) { tp->map_data_chunk = threadpool_uniform_chunk_size; } else {