annotate src/fftw-3.3.5/doc/html/Transposed-distributions.html @ 169:223a55898ab9 tip default

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