Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
b9403b81
Commit
b9403b81
authored
6 years ago
by
Matthieu Schaller
Committed by
Matthieu Schaller
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Reduce the gravity mesh over MPI before performing the FFT.
parent
97f98762
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!589
Mpi periodic gravity
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mesh_gravity.c
+15
-2
15 additions, 2 deletions
src/mesh_gravity.c
with
15 additions
and
2 deletions
src/mesh_gravity.c
+
15
−
2
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); */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment