annotate Lib/fftw-3.2.1/doc/html/.svn/text-base/Transposed-distributions.html.svn-base @ 12:761289a660c6

Fixed Spectral Contrast and Periodicity
author Geogaddi\David <d.m.ronan@qmul.ac.uk>
date Mon, 17 Aug 2015 19:16:33 +0100
parents 25bf17994ef1
children
rev   line source
d@0 1 <html lang="en">
d@0 2 <head>
d@0 3 <title>Transposed distributions - FFTW 3.2alpha3</title>
d@0 4 <meta http-equiv="Content-Type" content="text/html">
d@0 5 <meta name="description" content="FFTW 3.2alpha3">
d@0 6 <meta name="generator" content="makeinfo 4.8">
d@0 7 <link title="Top" rel="start" href="index.html#Top">
d@0 8 <link rel="up" href="MPI-data-distribution.html#MPI-data-distribution" title="MPI data distribution">
d@0 9 <link rel="prev" href="Load-balancing.html#Load-balancing" title="Load balancing">
d@0 10 <link rel="next" href="One_002ddimensional-distributions.html#One_002ddimensional-distributions" title="One-dimensional distributions">
d@0 11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
d@0 12 <!--
d@0 13 This manual is for FFTW
d@0 14 (version 3.2alpha3, 14 August 2007).
d@0 15
d@0 16 Copyright (C) 2003 Matteo Frigo.
d@0 17
d@0 18 Copyright (C) 2003 Massachusetts Institute of Technology.
d@0 19
d@0 20 Permission is granted to make and distribute verbatim copies of
d@0 21 this manual provided the copyright notice and this permission
d@0 22 notice are preserved on all copies.
d@0 23
d@0 24 Permission is granted to copy and distribute modified versions of
d@0 25 this manual under the conditions for verbatim copying, provided
d@0 26 that the entire resulting derived work is distributed under the
d@0 27 terms of a permission notice identical to this one.
d@0 28
d@0 29 Permission is granted to copy and distribute translations of this
d@0 30 manual into another language, under the above conditions for
d@0 31 modified versions, except that this permission notice may be
d@0 32 stated in a translation approved by the Free Software Foundation.
d@0 33 -->
d@0 34 <meta http-equiv="Content-Style-Type" content="text/css">
d@0 35 <style type="text/css"><!--
d@0 36 pre.display { font-family:inherit }
d@0 37 pre.format { font-family:inherit }
d@0 38 pre.smalldisplay { font-family:inherit; font-size:smaller }
d@0 39 pre.smallformat { font-family:inherit; font-size:smaller }
d@0 40 pre.smallexample { font-size:smaller }
d@0 41 pre.smalllisp { font-size:smaller }
d@0 42 span.sc { font-variant:small-caps }
d@0 43 span.roman { font-family:serif; font-weight:normal; }
d@0 44 span.sansserif { font-family:sans-serif; font-weight:normal; }
d@0 45 --></style>
d@0 46 </head>
d@0 47 <body>
d@0 48 <div class="node">
d@0 49 <p>
d@0 50 <a name="Transposed-distributions"></a>
d@0 51 Next:&nbsp;<a rel="next" accesskey="n" href="One_002ddimensional-distributions.html#One_002ddimensional-distributions">One-dimensional distributions</a>,
d@0 52 Previous:&nbsp;<a rel="previous" accesskey="p" href="Load-balancing.html#Load-balancing">Load balancing</a>,
d@0 53 Up:&nbsp;<a rel="up" accesskey="u" href="MPI-data-distribution.html#MPI-data-distribution">MPI data distribution</a>
d@0 54 <hr>
d@0 55 </div>
d@0 56
d@0 57 <h4 class="subsection">6.4.3 Transposed distributions</h4>
d@0 58
d@0 59 <p>Internally, FFTW's MPI transform algorithms work by first computing
d@0 60 transforms of the data local to each process, then by globally
d@0 61 <em>transposing</em> the data in some fashion to redistribute the data
d@0 62 among the processes, transforming the new data local to each process,
d@0 63 and transposing back. For example, a two-dimensional <code>n0</code> by
d@0 64 <code>n1</code> array, distributed across the <code>n0</code> dimension, is
d@0 65 transformd by: (i) transforming the <code>n1</code> dimension, which are
d@0 66 local to each process; (ii) transposing to a <code>n1</code> by <code>n0</code>
d@0 67 array, distributed across the <code>n1</code> dimension; (iii) transforming
d@0 68 the <code>n0</code> dimension, which is now local to each process; (iv)
d@0 69 transposing back.
d@0 70 <a name="index-transpose-359"></a>
d@0 71 However, in many applications it is acceptable to compute a
d@0 72 multidimensional DFT whose results are produced in transposed order
d@0 73 (e.g., <code>n1</code> by <code>n0</code> in two dimensions). This provides a
d@0 74 significant performance advantage, because it means that the final
d@0 75 transposition step can be omitted. FFTW supports this optimization,
d@0 76 which you specify by passing the flag <code>FFTW_MPI_TRANSPOSED_OUT</code>
d@0 77 to the planner routines. To compute the inverse transform of
d@0 78 transposed output, you specify <code>FFTW_MPI_TRANSPOSED_IN</code> to tell
d@0 79 it that the input is transposed. In this section, we explain how to
d@0 80 interpret the output format of such a transform.
d@0 81 <a name="index-FFTW_005fMPI_005fTRANSPOSED_005fOUT-360"></a><a name="index-FFTW_005fMPI_005fTRANSPOSED_005fIN-361"></a>
d@0 82 Suppose you have are transforming multi-dimensional data with (at
d@0 83 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
d@0 84 the first dimension n<sub>0</sub>. Now, if we compute its DFT with the
d@0 85 <code>FFTW_MPI_TRANSPOSED_OUT</code>, the resulting output data are stored
d@0 86 with the first <em>two</em> dimensions transosed: 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>,
d@0 87 distributed along the n<sub>0</sub> dimension. Conversely, if we take the
d@0 88 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
d@0 89 <code>FFTW_MPI_TRANSPOSED_IN</code> flag, then the format goes back to the
d@0 90 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>.
d@0 91
d@0 92 <p>There are two ways to find the portion of the transposed array that
d@0 93 resides on the current process. First, you can simply call the
d@0 94 appropriate `<samp><span class="samp">local_size</span></samp>' 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
d@0 95 transposed dimensions). This would mean calling the `<samp><span class="samp">local_size</span></samp>'
d@0 96 function twice, once for the transposed and once for the
d@0 97 non-transposed dimensions. Alternatively, you can call one of the
d@0 98 `<samp><span class="samp">local_size_transposed</span></samp>' functions, which returns both the
d@0 99 non-transposed and transposed data distribution from a single call.
d@0 100 For example, for a 3d transform with transposed output (or input), you
d@0 101 might call:
d@0 102
d@0 103 <pre class="example"> ptrdiff_t fftw_mpi_local_size_3d_transposed(
d@0 104 ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, MPI_Comm comm,
d@0 105 ptrdiff_t *local_n0, ptrdiff_t *local_0_start,
d@0 106 ptrdiff_t *local_n1, ptrdiff_t *local_1_start);
d@0 107 </pre>
d@0 108 <p><a name="index-fftw_005fmpi_005flocal_005fsize_005f3d_005ftransposed-362"></a>
d@0 109 Here, <code>local_n0</code> and <code>local_0_start</code> give the size and
d@0 110 starting index of the <code>n0</code> dimension, for the
d@0 111 <em>non</em>-transposed data, as in the previous sections. For
d@0 112 <em>transposed</em> data (e.g. the output for
d@0 113 <code>FFTW_MPI_TRANSPOSED_OUT</code>), <code>local_n1</code> and
d@0 114 <code>local_1_start</code> give the size and starting index of the <code>n1</code>
d@0 115 dimension, which is the first dimension of the transposed data
d@0 116 (<code>n1</code> by <code>n0</code> by <code>n2</code>).
d@0 117
d@0 118 <p>(Note that <code>FFTW_MPI_TRANSPOSED_IN</code> is completely equivalent to
d@0 119 performing <code>FFTW_MPI_TRANSPOSED_OUT</code> and passing the first two
d@0 120 dimensions to the planner in reverse order, or vice versa. If you
d@0 121 pass <em>both</em> the <code>FFTW_MPI_TRANSPOSED_IN</code> and
d@0 122 <code>FFTW_MPI_TRANSPOSED_OUT</code> flags, it is equivalent to swapping the
d@0 123 first two dimensions passed to the planner and passing <em>neither</em>
d@0 124 flag.)
d@0 125
d@0 126 </body></html>
d@0 127