Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
a186289d
Commit
a186289d
authored
Dec 17, 2019
by
Matthieu Schaller
Browse files
Already use the thread-parallel Green function calculation when using a mesh of size 32.
parent
0187cf30
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/mesh_gravity.c
View file @
a186289d
...
...
@@ -463,8 +463,10 @@ void mesh_apply_Green_function(struct threadpool* tp, fftw_complex* frho,
data
.
k_fac
=
M_PI
/
(
double
)
N
;
/* Parallelize the Green function application using the threadpool
to split the x-axis loop over the threads. */
if
(
N
<
64
)
{
to split the x-axis loop over the threads.
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
);
}
else
{
threadpool_map
(
tp
,
mesh_apply_Green_function_mapper
,
frho
,
N
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment