(git:e70887f)
Loading...
Searching...
No Matches
fft_lib_fftw.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------------*/
2/* CP2K: A general program to perform molecular dynamics simulations */
3/* Copyright 2000-2026 CP2K developers group <https://cp2k.org> */
4/* */
5/* SPDX-License-Identifier: BSD-3-Clause */
6/*----------------------------------------------------------------------------*/
7#ifndef FFT_LIB_FFTW_H
8#define FFT_LIB_FFTW_H
9
10#include "../mpiwrap/cp_mpi.h"
11
12// We include this first to require FFTW to use C complex numbers
13#include <complex.h>
14
15#if defined(__FFTW3)
16#include <fftw3.h>
17typedef fftw_iodim fft_iodim;
18#else
19typedef struct {
20 int n;
21 int is;
22 int os;
23} fft_iodim;
24#endif
25#include <stdbool.h>
26
33
34/*******************************************************************************
35 * \brief Initialize the FFT library (if not done externally).
36 * \author Frederick Stein, Ole Schuett
37 ******************************************************************************/
38int fft_fftw_init_lib(const fftw_plan_type fftw_planning_flag,
39 const bool use_guru_interface, const char *wisdom_file);
40
41/*******************************************************************************
42 * \brief Finalize the FFT library (if not done externally).
43 * \author Frederick Stein, Ole Schuett
44 ******************************************************************************/
45void fft_fftw_finalize_lib(const char *wisdom_file);
46
47/*******************************************************************************
48 * \brief Whether a distributed FFT implementation is available.
49 * \author Frederick Stein
50 ******************************************************************************/
52
53/*******************************************************************************
54 * \brief Whether the guru interface is available.
55 * \author Frederick Stein
56 ******************************************************************************/
58
59/*******************************************************************************
60 * \brief Allocate buffer of type double.
61 * \author Frederick Stein
62 ******************************************************************************/
63void fft_fftw_allocate_double(const int length, double **buffer);
64
65/*******************************************************************************
66 * \brief Allocate buffer of type double complex.
67 * \author Frederick Stein
68 ******************************************************************************/
69void fft_fftw_allocate_complex(const int length, double complex **buffer);
70
71/*******************************************************************************
72 * \brief Free buffer of type double.
73 * \author Frederick Stein
74 ******************************************************************************/
75void fft_fftw_free_double(double *buffer);
76
77/*******************************************************************************
78 * \brief Free buffer of type double complex.
79 * \author Frederick Stein
80 ******************************************************************************/
81void fft_fftw_free_complex(double complex *buffer);
82
83/*******************************************************************************
84 * \brief Performs a local C2C 1D FFT.
85 * \author Frederick Stein
86 ******************************************************************************/
88 const bool direction, const int fft_size, const int number_of_ffts,
89 const bool transpose_in, const bool transpose_out,
90 const int leading_dimension_in, const int leading_dimension_out,
91 double complex *grid_in, double complex *grid_out);
92
93/*******************************************************************************
94 * \brief Performs a local forward R2C FFT.
95 * \author Frederick Stein
96 ******************************************************************************/
98 const int fft_size, const int number_of_ffts, const bool transpose_in,
99 const bool transpose_out, const int leading_dimension_in,
100 const int leading_dimension_out, double *grid_in, double complex *grid_out);
101
102/*******************************************************************************
103 * \brief Performs a local backwards C2R 1D FFT
104 * \author Frederick Stein
105 ******************************************************************************/
107 const int fft_size, const int number_of_ffts, const bool transpose_in,
108 const bool transpose_out, const int leading_dimension_in,
109 const int leading_dimension_out, double complex *grid_in, double *grid_out);
110
111/*******************************************************************************
112 * \brief Performs a local C2C 2D FFT
113 * \author Frederick Stein
114 ******************************************************************************/
115void fft_fftw_register_2d_local(const bool direction, const int fft_size[2],
116 const int number_of_ffts,
117 const bool transpose_in,
118 const bool transpose_out,
119 double complex *grid_in,
120 double complex *grid_out);
121
122/*******************************************************************************
123 * \brief Performs a local forward R2C 2D FFT.
124 * \author Frederick Stein
125 ******************************************************************************/
126void fft_fftw_register_2d_r2c_local(const int fft_size[2],
127 const int number_of_ffts,
128 const bool transpose_in,
129 const bool transpose_out, double *grid_in,
130 double complex *grid_out);
131
132/*******************************************************************************
133 * \brief Performs a local backwards C2R 2D FFT.
134 * \author Frederick Stein
135 ******************************************************************************/
136void fft_fftw_register_2d_c2r_local(const int fft_size[2],
137 const int number_of_ffts,
138 const bool transpose_in,
139 const bool transpose_out,
140 double complex *grid_in, double *grid_out);
141
142/*******************************************************************************
143 * \brief Performs a local C2C 3D FFT.
144 * \author Frederick Stein
145 ******************************************************************************/
146void fft_fftw_register_guru(const bool direction, int rank,
147 const fft_iodim *dims, int howmany_rank,
148 const fft_iodim *howmany_dims,
149 const int number_of_threads,
150 double complex *grid_in, double complex *grid_out);
151
152/*******************************************************************************
153 * \brief Performs a local forward R2C 3D FFT.
154 * \author Frederick Stein
155 ******************************************************************************/
156void fft_fftw_register_r2c_guru(int rank, const fft_iodim *dims,
157 int howmany_rank, const fft_iodim *howmany_dims,
158 const int number_of_threads, double *grid_in,
159 double complex *grid_out);
160
161/*******************************************************************************
162 * \brief Performs a local backwards R2C 3D FFT.
163 * \author Frederick Stein
164 ******************************************************************************/
165void fft_fftw_register_c2r_guru(int rank, const fft_iodim *dims,
166 int howmany_rank, const fft_iodim *howmany_dims,
167 const int number_of_threads,
168 double complex *grid_in, double *grid_out);
169
170/*******************************************************************************
171 * \brief Performs a local C2C 3D FFT.
172 * \author Frederick Stein
173 ******************************************************************************/
174void fft_fftw_register_3d_local(const bool direction, const int fft_size[3],
175 const int number_of_ffts,
176 const bool transpose_in,
177 const bool transpose_out,
178 double complex *grid_in,
179 double complex *grid_out);
180
181/*******************************************************************************
182 * \brief Performs a local forward R2C 3D FFT.
183 * \author Frederick Stein
184 ******************************************************************************/
185void fft_fftw_register_3d_r2c_local(const int fft_size[3],
186 const int number_of_ffts,
187 const bool transpose_in,
188 const bool transpose_out, double *grid_in,
189 double complex *grid_out);
190
191/*******************************************************************************
192 * \brief Performs a local backwards R2C 3D FFT.
193 * \author Frederick Stein
194 ******************************************************************************/
195void fft_fftw_register_3d_c2r_local(const int fft_size[3],
196 const int number_of_ffts,
197 const bool transpose_in,
198 const bool transpose_out,
199 double complex *grid_in, double *grid_out);
200
201/*******************************************************************************
202 * \brief Performs a distributed C2C 2D FFT.
203 * \author Frederick Stein
204 ******************************************************************************/
205void fft_fftw_register_2d_distributed(const bool direction,
206 const int npts_global[2],
207 const int number_of_ffts,
208 const cp_mpi_comm_t comm,
209 double complex *grid_in,
210 double complex *grid_out);
211
212/*******************************************************************************
213 * \brief Performs a distributed forward R2C 2D FFT.
214 * \author Frederick Stein
215 ******************************************************************************/
216void fft_fftw_register_2d_r2c_distributed(const int npts_global[2],
217 const int number_of_ffts,
218 const cp_mpi_comm_t comm,
219 double *grid_in,
220 double complex *grid_out);
221
222/*******************************************************************************
223 * \brief Performs a distributed backwards C2R 2D FFT.
224 * \author Frederick Stein
225 ******************************************************************************/
226void fft_fftw_register_2d_c2r_distributed(const int npts_global[2],
227 const int number_of_ffts,
228 const cp_mpi_comm_t comm,
229 double complex *grid_in,
230 double *grid_out);
231
232/*******************************************************************************
233 * \brief Performs a distributed C2C 3D FFT.
234 * \author Frederick Stein
235 ******************************************************************************/
236void fft_fftw_register_3d_distributed(const bool direction,
237 const int npts_global[3],
238 const cp_mpi_comm_t comm,
239 double complex *grid_in,
240 double complex *grid_out);
241
242/*******************************************************************************
243 * \brief Performs a distributed forward R2C 3D FFT.
244 * \author Frederick Stein
245 ******************************************************************************/
246void fft_fftw_register_3d_r2c_distributed(const int npts_global[3],
247 const cp_mpi_comm_t comm,
248 double *grid_in,
249 double complex *grid_out);
250
251/*******************************************************************************
252 * \brief Performs a distributed backwards C2R 3D FFT.
253 * \author Frederick Stein
254 ******************************************************************************/
255void fft_fftw_register_3d_c2r_distributed(const int npts_global[3],
256 const cp_mpi_comm_t comm,
257 double complex *grid_in,
258 double *grid_out);
259
260/*******************************************************************************
261 * \brief Performs a local forward C2C 1D FFT.
262 * \author Frederick Stein
263 ******************************************************************************/
264void fft_fftw_1d_local(const bool direction, const int fft_size,
265 const int number_of_ffts, const bool transpose_in,
266 const bool transpose_out, const int leading_dimension_in,
267 const int leading_dimension_out, double complex *grid_in,
268 double complex *grid_out);
269
270/*******************************************************************************
271 * \brief Performs a local forward R2C FFT.
272 * \author Frederick Stein
273 ******************************************************************************/
274void fft_fftw_1d_r2c_local(const int fft_size, const int number_of_ffts,
275 const bool transpose_in, const bool transpose_out,
276 const int leading_dimension_in,
277 const int leading_dimension_out, double *grid_in,
278 double complex *grid_out);
279
280/*******************************************************************************
281 * \brief Performs a local backwards C2R 1D FFT
282 * \author Frederick Stein
283 ******************************************************************************/
284void fft_fftw_1d_c2r_local(const int fft_size, const int number_of_ffts,
285 const bool transpose_in, const bool transpose_out,
286 const int leading_dimension_in,
287 const int leading_dimension_out,
288 double complex *grid_in, double *grid_out);
289
290/*******************************************************************************
291 * \brief Performs a local C2C 2D FFT
292 * \author Frederick Stein
293 ******************************************************************************/
294void fft_fftw_2d_local(const bool direction, const int fft_size[2],
295 const int number_of_ffts, const bool transpose_in,
296 const bool transpose_out, double complex *grid_in,
297 double complex *grid_out);
298
299/*******************************************************************************
300 * \brief Performs a local forward R2C 2D FFT.
301 * \author Frederick Stein
302 ******************************************************************************/
303void fft_fftw_2d_r2c_local(const int fft_size[2], const int number_of_ffts,
304 const bool transpose_in, const bool transpose_out,
305 double *grid_in, double complex *grid_out);
306
307/*******************************************************************************
308 * \brief Performs a local backwards C2R 2D FFT.
309 * \author Frederick Stein
310 ******************************************************************************/
311void fft_fftw_2d_c2r_local(const int fft_size[2], const int number_of_ffts,
312 const bool transpose_in, const bool transpose_out,
313 double complex *grid_in, double *grid_out);
314
315/*******************************************************************************
316 * \brief Performs a local C2C 3D FFT.
317 * \author Frederick Stein
318 ******************************************************************************/
319void fft_fftw_guru(const bool direction, const int rank, const fft_iodim *dims,
320 const int howmany_rank, const fft_iodim *howmany_dims,
321 const int number_of_threads, double complex *grid_in,
322 double complex *grid_out);
323
324/*******************************************************************************
325 * \brief Performs a local forward R2C 3D FFT.
326 * \author Frederick Stein
327 ******************************************************************************/
328void fft_fftw_guru_r2c(int rank, const fft_iodim *dims, int howmany_rank,
329 const fft_iodim *howmany_dims,
330 const int number_of_threads, double *grid_in,
331 double complex *grid_out);
332
333/*******************************************************************************
334 * \brief Performs a local backwards R2C 3D FFT.
335 * \author Frederick Stein
336 ******************************************************************************/
337void fft_fftw_guru_c2r(int rank, const fft_iodim *dims, int howmany_rank,
338 const fft_iodim *howmany_dims,
339 const int number_of_threads, double complex *grid_in,
340 double *grid_out);
341
342/*******************************************************************************
343 * \brief Performs a local C2C 3D FFT.
344 * \author Frederick Stein
345 ******************************************************************************/
346void fft_fftw_3d_local(const bool direction, const int fft_size[3],
347 const int number_of_ffts, const bool transpose_in,
348 const bool transpose_out, double complex *grid_in,
349 double complex *grid_out);
350
351/*******************************************************************************
352 * \brief Performs a local forward R2C 3D FFT.
353 * \author Frederick Stein
354 ******************************************************************************/
355void fft_fftw_3d_r2c_local(const int fft_size[3], const int number_of_ffts,
356 const bool transpose_in, const bool transpose_out,
357 double *grid_in, double complex *grid_out);
358
359/*******************************************************************************
360 * \brief Performs a local backwards R2C 3D FFT.
361 * \author Frederick Stein
362 ******************************************************************************/
363void fft_fftw_3d_c2r_local(const int fft_size[3], const int number_of_ffts,
364 const bool transpose_in, const bool transpose_out,
365 double complex *grid_in, double *grid_out);
366
367/*******************************************************************************
368 * \brief Returns sizes and starts of distributed C2C 2D FFTs.
369 * \author Frederick Stein
370 ******************************************************************************/
371int fft_fftw_2d_distributed_sizes(const int npts_global[2],
372 const int number_of_ffts,
373 const cp_mpi_comm_t comm, int *local_n0,
374 int *local_n0_start, int *local_n1,
375 int *local_n1_start);
376
377/*******************************************************************************
378 * \brief Returns sizes and starts of distributed R2C/C2R 2D FFTs.
379 * \author Frederick Stein
380 ******************************************************************************/
381int fft_fftw_2d_distributed_sizes_r2c(const int npts_global[2],
382 const int number_of_ffts,
383 const cp_mpi_comm_t comm, int *local_n0,
384 int *local_n0_start, int *local_n1,
385 int *local_n1_start);
386
387/*******************************************************************************
388 * \brief Returns sizes and starts of distributed C2C 3D FFTs.
389 * \author Frederick Stein
390 ******************************************************************************/
391int fft_fftw_3d_distributed_sizes(const int npts_global[3],
392 const cp_mpi_comm_t comm, int *local_n0,
393 int *local_n0_start, int *local_n1,
394 int *local_n1_start);
395
396/*******************************************************************************
397 * \brief Returns sizes and starts of distributed R2C/C2R 3D FFTs.
398 * \author Frederick Stein
399 ******************************************************************************/
400int fft_fftw_3d_distributed_sizes_r2c(const int npts_global[3],
401 const cp_mpi_comm_t comm, int *local_n0,
402 int *local_n0_start, int *local_n1,
403 int *local_n1_start);
404
405/*******************************************************************************
406 * \brief Performs a distributed forward C2C 2D FFT.
407 * \author Frederick Stein
408 ******************************************************************************/
409void fft_fftw_2d_distributed(const bool direction, const int npts_global[2],
410 const int number_of_ffts, const cp_mpi_comm_t comm,
411 double complex *restrict grid_in,
412 double complex *restrict grid_out);
413
414/*******************************************************************************
415 * \brief Performs a distributed forward R2C 2D FFT.
416 * \author Frederick Stein
417 ******************************************************************************/
418void fft_fftw_2d_r2c_distributed(const int npts_global[2],
419 const int number_of_ffts,
420 const cp_mpi_comm_t comm,
421 double *restrict grid_in,
422 double complex *restrict grid_out);
423
424/*******************************************************************************
425 * \brief Performs a distributed backwards C2R 2D FFT.
426 * \author Frederick Stein
427 ******************************************************************************/
428void fft_fftw_2d_c2r_distributed(const int npts_global[2],
429 const int number_of_ffts,
430 const cp_mpi_comm_t comm,
431 double complex *restrict grid_in,
432 double *restrict grid_out);
433
434/*******************************************************************************
435 * \brief Performs a distributed C2C 3D FFT.
436 * \author Frederick Stein
437 ******************************************************************************/
438void fft_fftw_3d_distributed(const bool direction, const int npts_global[3],
439 const cp_mpi_comm_t comm,
440 double complex *restrict grid_in,
441 double complex *restrict grid_out);
442
443/*******************************************************************************
444 * \brief Performs a distributed forward R2C 3D FFT.
445 * \author Frederick Stein
446 ******************************************************************************/
447void fft_fftw_3d_r2c_distributed(const int npts_global[3],
448 const cp_mpi_comm_t comm,
449 double *restrict grid_in,
450 double complex *restrict grid_out);
451
452/*******************************************************************************
453 * \brief Performs a distributed backwards C2R 3D FFT.
454 * \author Frederick Stein
455 ******************************************************************************/
456void fft_fftw_3d_c2r_distributed(const int npts_global[3],
457 const cp_mpi_comm_t comm,
458 double complex *restrict grid_in,
459 double *restrict grid_out);
460
461#endif /* FFT_LIB_FFTW_H */
462
463// EOF
int cp_mpi_comm_t
Definition cp_mpi.h:18
bool fft_fftw_lib_has_guru_interface()
Whether the guru interface is available.
void fft_fftw_3d_r2c_local(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Performs a local forward R2C 3D FFT.
fftw_plan_type
@ FFT_PATIENT
@ FFT_MEASURE
@ FFT_EXHAUSTIVE
@ FFT_ESTIMATE
void fft_fftw_2d_r2c_distributed(const int npts_global[2], const int number_of_ffts, const cp_mpi_comm_t comm, double *restrict grid_in, double complex *restrict grid_out)
Performs a distributed forward R2C 2D FFT.
void fft_fftw_register_3d_distributed(const bool direction, const int npts_global[3], const cp_mpi_comm_t comm, double complex *grid_in, double complex *grid_out)
Performs a distributed C2C 3D FFT.
void fft_fftw_3d_local(const bool direction, const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Performs a local C2C 3D FFT.
void fft_fftw_1d_c2r_local(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double *grid_out)
Performs a local backwards C2R 1D FFT.
void fft_fftw_1d_local(const bool direction, const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double complex *grid_out)
Performs a local forward C2C 1D FFT.
void fft_fftw_register_2d_distributed(const bool direction, const int npts_global[2], const int number_of_ffts, const cp_mpi_comm_t comm, double complex *grid_in, double complex *grid_out)
Performs a distributed C2C 2D FFT.
int fft_fftw_2d_distributed_sizes(const int npts_global[2], const int number_of_ffts, const cp_mpi_comm_t comm, int *local_n0, int *local_n0_start, int *local_n1, int *local_n1_start)
Returns sizes and starts of distributed C2C 2D FFTs.
void fft_fftw_register_2d_c2r_local(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Performs a local backwards C2R 2D FFT.
void fft_fftw_3d_c2r_distributed(const int npts_global[3], const cp_mpi_comm_t comm, double complex *restrict grid_in, double *restrict grid_out)
Performs a distributed backwards C2R 3D FFT.
void fft_fftw_guru(const bool direction, const int rank, const fft_iodim *dims, const int howmany_rank, const fft_iodim *howmany_dims, const int number_of_threads, double complex *grid_in, double complex *grid_out)
Performs a local C2C 3D FFT.
int fft_fftw_2d_distributed_sizes_r2c(const int npts_global[2], const int number_of_ffts, const cp_mpi_comm_t comm, int *local_n0, int *local_n0_start, int *local_n1, int *local_n1_start)
Returns sizes and starts of distributed R2C/C2R 2D FFTs.
void fft_fftw_register_3d_c2r_local(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Performs a local backwards R2C 3D FFT.
void fft_fftw_free_double(double *buffer)
Free buffer of type double.
void fft_fftw_2d_distributed(const bool direction, const int npts_global[2], const int number_of_ffts, const cp_mpi_comm_t comm, double complex *restrict grid_in, double complex *restrict grid_out)
Performs a distributed forward C2C 2D FFT.
void fft_fftw_2d_r2c_local(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Performs a local forward R2C 2D FFT.
void fft_fftw_register_2d_r2c_local(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Performs a local forward R2C 2D FFT.
int fft_fftw_init_lib(const fftw_plan_type fftw_planning_flag, const bool use_guru_interface, const char *wisdom_file)
Initialize the FFT library (if not done externally).
void fft_fftw_register_2d_c2r_distributed(const int npts_global[2], const int number_of_ffts, const cp_mpi_comm_t comm, double complex *grid_in, double *grid_out)
Performs a distributed backwards C2R 2D FFT.
void fft_fftw_register_3d_r2c_local(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Performs a local forward R2C 3D FFT.
void fft_fftw_guru_r2c(int rank, const fft_iodim *dims, int howmany_rank, const fft_iodim *howmany_dims, const int number_of_threads, double *grid_in, double complex *grid_out)
Performs a local forward R2C 3D FFT.
void fft_fftw_register_2d_local(const bool direction, const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Performs a local C2C 2D FFT.
void fft_fftw_register_r2c_guru(int rank, const fft_iodim *dims, int howmany_rank, const fft_iodim *howmany_dims, const int number_of_threads, double *grid_in, double complex *grid_out)
Performs a local forward R2C 3D FFT.
void fft_fftw_register_c2r_guru(int rank, const fft_iodim *dims, int howmany_rank, const fft_iodim *howmany_dims, const int number_of_threads, double complex *grid_in, double *grid_out)
Performs a local backwards R2C 3D FFT.
void fft_fftw_3d_distributed(const bool direction, const int npts_global[3], const cp_mpi_comm_t comm, double complex *restrict grid_in, double complex *restrict grid_out)
Performs a distributed C2C 3D FFT.
void fft_fftw_allocate_complex(const int length, double complex **buffer)
Allocate buffer of type double complex.
void fft_fftw_2d_c2r_local(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Performs a local backwards C2R 2D FFT.
void fft_fftw_free_complex(double complex *buffer)
Free buffer of type double complex.
void fft_fftw_guru_c2r(int rank, const fft_iodim *dims, int howmany_rank, const fft_iodim *howmany_dims, const int number_of_threads, double complex *grid_in, double *grid_out)
Performs a local backwards R2C 3D FFT.
void fft_fftw_2d_c2r_distributed(const int npts_global[2], const int number_of_ffts, const cp_mpi_comm_t comm, double complex *restrict grid_in, double *restrict grid_out)
Performs a distributed backwards C2R 2D FFT.
void fft_fftw_3d_r2c_distributed(const int npts_global[3], const cp_mpi_comm_t comm, double *restrict grid_in, double complex *restrict grid_out)
Performs a distributed forward R2C 3D FFT.
void fft_fftw_register_1d_local(const bool direction, const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double complex *grid_out)
Performs a local C2C 1D FFT.
void fft_fftw_finalize_lib(const char *wisdom_file)
Finalize the FFT library (if not done externally).
void fft_fftw_3d_c2r_local(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Performs a local backwards R2C 3D FFT.
void fft_fftw_1d_r2c_local(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double *grid_in, double complex *grid_out)
Performs a local forward R2C FFT.
bool fft_fftw_lib_use_mpi()
Whether a distributed FFT implementation is available.
void fft_fftw_register_3d_c2r_distributed(const int npts_global[3], const cp_mpi_comm_t comm, double complex *grid_in, double *grid_out)
Performs a distributed backwards C2R 3D FFT.
void fft_fftw_register_1d_c2r_local(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double *grid_out)
Performs a local backwards C2R 1D FFT.
void fft_fftw_register_1d_r2c_local(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double *grid_in, double complex *grid_out)
Performs a local forward R2C FFT.
void fft_fftw_register_3d_r2c_distributed(const int npts_global[3], const cp_mpi_comm_t comm, double *grid_in, double complex *grid_out)
Performs a distributed forward R2C 3D FFT.
void fft_fftw_register_3d_local(const bool direction, const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Performs a local C2C 3D FFT.
void fft_fftw_register_guru(const bool direction, int rank, const fft_iodim *dims, int howmany_rank, const fft_iodim *howmany_dims, const int number_of_threads, double complex *grid_in, double complex *grid_out)
Performs a local C2C 3D FFT.
void fft_fftw_register_2d_r2c_distributed(const int npts_global[2], const int number_of_ffts, const cp_mpi_comm_t comm, double *grid_in, double complex *grid_out)
Performs a distributed forward R2C 2D FFT.
void fft_fftw_2d_local(const bool direction, const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Performs a local C2C 2D FFT.
int fft_fftw_3d_distributed_sizes(const int npts_global[3], const cp_mpi_comm_t comm, int *local_n0, int *local_n0_start, int *local_n1, int *local_n1_start)
Returns sizes and starts of distributed C2C 3D FFTs.
int fft_fftw_3d_distributed_sizes_r2c(const int npts_global[3], const cp_mpi_comm_t comm, int *local_n0, int *local_n0_start, int *local_n1, int *local_n1_start)
Returns sizes and starts of distributed R2C/C2R 3D FFTs.
void fft_fftw_allocate_double(const int length, double **buffer)
Allocate buffer of type double.