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

More detailed timers for the PM calculation.

parent ed1fb797
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
...@@ -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); */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment