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
99c339a8
Commit
99c339a8
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
More detailed timers for the PM calculation.
parent
ed1fb797
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
src/mesh_gravity.c
+18
-5
18 additions, 5 deletions
src/mesh_gravity.c
with
20 additions
and
5 deletions
.gitignore
+
2
−
0
View file @
99c339a8
...
@@ -131,6 +131,8 @@ tests/testEOS
...
@@ -131,6 +131,8 @@ tests/testEOS
tests/testEOS*.txt
tests/testEOS*.txt
tests/testEOS*.png
tests/testEOS*.png
tests/testUtilities
tests/testUtilities
tests/testCosmology
tests/testOutputList
tests/testCbrt
tests/testCbrt
tests/testFormat.sh
tests/testFormat.sh
...
...
This diff is collapsed.
Click to expand it.
src/mesh_gravity.c
+
18
−
5
View file @
99c339a8
...
@@ -437,14 +437,20 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct space* s,
...
@@ -437,14 +437,20 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct space* s,
/* message("\n\n\n DENSITY"); */
/* message("\n\n\n DENSITY"); */
/* print_array(rho, N); */
/* print_array(rho, N); */
const
ticks
tic2
=
getticks
();
tic
=
getticks
();
/* Fourier transform to go to magic-land */
/* Fourier transform to go to magic-land */
fftw_execute
(
forward_plan
);
fftw_execute
(
forward_plan
);
if
(
verbose
)
message
(
"Forward Fourier transform took %.3f %s."
,
clocks_from_ticks
(
getticks
()
-
tic
),
clocks_getunit
());
/* frho now contains the Fourier transform of the density field */
/* frho now contains the Fourier transform of the density field */
/* frho contains NxNx(N/2+1) complex numbers */
/* frho contains NxNx(N/2+1) complex numbers */
tic
=
getticks
();
/* Some common factors */
/* Some common factors */
const
double
green_fac
=
-
1
.
/
(
M_PI
*
box_size
);
const
double
green_fac
=
-
1
.
/
(
M_PI
*
box_size
);
const
double
a_smooth2
=
4
.
*
M_PI
*
M_PI
*
r_s
*
r_s
/
(
box_size
*
box_size
);
const
double
a_smooth2
=
4
.
*
M_PI
*
M_PI
*
r_s
*
r_s
/
(
box_size
*
box_size
);
...
@@ -506,18 +512,25 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct space* s,
...
@@ -506,18 +512,25 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct space* s,
frho
[
0
][
0
]
=
0
.;
frho
[
0
][
0
]
=
0
.;
frho
[
0
][
1
]
=
0
.;
frho
[
0
][
1
]
=
0
.;
if
(
verbose
)
message
(
"Applying Green function took %.3f %s."
,
clocks_from_ticks
(
getticks
()
-
tic
),
clocks_getunit
());
tic
=
getticks
();
/* Fourier transform to come back from magic-land */
/* Fourier transform to come back from magic-land */
fftw_execute
(
inverse_plan
);
fftw_execute
(
inverse_plan
);
if
(
verbose
)
message
(
"Backwards Fourier transform took %.3f %s."
,
clocks_from_ticks
(
getticks
()
-
tic
),
clocks_getunit
());
/* rho now contains the potential */
/* rho now contains the potential */
/* This array is now again NxNxN real numbers */
/* This array is now again NxNxN real numbers */
/* Let's store it in the structure */
/* Let's store it in the structure */
mesh
->
potential
=
rho
;
mesh
->
potential
=
rho
;
if
(
verbose
)
message
(
"Fourier-space PM took %.3f %s."
,
clocks_from_ticks
(
getticks
()
-
tic2
),
clocks_getunit
());
/* message("\n\n\n POTENTIAL"); */
/* message("\n\n\n POTENTIAL"); */
/* print_array(potential, N); */
/* print_array(potential, 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