File indexing completed on 2025-01-17 09:55:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 #ifndef FFTW3_MPI_H
0048 #define FFTW3_MPI_H
0049
0050 #include <fftw3.h>
0051 #include <mpi.h>
0052
0053 #ifdef __cplusplus
0054 extern "C"
0055 {
0056 #endif
0057
0058 struct fftw_mpi_ddim_do_not_use_me {
0059 ptrdiff_t n;
0060 ptrdiff_t ib;
0061 ptrdiff_t ob;
0062 };
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074 #define FFTW_MPI_DEFINE_API(XM, X, R, C) \
0075 \
0076 typedef struct fftw_mpi_ddim_do_not_use_me XM(ddim); \
0077 \
0078 FFTW_EXTERN void XM(init)(void); \
0079 FFTW_EXTERN void XM(cleanup)(void); \
0080 \
0081 FFTW_EXTERN ptrdiff_t XM(local_size_many_transposed) \
0082 (int rnk, const ptrdiff_t *n, ptrdiff_t howmany, \
0083 ptrdiff_t block0, ptrdiff_t block1, MPI_Comm comm, \
0084 ptrdiff_t *local_n0, ptrdiff_t *local_0_start, \
0085 ptrdiff_t *local_n1, ptrdiff_t *local_1_start); \
0086 FFTW_EXTERN ptrdiff_t XM(local_size_many) \
0087 (int rnk, const ptrdiff_t *n, ptrdiff_t howmany, \
0088 ptrdiff_t block0, MPI_Comm comm, \
0089 ptrdiff_t *local_n0, ptrdiff_t *local_0_start); \
0090 FFTW_EXTERN ptrdiff_t XM(local_size_transposed) \
0091 (int rnk, const ptrdiff_t *n, MPI_Comm comm, \
0092 ptrdiff_t *local_n0, ptrdiff_t *local_0_start, \
0093 ptrdiff_t *local_n1, ptrdiff_t *local_1_start); \
0094 FFTW_EXTERN ptrdiff_t XM(local_size) \
0095 (int rnk, const ptrdiff_t *n, MPI_Comm comm, \
0096 ptrdiff_t *local_n0, ptrdiff_t *local_0_start); \
0097 FFTW_EXTERN ptrdiff_t XM(local_size_many_1d)( \
0098 ptrdiff_t n0, ptrdiff_t howmany, \
0099 MPI_Comm comm, int sign, unsigned flags, \
0100 ptrdiff_t *local_ni, ptrdiff_t *local_i_start, \
0101 ptrdiff_t *local_no, ptrdiff_t *local_o_start); \
0102 FFTW_EXTERN ptrdiff_t XM(local_size_1d)( \
0103 ptrdiff_t n0, MPI_Comm comm, int sign, unsigned flags, \
0104 ptrdiff_t *local_ni, ptrdiff_t *local_i_start, \
0105 ptrdiff_t *local_no, ptrdiff_t *local_o_start); \
0106 FFTW_EXTERN ptrdiff_t XM(local_size_2d)( \
0107 ptrdiff_t n0, ptrdiff_t n1, MPI_Comm comm, \
0108 ptrdiff_t *local_n0, ptrdiff_t *local_0_start); \
0109 FFTW_EXTERN ptrdiff_t XM(local_size_2d_transposed)( \
0110 ptrdiff_t n0, ptrdiff_t n1, MPI_Comm comm, \
0111 ptrdiff_t *local_n0, ptrdiff_t *local_0_start, \
0112 ptrdiff_t *local_n1, ptrdiff_t *local_1_start); \
0113 FFTW_EXTERN ptrdiff_t XM(local_size_3d)( \
0114 ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, MPI_Comm comm, \
0115 ptrdiff_t *local_n0, ptrdiff_t *local_0_start); \
0116 FFTW_EXTERN ptrdiff_t XM(local_size_3d_transposed)( \
0117 ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, MPI_Comm comm, \
0118 ptrdiff_t *local_n0, ptrdiff_t *local_0_start, \
0119 ptrdiff_t *local_n1, ptrdiff_t *local_1_start); \
0120 \
0121 FFTW_EXTERN X(plan) XM(plan_many_transpose) \
0122 (ptrdiff_t n0, ptrdiff_t n1, \
0123 ptrdiff_t howmany, ptrdiff_t block0, ptrdiff_t block1, \
0124 R *in, R *out, MPI_Comm comm, unsigned flags); \
0125 FFTW_EXTERN X(plan) XM(plan_transpose) \
0126 (ptrdiff_t n0, ptrdiff_t n1, \
0127 R *in, R *out, MPI_Comm comm, unsigned flags); \
0128 \
0129 FFTW_EXTERN X(plan) XM(plan_many_dft) \
0130 (int rnk, const ptrdiff_t *n, ptrdiff_t howmany, \
0131 ptrdiff_t block, ptrdiff_t tblock, C *in, C *out, \
0132 MPI_Comm comm, int sign, unsigned flags); \
0133 FFTW_EXTERN X(plan) XM(plan_dft) \
0134 (int rnk, const ptrdiff_t *n, C *in, C *out, \
0135 MPI_Comm comm, int sign, unsigned flags); \
0136 FFTW_EXTERN X(plan) XM(plan_dft_1d) \
0137 (ptrdiff_t n0, C *in, C *out, \
0138 MPI_Comm comm, int sign, unsigned flags); \
0139 FFTW_EXTERN X(plan) XM(plan_dft_2d) \
0140 (ptrdiff_t n0, ptrdiff_t n1, C *in, C *out, \
0141 MPI_Comm comm, int sign, unsigned flags); \
0142 FFTW_EXTERN X(plan) XM(plan_dft_3d) \
0143 (ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, C *in, C *out, \
0144 MPI_Comm comm, int sign, unsigned flags); \
0145 \
0146 FFTW_EXTERN X(plan) XM(plan_many_r2r) \
0147 (int rnk, const ptrdiff_t *n, ptrdiff_t howmany, \
0148 ptrdiff_t iblock, ptrdiff_t oblock, R *in, R *out, \
0149 MPI_Comm comm, const X(r2r_kind) *kind, unsigned flags); \
0150 FFTW_EXTERN X(plan) XM(plan_r2r) \
0151 (int rnk, const ptrdiff_t *n, R *in, R *out, \
0152 MPI_Comm comm, const X(r2r_kind) *kind, unsigned flags); \
0153 FFTW_EXTERN X(plan) XM(plan_r2r_2d) \
0154 (ptrdiff_t n0, ptrdiff_t n1, R *in, R *out, MPI_Comm comm, \
0155 X(r2r_kind) kind0, X(r2r_kind) kind1, unsigned flags); \
0156 FFTW_EXTERN X(plan) XM(plan_r2r_3d) \
0157 (ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, \
0158 R *in, R *out, MPI_Comm comm, X(r2r_kind) kind0, \
0159 X(r2r_kind) kind1, X(r2r_kind) kind2, unsigned flags); \
0160 \
0161 FFTW_EXTERN X(plan) XM(plan_many_dft_r2c) \
0162 (int rnk, const ptrdiff_t *n, ptrdiff_t howmany, \
0163 ptrdiff_t iblock, ptrdiff_t oblock, R *in, C *out, \
0164 MPI_Comm comm, unsigned flags); \
0165 FFTW_EXTERN X(plan) XM(plan_dft_r2c) \
0166 (int rnk, const ptrdiff_t *n, R *in, C *out, \
0167 MPI_Comm comm, unsigned flags); \
0168 FFTW_EXTERN X(plan) XM(plan_dft_r2c_2d) \
0169 (ptrdiff_t n0, ptrdiff_t n1, R *in, C *out, \
0170 MPI_Comm comm, unsigned flags); \
0171 FFTW_EXTERN X(plan) XM(plan_dft_r2c_3d) \
0172 (ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, R *in, C *out, \
0173 MPI_Comm comm, unsigned flags); \
0174 \
0175 FFTW_EXTERN X(plan) XM(plan_many_dft_c2r) \
0176 (int rnk, const ptrdiff_t *n, ptrdiff_t howmany, \
0177 ptrdiff_t iblock, ptrdiff_t oblock, C *in, R *out, \
0178 MPI_Comm comm, unsigned flags); \
0179 FFTW_EXTERN X(plan) XM(plan_dft_c2r) \
0180 (int rnk, const ptrdiff_t *n, C *in, R *out, \
0181 MPI_Comm comm, unsigned flags); \
0182 FFTW_EXTERN X(plan) XM(plan_dft_c2r_2d) \
0183 (ptrdiff_t n0, ptrdiff_t n1, C *in, R *out, \
0184 MPI_Comm comm, unsigned flags); \
0185 FFTW_EXTERN X(plan) XM(plan_dft_c2r_3d) \
0186 (ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, C *in, R *out, \
0187 MPI_Comm comm, unsigned flags); \
0188 \
0189 FFTW_EXTERN void XM(gather_wisdom)(MPI_Comm comm_); \
0190 FFTW_EXTERN void XM(broadcast_wisdom)(MPI_Comm comm_); \
0191 \
0192 FFTW_EXTERN void XM(execute_dft)(X(plan) p, C *in, C *out); \
0193 FFTW_EXTERN void XM(execute_dft_r2c)(X(plan) p, R *in, C *out); \
0194 FFTW_EXTERN void XM(execute_dft_c2r)(X(plan) p, C *in, R *out); \
0195 FFTW_EXTERN void XM(execute_r2r)(X(plan) p, R *in, R *out);
0196
0197
0198
0199
0200
0201 #define FFTW_MPI_MANGLE_DOUBLE(name) FFTW_MANGLE_DOUBLE(FFTW_CONCAT(mpi_,name))
0202 #define FFTW_MPI_MANGLE_FLOAT(name) FFTW_MANGLE_FLOAT(FFTW_CONCAT(mpi_,name))
0203 #define FFTW_MPI_MANGLE_LONG_DOUBLE(name) FFTW_MANGLE_LONG_DOUBLE(FFTW_CONCAT(mpi_,name))
0204
0205 FFTW_MPI_DEFINE_API(FFTW_MPI_MANGLE_DOUBLE, FFTW_MANGLE_DOUBLE, double, fftw_complex)
0206 FFTW_MPI_DEFINE_API(FFTW_MPI_MANGLE_FLOAT, FFTW_MANGLE_FLOAT, float, fftwf_complex)
0207 FFTW_MPI_DEFINE_API(FFTW_MPI_MANGLE_LONG_DOUBLE, FFTW_MANGLE_LONG_DOUBLE, long double, fftwl_complex)
0208
0209 #define FFTW_MPI_DEFAULT_BLOCK (0)
0210
0211
0212 #define FFTW_MPI_SCRAMBLED_IN (1U << 27)
0213 #define FFTW_MPI_SCRAMBLED_OUT (1U << 28)
0214 #define FFTW_MPI_TRANSPOSED_IN (1U << 29)
0215 #define FFTW_MPI_TRANSPOSED_OUT (1U << 30)
0216
0217 #ifdef __cplusplus
0218 }
0219 #endif
0220
0221 #endif