temporary fix for compilation error with GMX_OPENMM=ON
[gromacs/rigid-bodies.git] / include / gmx_parallel_3dfft.h
blobb6c030e3b612305a0677ea1c98ddb9d5e8e3e1e9
1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
4 * Gromacs Copyright (c) 1991-2005
5 * David van der Spoel, Erik Lindahl, University of Groningen.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * To help us fund GROMACS development, we humbly ask that you cite
13 * the research papers on the package. Check out http://www.gromacs.org
15 * And Hey:
16 * Gnomes, ROck Monsters And Chili Sauce
19 #ifndef _gmx_parallel_3dfft_h_
20 #define _gmx_parallel_3dfft_h_
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
27 #include "types/simple.h"
28 #include "gmxcomplex.h"
29 #include "gmx_fft.h"
31 /* We NEED MPI Comm here. But if no MPI is used then void pointer for MPI_Comm is enough*/
32 /* This saves on many ifdefs */
33 #ifdef GMX_LIB_MPI
34 #include <mpi.h>
35 #elif defined GMX_THREADS
36 #include "tmpi.h"
37 #else
38 #ifndef FFT5D_H_
39 typedef void* MPI_Comm;
40 #endif
41 #endif
43 typedef struct gmx_parallel_3dfft *
44 gmx_parallel_3dfft_t;
48 /*! \brief Initialize parallel MPI-based 3D-FFT.
50 * This routine performs real-to-complex and complex-to-real parallel 3D FFTs,
51 * but not complex-to-complex.
53 * The routine is optimized for small-to-medium size FFTs used for PME and
54 * PPPM algorithms, and do allocate extra workspace whenever it might improve
55 * performance.
57 * \param pfft_setup Pointer to parallel 3dfft setup structure, previously
58 * allocated or with automatic storage.
59 * \param ngridx Global number of grid cells in the x direction. Must be
60 * divisible by the number of nodes.
61 * \param ngridy Global number of grid cells in the y direction. Must be
62 * divisible by the number of nodes.
63 * \param ngridz Global number of grid cells in the z direction.
64 * \param node2slab Node id to slab index array, can be NULL.
65 * \param slab2grid_x Slab index to grid_x array (nnodes+1), can be NULL.
66 * \param comm MPI communicator, must have been initialized.
67 * \param bReproducible Try to avoid FFT timing optimizations and other stuff
68 * that could make results differ for two runs with
69 * identical input (reproducibility for debugging).
71 * \return 0 or a standard error code.
73 int
74 gmx_parallel_3dfft_init (gmx_parallel_3dfft_t * pfft_setup,
75 ivec ndata,
76 real ** real_data,
77 t_complex ** complex_data,
78 MPI_Comm comm[2],
79 int * slab2index_major,
80 int * slab2index_minor,
81 bool bReproducible);
87 /*! \brief Get direct space grid index limits
89 int
90 gmx_parallel_3dfft_real_limits(gmx_parallel_3dfft_t pfft_setup,
91 ivec local_ndata,
92 ivec local_offset,
93 ivec local_size);
96 /*! \brief Get reciprocal space grid index limits
98 int
99 gmx_parallel_3dfft_complex_limits(gmx_parallel_3dfft_t pfft_setup,
100 ivec complex_order,
101 ivec local_ndata,
102 ivec local_offset,
103 ivec local_size);
107 gmx_parallel_3dfft_execute(gmx_parallel_3dfft_t pfft_setup,
108 enum gmx_fft_direction dir,
109 void * in_data,
110 void * out_data);
113 /*! \brief Release all data in parallel fft setup
115 * All temporary storage and FFT plans are released. The structure itself
116 * is not released, but the contents is invalid after this call.
118 * \param pfft_setup Parallel 3dfft setup.
120 * \return 0 or a standard error code.
123 gmx_parallel_3dfft_destroy(gmx_parallel_3dfft_t pfft_setup);
128 #endif /* _gmx_parallel_3dfft_h_ */