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