comparison src/fftw-3.3.5/doc/html/Transposed-distributions.html @ 127:7867fa7e1b6b

Current fftw source
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 18 Oct 2016 13:40:26 +0100
parents
children
comparison
equal deleted inserted replaced
126:4a7071416412 127:7867fa7e1b6b
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- This manual is for FFTW
4 (version 3.3.5, 30 July 2016).
5
6 Copyright (C) 2003 Matteo Frigo.
7
8 Copyright (C) 2003 Massachusetts Institute of Technology.
9
10 Permission is granted to make and distribute verbatim copies of this
11 manual provided the copyright notice and this permission notice are
12 preserved on all copies.
13
14 Permission is granted to copy and distribute modified versions of this
15 manual under the conditions for verbatim copying, provided that the
16 entire resulting derived work is distributed under the terms of a
17 permission notice identical to this one.
18
19 Permission is granted to copy and distribute translations of this manual
20 into another language, under the above conditions for modified versions,
21 except that this permission notice may be stated in a translation
22 approved by the Free Software Foundation. -->
23 <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
24 <head>
25 <title>FFTW 3.3.5: Transposed distributions</title>
26
27 <meta name="description" content="FFTW 3.3.5: Transposed distributions">
28 <meta name="keywords" content="FFTW 3.3.5: Transposed distributions">
29 <meta name="resource-type" content="document">
30 <meta name="distribution" content="global">
31 <meta name="Generator" content="makeinfo">
32 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
33 <link href="index.html#Top" rel="start" title="Top">
34 <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
35 <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
36 <link href="MPI-Data-Distribution.html#MPI-Data-Distribution" rel="up" title="MPI Data Distribution">
37 <link href="One_002ddimensional-distributions.html#One_002ddimensional-distributions" rel="next" title="One-dimensional distributions">
38 <link href="Load-balancing.html#Load-balancing" rel="prev" title="Load balancing">
39 <style type="text/css">
40 <!--
41 a.summary-letter {text-decoration: none}
42 blockquote.smallquotation {font-size: smaller}
43 div.display {margin-left: 3.2em}
44 div.example {margin-left: 3.2em}
45 div.indentedblock {margin-left: 3.2em}
46 div.lisp {margin-left: 3.2em}
47 div.smalldisplay {margin-left: 3.2em}
48 div.smallexample {margin-left: 3.2em}
49 div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
50 div.smalllisp {margin-left: 3.2em}
51 kbd {font-style:oblique}
52 pre.display {font-family: inherit}
53 pre.format {font-family: inherit}
54 pre.menu-comment {font-family: serif}
55 pre.menu-preformatted {font-family: serif}
56 pre.smalldisplay {font-family: inherit; font-size: smaller}
57 pre.smallexample {font-size: smaller}
58 pre.smallformat {font-family: inherit; font-size: smaller}
59 pre.smalllisp {font-size: smaller}
60 span.nocodebreak {white-space:nowrap}
61 span.nolinebreak {white-space:nowrap}
62 span.roman {font-family:serif; font-weight:normal}
63 span.sansserif {font-family:sans-serif; font-weight:normal}
64 ul.no-bullet {list-style: none}
65 -->
66 </style>
67
68
69 </head>
70
71 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
72 <a name="Transposed-distributions"></a>
73 <div class="header">
74 <p>
75 Next: <a href="One_002ddimensional-distributions.html#One_002ddimensional-distributions" accesskey="n" rel="next">One-dimensional distributions</a>, Previous: <a href="Load-balancing.html#Load-balancing" accesskey="p" rel="prev">Load balancing</a>, Up: <a href="MPI-Data-Distribution.html#MPI-Data-Distribution" accesskey="u" rel="up">MPI Data Distribution</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
76 </div>
77 <hr>
78 <a name="Transposed-distributions-1"></a>
79 <h4 class="subsection">6.4.3 Transposed distributions</h4>
80
81 <p>Internally, FFTW&rsquo;s MPI transform algorithms work by first computing
82 transforms of the data local to each process, then by globally
83 <em>transposing</em> the data in some fashion to redistribute the data
84 among the processes, transforming the new data local to each process,
85 and transposing back. For example, a two-dimensional <code>n0</code> by
86 <code>n1</code> array, distributed across the <code>n0</code> dimension, is
87 transformd by: (i) transforming the <code>n1</code> dimension, which are
88 local to each process; (ii) transposing to an <code>n1</code> by <code>n0</code>
89 array, distributed across the <code>n1</code> dimension; (iii) transforming
90 the <code>n0</code> dimension, which is now local to each process; (iv)
91 transposing back.
92 <a name="index-transpose"></a>
93 </p>
94
95 <p>However, in many applications it is acceptable to compute a
96 multidimensional DFT whose results are produced in transposed order
97 (e.g., <code>n1</code> by <code>n0</code> in two dimensions). This provides a
98 significant performance advantage, because it means that the final
99 transposition step can be omitted. FFTW supports this optimization,
100 which you specify by passing the flag <code>FFTW_MPI_TRANSPOSED_OUT</code>
101 to the planner routines. To compute the inverse transform of
102 transposed output, you specify <code>FFTW_MPI_TRANSPOSED_IN</code> to tell
103 it that the input is transposed. In this section, we explain how to
104 interpret the output format of such a transform.
105 <a name="index-FFTW_005fMPI_005fTRANSPOSED_005fOUT"></a>
106 <a name="index-FFTW_005fMPI_005fTRANSPOSED_005fIN"></a>
107 </p>
108
109 <p>Suppose you have are transforming multi-dimensional data with (at
110 least two) dimensions n<sub>0</sub>&nbsp;&times;&nbsp;n<sub>1</sub>&nbsp;&times;&nbsp;n<sub>2</sub>&nbsp;&times;&nbsp;&hellip;&nbsp;&times;&nbsp;n<sub>d-1</sub>. As always, it is distributed along
111 the first dimension n<sub>0</sub>. Now, if we compute its DFT with the
112 <code>FFTW_MPI_TRANSPOSED_OUT</code> flag, the resulting output data are stored
113 with the first <em>two</em> dimensions transposed: n<sub>1</sub>&nbsp;&times;&nbsp;n<sub>0</sub>&nbsp;&times;&nbsp;n<sub>2</sub>&nbsp;&times;&hellip;&times;&nbsp;n<sub>d-1</sub>,
114 distributed along the n<sub>1</sub> dimension. Conversely, if we take the
115 n<sub>1</sub>&nbsp;&times;&nbsp;n<sub>0</sub>&nbsp;&times;&nbsp;n<sub>2</sub>&nbsp;&times;&hellip;&times;&nbsp;n<sub>d-1</sub> data and transform it with the
116 <code>FFTW_MPI_TRANSPOSED_IN</code> flag, then the format goes back to the
117 original n<sub>0</sub>&nbsp;&times;&nbsp;n<sub>1</sub>&nbsp;&times;&nbsp;n<sub>2</sub>&nbsp;&times;&nbsp;&hellip;&nbsp;&times;&nbsp;n<sub>d-1</sub> array.
118 </p>
119 <p>There are two ways to find the portion of the transposed array that
120 resides on the current process. First, you can simply call the
121 appropriate &lsquo;<samp>local_size</samp>&rsquo; function, passing n<sub>1</sub>&nbsp;&times;&nbsp;n<sub>0</sub>&nbsp;&times;&nbsp;n<sub>2</sub>&nbsp;&times;&hellip;&times;&nbsp;n<sub>d-1</sub> (the
122 transposed dimensions). This would mean calling the &lsquo;<samp>local_size</samp>&rsquo;
123 function twice, once for the transposed and once for the
124 non-transposed dimensions. Alternatively, you can call one of the
125 &lsquo;<samp>local_size_transposed</samp>&rsquo; functions, which returns both the
126 non-transposed and transposed data distribution from a single call.
127 For example, for a 3d transform with transposed output (or input), you
128 might call:
129 </p>
130 <div class="example">
131 <pre class="example">ptrdiff_t fftw_mpi_local_size_3d_transposed(
132 ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, MPI_Comm comm,
133 ptrdiff_t *local_n0, ptrdiff_t *local_0_start,
134 ptrdiff_t *local_n1, ptrdiff_t *local_1_start);
135 </pre></div>
136 <a name="index-fftw_005fmpi_005flocal_005fsize_005f3d_005ftransposed"></a>
137
138 <p>Here, <code>local_n0</code> and <code>local_0_start</code> give the size and
139 starting index of the <code>n0</code> dimension for the
140 <em>non</em>-transposed data, as in the previous sections. For
141 <em>transposed</em> data (e.g. the output for
142 <code>FFTW_MPI_TRANSPOSED_OUT</code>), <code>local_n1</code> and
143 <code>local_1_start</code> give the size and starting index of the <code>n1</code>
144 dimension, which is the first dimension of the transposed data
145 (<code>n1</code> by <code>n0</code> by <code>n2</code>).
146 </p>
147 <p>(Note that <code>FFTW_MPI_TRANSPOSED_IN</code> is completely equivalent to
148 performing <code>FFTW_MPI_TRANSPOSED_OUT</code> and passing the first two
149 dimensions to the planner in reverse order, or vice versa. If you
150 pass <em>both</em> the <code>FFTW_MPI_TRANSPOSED_IN</code> and
151 <code>FFTW_MPI_TRANSPOSED_OUT</code> flags, it is equivalent to swapping the
152 first two dimensions passed to the planner and passing <em>neither</em>
153 flag.)
154 </p>
155 <hr>
156 <div class="header">
157 <p>
158 Next: <a href="One_002ddimensional-distributions.html#One_002ddimensional-distributions" accesskey="n" rel="next">One-dimensional distributions</a>, Previous: <a href="Load-balancing.html#Load-balancing" accesskey="p" rel="prev">Load balancing</a>, Up: <a href="MPI-Data-Distribution.html#MPI-Data-Distribution" accesskey="u" rel="up">MPI Data Distribution</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
159 </div>
160
161
162
163 </body>
164 </html>