Mercurial > hg > sv-dependency-builds
comparison src/fftw-3.3.8/doc/html/Transposed-distributions.html @ 167:bd3cc4d1df30
Add FFTW 3.3.8 source, and a Linux build
| author | Chris Cannam <cannam@all-day-breakfast.com> | 
|---|---|
| date | Tue, 19 Nov 2019 14:52:55 +0000 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 166:cbd6d7e562c7 | 167:bd3cc4d1df30 | 
|---|---|
| 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.8, 24 May 2018). | |
| 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 6.3, http://www.gnu.org/software/texinfo/ --> | |
| 24 <head> | |
| 25 <title>FFTW 3.3.8: Transposed distributions</title> | |
| 26 | |
| 27 <meta name="description" content="FFTW 3.3.8: Transposed distributions"> | |
| 28 <meta name="keywords" content="FFTW 3.3.8: 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.indentedblock {margin-right: 0em} | |
| 43 blockquote.smallindentedblock {margin-right: 0em; font-size: smaller} | |
| 44 blockquote.smallquotation {font-size: smaller} | |
| 45 div.display {margin-left: 3.2em} | |
| 46 div.example {margin-left: 3.2em} | |
| 47 div.lisp {margin-left: 3.2em} | |
| 48 div.smalldisplay {margin-left: 3.2em} | |
| 49 div.smallexample {margin-left: 3.2em} | |
| 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.nolinebreak {white-space: nowrap} | |
| 61 span.roman {font-family: initial; font-weight: normal} | |
| 62 span.sansserif {font-family: sans-serif; font-weight: normal} | |
| 63 ul.no-bullet {list-style: none} | |
| 64 --> | |
| 65 </style> | |
| 66 | |
| 67 | |
| 68 </head> | |
| 69 | |
| 70 <body lang="en"> | |
| 71 <a name="Transposed-distributions"></a> | |
| 72 <div class="header"> | |
| 73 <p> | |
| 74 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>   [<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> | |
| 75 </div> | |
| 76 <hr> | |
| 77 <a name="Transposed-distributions-1"></a> | |
| 78 <h4 class="subsection">6.4.3 Transposed distributions</h4> | |
| 79 | |
| 80 <p>Internally, FFTW’s MPI transform algorithms work by first computing | |
| 81 transforms of the data local to each process, then by globally | |
| 82 <em>transposing</em> the data in some fashion to redistribute the data | |
| 83 among the processes, transforming the new data local to each process, | |
| 84 and transposing back. For example, a two-dimensional <code>n0</code> by | |
| 85 <code>n1</code> array, distributed across the <code>n0</code> dimension, is | |
| 86 transformd by: (i) transforming the <code>n1</code> dimension, which are | |
| 87 local to each process; (ii) transposing to an <code>n1</code> by <code>n0</code> | |
| 88 array, distributed across the <code>n1</code> dimension; (iii) transforming | |
| 89 the <code>n0</code> dimension, which is now local to each process; (iv) | |
| 90 transposing back. | |
| 91 <a name="index-transpose"></a> | |
| 92 </p> | |
| 93 | |
| 94 <p>However, in many applications it is acceptable to compute a | |
| 95 multidimensional DFT whose results are produced in transposed order | |
| 96 (e.g., <code>n1</code> by <code>n0</code> in two dimensions). This provides a | |
| 97 significant performance advantage, because it means that the final | |
| 98 transposition step can be omitted. FFTW supports this optimization, | |
| 99 which you specify by passing the flag <code>FFTW_MPI_TRANSPOSED_OUT</code> | |
| 100 to the planner routines. To compute the inverse transform of | |
| 101 transposed output, you specify <code>FFTW_MPI_TRANSPOSED_IN</code> to tell | |
| 102 it that the input is transposed. In this section, we explain how to | |
| 103 interpret the output format of such a transform. | |
| 104 <a name="index-FFTW_005fMPI_005fTRANSPOSED_005fOUT"></a> | |
| 105 <a name="index-FFTW_005fMPI_005fTRANSPOSED_005fIN"></a> | |
| 106 </p> | |
| 107 | |
| 108 <p>Suppose you have are transforming multi-dimensional data with (at | |
| 109 least two) dimensions n<sub>0</sub> × n<sub>1</sub> × n<sub>2</sub> × … × n<sub>d-1</sub> | |
| 110 . As always, it is distributed along | |
| 111 the first dimension n<sub>0</sub> | |
| 112 . Now, if we compute its DFT with the | |
| 113 <code>FFTW_MPI_TRANSPOSED_OUT</code> flag, the resulting output data are stored | |
| 114 with the first <em>two</em> dimensions transposed: n<sub>1</sub> × n<sub>0</sub> × n<sub>2</sub> ×…× n<sub>d-1</sub> | |
| 115 , | |
| 116 distributed along the n<sub>1</sub> | |
| 117 dimension. Conversely, if we take the | |
| 118 n<sub>1</sub> × n<sub>0</sub> × n<sub>2</sub> ×…× n<sub>d-1</sub> | |
| 119 data and transform it with the | |
| 120 <code>FFTW_MPI_TRANSPOSED_IN</code> flag, then the format goes back to the | |
| 121 original n<sub>0</sub> × n<sub>1</sub> × n<sub>2</sub> × … × n<sub>d-1</sub> | |
| 122 array. | |
| 123 </p> | |
| 124 <p>There are two ways to find the portion of the transposed array that | |
| 125 resides on the current process. First, you can simply call the | |
| 126 appropriate ‘<samp>local_size</samp>’ function, passing n<sub>1</sub> × n<sub>0</sub> × n<sub>2</sub> ×…× n<sub>d-1</sub> | |
| 127 (the | |
| 128 transposed dimensions). This would mean calling the ‘<samp>local_size</samp>’ | |
| 129 function twice, once for the transposed and once for the | |
| 130 non-transposed dimensions. Alternatively, you can call one of the | |
| 131 ‘<samp>local_size_transposed</samp>’ functions, which returns both the | |
| 132 non-transposed and transposed data distribution from a single call. | |
| 133 For example, for a 3d transform with transposed output (or input), you | |
| 134 might call: | |
| 135 </p> | |
| 136 <div class="example"> | |
| 137 <pre class="example">ptrdiff_t fftw_mpi_local_size_3d_transposed( | |
| 138 ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, MPI_Comm comm, | |
| 139 ptrdiff_t *local_n0, ptrdiff_t *local_0_start, | |
| 140 ptrdiff_t *local_n1, ptrdiff_t *local_1_start); | |
| 141 </pre></div> | |
| 142 <a name="index-fftw_005fmpi_005flocal_005fsize_005f3d_005ftransposed"></a> | |
| 143 | |
| 144 <p>Here, <code>local_n0</code> and <code>local_0_start</code> give the size and | |
| 145 starting index of the <code>n0</code> dimension for the | |
| 146 <em>non</em>-transposed data, as in the previous sections. For | |
| 147 <em>transposed</em> data (e.g. the output for | |
| 148 <code>FFTW_MPI_TRANSPOSED_OUT</code>), <code>local_n1</code> and | |
| 149 <code>local_1_start</code> give the size and starting index of the <code>n1</code> | |
| 150 dimension, which is the first dimension of the transposed data | |
| 151 (<code>n1</code> by <code>n0</code> by <code>n2</code>). | |
| 152 </p> | |
| 153 <p>(Note that <code>FFTW_MPI_TRANSPOSED_IN</code> is completely equivalent to | |
| 154 performing <code>FFTW_MPI_TRANSPOSED_OUT</code> and passing the first two | |
| 155 dimensions to the planner in reverse order, or vice versa. If you | |
| 156 pass <em>both</em> the <code>FFTW_MPI_TRANSPOSED_IN</code> and | |
| 157 <code>FFTW_MPI_TRANSPOSED_OUT</code> flags, it is equivalent to swapping the | |
| 158 first two dimensions passed to the planner and passing <em>neither</em> | |
| 159 flag.) | |
| 160 </p> | |
| 161 <hr> | |
| 162 <div class="header"> | |
| 163 <p> | |
| 164 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>   [<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> | |
| 165 </div> | |
| 166 | |
| 167 | |
| 168 | |
| 169 </body> | |
| 170 </html> | 
