cannam@95
|
1 <html lang="en">
|
cannam@95
|
2 <head>
|
cannam@95
|
3 <title>Other Multi-dimensional Real-data MPI Transforms - FFTW 3.3.3</title>
|
cannam@95
|
4 <meta http-equiv="Content-Type" content="text/html">
|
cannam@95
|
5 <meta name="description" content="FFTW 3.3.3">
|
cannam@95
|
6 <meta name="generator" content="makeinfo 4.13">
|
cannam@95
|
7 <link title="Top" rel="start" href="index.html#Top">
|
cannam@95
|
8 <link rel="up" href="Distributed_002dmemory-FFTW-with-MPI.html#Distributed_002dmemory-FFTW-with-MPI" title="Distributed-memory FFTW with MPI">
|
cannam@95
|
9 <link rel="prev" href="Multi_002ddimensional-MPI-DFTs-of-Real-Data.html#Multi_002ddimensional-MPI-DFTs-of-Real-Data" title="Multi-dimensional MPI DFTs of Real Data">
|
cannam@95
|
10 <link rel="next" href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes" title="FFTW MPI Transposes">
|
cannam@95
|
11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
cannam@95
|
12 <!--
|
cannam@95
|
13 This manual is for FFTW
|
cannam@95
|
14 (version 3.3.3, 25 November 2012).
|
cannam@95
|
15
|
cannam@95
|
16 Copyright (C) 2003 Matteo Frigo.
|
cannam@95
|
17
|
cannam@95
|
18 Copyright (C) 2003 Massachusetts Institute of Technology.
|
cannam@95
|
19
|
cannam@95
|
20 Permission is granted to make and distribute verbatim copies of
|
cannam@95
|
21 this manual provided the copyright notice and this permission
|
cannam@95
|
22 notice are preserved on all copies.
|
cannam@95
|
23
|
cannam@95
|
24 Permission is granted to copy and distribute modified versions of
|
cannam@95
|
25 this manual under the conditions for verbatim copying, provided
|
cannam@95
|
26 that the entire resulting derived work is distributed under the
|
cannam@95
|
27 terms of a permission notice identical to this one.
|
cannam@95
|
28
|
cannam@95
|
29 Permission is granted to copy and distribute translations of this
|
cannam@95
|
30 manual into another language, under the above conditions for
|
cannam@95
|
31 modified versions, except that this permission notice may be
|
cannam@95
|
32 stated in a translation approved by the Free Software Foundation.
|
cannam@95
|
33 -->
|
cannam@95
|
34 <meta http-equiv="Content-Style-Type" content="text/css">
|
cannam@95
|
35 <style type="text/css"><!--
|
cannam@95
|
36 pre.display { font-family:inherit }
|
cannam@95
|
37 pre.format { font-family:inherit }
|
cannam@95
|
38 pre.smalldisplay { font-family:inherit; font-size:smaller }
|
cannam@95
|
39 pre.smallformat { font-family:inherit; font-size:smaller }
|
cannam@95
|
40 pre.smallexample { font-size:smaller }
|
cannam@95
|
41 pre.smalllisp { font-size:smaller }
|
cannam@95
|
42 span.sc { font-variant:small-caps }
|
cannam@95
|
43 span.roman { font-family:serif; font-weight:normal; }
|
cannam@95
|
44 span.sansserif { font-family:sans-serif; font-weight:normal; }
|
cannam@95
|
45 --></style>
|
cannam@95
|
46 </head>
|
cannam@95
|
47 <body>
|
cannam@95
|
48 <div class="node">
|
cannam@95
|
49 <a name="Other-Multi-dimensional-Real-data-MPI-Transforms"></a>
|
cannam@95
|
50 <a name="Other-Multi_002ddimensional-Real_002ddata-MPI-Transforms"></a>
|
cannam@95
|
51 <p>
|
cannam@95
|
52 Next: <a rel="next" accesskey="n" href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes">FFTW MPI Transposes</a>,
|
cannam@95
|
53 Previous: <a rel="previous" accesskey="p" href="Multi_002ddimensional-MPI-DFTs-of-Real-Data.html#Multi_002ddimensional-MPI-DFTs-of-Real-Data">Multi-dimensional MPI DFTs of Real Data</a>,
|
cannam@95
|
54 Up: <a rel="up" accesskey="u" href="Distributed_002dmemory-FFTW-with-MPI.html#Distributed_002dmemory-FFTW-with-MPI">Distributed-memory FFTW with MPI</a>
|
cannam@95
|
55 <hr>
|
cannam@95
|
56 </div>
|
cannam@95
|
57
|
cannam@95
|
58 <h3 class="section">6.6 Other multi-dimensional Real-Data MPI Transforms</h3>
|
cannam@95
|
59
|
cannam@95
|
60 <p><a name="index-r2r-393"></a>FFTW's MPI interface also supports multi-dimensional ‘<samp><span class="samp">r2r</span></samp>’
|
cannam@95
|
61 transforms of all kinds supported by the serial interface
|
cannam@95
|
62 (e.g. discrete cosine and sine transforms, discrete Hartley
|
cannam@95
|
63 transforms, etc.). Only multi-dimensional ‘<samp><span class="samp">r2r</span></samp>’ transforms, not
|
cannam@95
|
64 one-dimensional transforms, are currently parallelized.
|
cannam@95
|
65
|
cannam@95
|
66 <p><a name="index-fftw_005fr2r_005fkind-394"></a>These are used much like the multidimensional complex DFTs discussed
|
cannam@95
|
67 above, except that the data is real rather than complex, and one needs
|
cannam@95
|
68 to pass an r2r transform kind (<code>fftw_r2r_kind</code>) for each
|
cannam@95
|
69 dimension as in the serial FFTW (see <a href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data">More DFTs of Real Data</a>).
|
cannam@95
|
70
|
cannam@95
|
71 <p>For example, one might perform a two-dimensional L × M that is
|
cannam@95
|
72 an REDFT10 (DCT-II) in the first dimension and an RODFT10 (DST-II) in
|
cannam@95
|
73 the second dimension with code like:
|
cannam@95
|
74
|
cannam@95
|
75 <pre class="example"> const ptrdiff_t L = ..., M = ...;
|
cannam@95
|
76 fftw_plan plan;
|
cannam@95
|
77 double *data;
|
cannam@95
|
78 ptrdiff_t alloc_local, local_n0, local_0_start, i, j;
|
cannam@95
|
79
|
cannam@95
|
80 /* <span class="roman">get local data size and allocate</span> */
|
cannam@95
|
81 alloc_local = fftw_mpi_local_size_2d(L, M, MPI_COMM_WORLD,
|
cannam@95
|
82 &local_n0, &local_0_start);
|
cannam@95
|
83 data = fftw_alloc_real(alloc_local);
|
cannam@95
|
84
|
cannam@95
|
85 /* <span class="roman">create plan for in-place REDFT10 x RODFT10</span> */
|
cannam@95
|
86 plan = fftw_mpi_plan_r2r_2d(L, M, data, data, MPI_COMM_WORLD,
|
cannam@95
|
87 FFTW_REDFT10, FFTW_RODFT10, FFTW_MEASURE);
|
cannam@95
|
88
|
cannam@95
|
89 /* <span class="roman">initialize data to some function</span> my_function(x,y) */
|
cannam@95
|
90 for (i = 0; i < local_n0; ++i) for (j = 0; j < M; ++j)
|
cannam@95
|
91 data[i*M + j] = my_function(local_0_start + i, j);
|
cannam@95
|
92
|
cannam@95
|
93 /* <span class="roman">compute transforms, in-place, as many times as desired</span> */
|
cannam@95
|
94 fftw_execute(plan);
|
cannam@95
|
95
|
cannam@95
|
96 fftw_destroy_plan(plan);
|
cannam@95
|
97 </pre>
|
cannam@95
|
98 <p><a name="index-fftw_005falloc_005freal-395"></a>Notice that we use the same ‘<samp><span class="samp">local_size</span></samp>’ functions as we did for
|
cannam@95
|
99 complex data, only now we interpret the sizes in terms of real rather
|
cannam@95
|
100 than complex values, and correspondingly use <code>fftw_alloc_real</code>.
|
cannam@95
|
101
|
cannam@95
|
102 <!-- -->
|
cannam@95
|
103 </body></html>
|
cannam@95
|
104
|