Skip to content
Snippets Groups Projects
Commit a186289d authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Already use the thread-parallel Green function calculation when using a mesh of size 32.

parent 0187cf30
Branches
Tags
1 merge request!1015Parallel green function
...@@ -463,8 +463,10 @@ void mesh_apply_Green_function(struct threadpool* tp, fftw_complex* frho, ...@@ -463,8 +463,10 @@ void mesh_apply_Green_function(struct threadpool* tp, fftw_complex* frho,
data.k_fac = M_PI / (double)N; data.k_fac = M_PI / (double)N;
/* Parallelize the Green function application using the threadpool /* Parallelize the Green function application using the threadpool
to split the x-axis loop over the threads. */ to split the x-axis loop over the threads.
if (N < 64) { The array is N x N x (N/2). We use the thread to each deal with
a range [i_min, i_max[ x N x (N/2) */
if (N < 32) {
mesh_apply_Green_function_mapper(frho, N, &data); mesh_apply_Green_function_mapper(frho, N, &data);
} else { } else {
threadpool_map(tp, mesh_apply_Green_function_mapper, frho, N, threadpool_map(tp, mesh_apply_Green_function_mapper, frho, N,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment