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
b9403b81
Commit
b9403b81
authored
Aug 08, 2018
by
Matthieu Schaller
Committed by
Matthieu Schaller
Aug 10, 2018
Browse files
Reduce the gravity mesh over MPI before performing the FFT.
parent
97f98762
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/mesh_gravity.c
View file @
b9403b81
...
...
@@ -314,7 +314,7 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct space* s,
fftw_plan
inverse_plan
=
fftw_plan_dft_c2r_3d
(
N
,
N
,
N
,
frho
,
rho
,
FFTW_ESTIMATE
|
FFTW_DESTROY_INPUT
);
const
ticks
tic
=
getticks
();
ticks
tic
=
getticks
();
/* Zero everything */
bzero
(
rho
,
N
*
N
*
N
*
sizeof
(
double
));
...
...
@@ -324,9 +324,22 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct space* s,
gpart_to_mesh_CIC
(
&
s
->
gparts
[
i
],
rho
,
N
,
cell_fac
,
dim
);
if
(
verbose
)
message
(
"
g
part assignment took %.3f %s."
,
message
(
"
G
part assignment took %.3f %s."
,
clocks_from_ticks
(
getticks
()
-
tic
),
clocks_getunit
());
#ifdef WITH_MPI
MPI_Barrier
(
MPI_COMM_WORLD
);
tic
=
getticks
();
/* Merge everybody's share of the density mesh */
MPI_Allreduce
(
MPI_IN_PLACE
,
rho
,
N
*
N
*
N
,
MPI_DOUBLE
,
MPI_SUM
,
MPI_COMM_WORLD
);
if
(
verbose
)
message
(
"Mesh comunication took %.3f %s."
,
clocks_from_ticks
(
getticks
()
-
tic
),
clocks_getunit
());
#endif
/* message("\n\n\n DENSITY"); */
/* print_array(rho, 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