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

Use fftw_alloc_real() instead of the specialized types in the FFT task. The...

Use fftw_alloc_real() instead of the specialized types in the FFT task. The specialized ones are not available in early versions of FFTW 3.x
parent 7a885c3b
Branches
Tags
1 merge request!393Periodic gravity speed and accuracy improvements
...@@ -179,11 +179,12 @@ void runner_do_grav_fft(struct runner* r, int timer) { ...@@ -179,11 +179,12 @@ void runner_do_grav_fft(struct runner* r, int timer) {
// error("Top-level multipole %d not drifted", i); // error("Top-level multipole %d not drifted", i);
/* Allocates some memory for the density mesh */ /* Allocates some memory for the density mesh */
double* restrict rho = fftw_alloc_real(N * N * N); double* restrict rho = fftw_malloc(sizeof(double) * N * N * N);
if (rho == NULL) error("Error allocating memory for density mesh"); if (rho == NULL) error("Error allocating memory for density mesh");
/* Allocates some memory for the mesh in Fourier space */ /* Allocates some memory for the mesh in Fourier space */
fftw_complex* restrict frho = fftw_alloc_complex(N * N * (N_half + 1)); fftw_complex* restrict frho =
fftw_malloc(sizeof(fftw_complex) * N * N * (N_half + 1));
if (frho == NULL) if (frho == NULL)
error("Error allocating memory for transform of density mesh"); error("Error allocating memory for transform of density mesh");
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment