Mercurial > hg > sv-dependency-builds
diff src/fftw-3.3.3/doc/html/Transposed-distributions.html @ 95:89f5e221ed7b
Add FFTW3
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Wed, 20 Mar 2013 15:35:50 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/fftw-3.3.3/doc/html/Transposed-distributions.html Wed Mar 20 15:35:50 2013 +0000 @@ -0,0 +1,129 @@ +<html lang="en"> +<head> +<title>Transposed distributions - FFTW 3.3.3</title> +<meta http-equiv="Content-Type" content="text/html"> +<meta name="description" content="FFTW 3.3.3"> +<meta name="generator" content="makeinfo 4.13"> +<link title="Top" rel="start" href="index.html#Top"> +<link rel="up" href="MPI-Data-Distribution.html#MPI-Data-Distribution" title="MPI Data Distribution"> +<link rel="prev" href="Load-balancing.html#Load-balancing" title="Load balancing"> +<link rel="next" href="One_002ddimensional-distributions.html#One_002ddimensional-distributions" title="One-dimensional distributions"> +<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> +<!-- +This manual is for FFTW +(version 3.3.3, 25 November 2012). + +Copyright (C) 2003 Matteo Frigo. + +Copyright (C) 2003 Massachusetts Institute of Technology. + + Permission is granted to make and distribute verbatim copies of + this manual provided the copyright notice and this permission + notice are preserved on all copies. + + Permission is granted to copy and distribute modified versions of + this manual under the conditions for verbatim copying, provided + that the entire resulting derived work is distributed under the + terms of a permission notice identical to this one. + + Permission is granted to copy and distribute translations of this + manual into another language, under the above conditions for + modified versions, except that this permission notice may be + stated in a translation approved by the Free Software Foundation. + --> +<meta http-equiv="Content-Style-Type" content="text/css"> +<style type="text/css"><!-- + pre.display { font-family:inherit } + pre.format { font-family:inherit } + pre.smalldisplay { font-family:inherit; font-size:smaller } + pre.smallformat { font-family:inherit; font-size:smaller } + pre.smallexample { font-size:smaller } + pre.smalllisp { font-size:smaller } + span.sc { font-variant:small-caps } + span.roman { font-family:serif; font-weight:normal; } + span.sansserif { font-family:sans-serif; font-weight:normal; } +--></style> +</head> +<body> +<div class="node"> +<a name="Transposed-distributions"></a> +<p> +Next: <a rel="next" accesskey="n" href="One_002ddimensional-distributions.html#One_002ddimensional-distributions">One-dimensional distributions</a>, +Previous: <a rel="previous" accesskey="p" href="Load-balancing.html#Load-balancing">Load balancing</a>, +Up: <a rel="up" accesskey="u" href="MPI-Data-Distribution.html#MPI-Data-Distribution">MPI Data Distribution</a> +<hr> +</div> + +<h4 class="subsection">6.4.3 Transposed distributions</h4> + +<p>Internally, FFTW's MPI transform algorithms work by first computing +transforms of the data local to each process, then by globally +<em>transposing</em> the data in some fashion to redistribute the data +among the processes, transforming the new data local to each process, +and transposing back. For example, a two-dimensional <code>n0</code> by +<code>n1</code> array, distributed across the <code>n0</code> dimension, is +transformd by: (i) transforming the <code>n1</code> dimension, which are +local to each process; (ii) transposing to an <code>n1</code> by <code>n0</code> +array, distributed across the <code>n1</code> dimension; (iii) transforming +the <code>n0</code> dimension, which is now local to each process; (iv) +transposing back. +<a name="index-transpose-379"></a> + + <p>However, in many applications it is acceptable to compute a +multidimensional DFT whose results are produced in transposed order +(e.g., <code>n1</code> by <code>n0</code> in two dimensions). This provides a +significant performance advantage, because it means that the final +transposition step can be omitted. FFTW supports this optimization, +which you specify by passing the flag <code>FFTW_MPI_TRANSPOSED_OUT</code> +to the planner routines. To compute the inverse transform of +transposed output, you specify <code>FFTW_MPI_TRANSPOSED_IN</code> to tell +it that the input is transposed. In this section, we explain how to +interpret the output format of such a transform. +<a name="index-FFTW_005fMPI_005fTRANSPOSED_005fOUT-380"></a><a name="index-FFTW_005fMPI_005fTRANSPOSED_005fIN-381"></a> + + <p>Suppose you have are transforming multi-dimensional data with (at +least two) dimensions n<sub>0</sub> × n<sub>1</sub> × n<sub>2</sub> × … × n<sub>d-1</sub>. As always, it is distributed along +the first dimension n<sub>0</sub>. Now, if we compute its DFT with the +<code>FFTW_MPI_TRANSPOSED_OUT</code> flag, the resulting output data are stored +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>, +distributed along the n<sub>1</sub> dimension. Conversely, if we take the +n<sub>1</sub> × n<sub>0</sub> × n<sub>2</sub> ×…× n<sub>d-1</sub> data and transform it with the +<code>FFTW_MPI_TRANSPOSED_IN</code> flag, then the format goes back to the +original n<sub>0</sub> × n<sub>1</sub> × n<sub>2</sub> × … × n<sub>d-1</sub> array. + + <p>There are two ways to find the portion of the transposed array that +resides on the current process. First, you can simply call the +appropriate ‘<samp><span class="samp">local_size</span></samp>’ function, passing n<sub>1</sub> × n<sub>0</sub> × n<sub>2</sub> ×…× n<sub>d-1</sub> (the +transposed dimensions). This would mean calling the ‘<samp><span class="samp">local_size</span></samp>’ +function twice, once for the transposed and once for the +non-transposed dimensions. Alternatively, you can call one of the +‘<samp><span class="samp">local_size_transposed</span></samp>’ functions, which returns both the +non-transposed and transposed data distribution from a single call. +For example, for a 3d transform with transposed output (or input), you +might call: + +<pre class="example"> ptrdiff_t fftw_mpi_local_size_3d_transposed( + ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, MPI_Comm comm, + ptrdiff_t *local_n0, ptrdiff_t *local_0_start, + ptrdiff_t *local_n1, ptrdiff_t *local_1_start); +</pre> + <p><a name="index-fftw_005fmpi_005flocal_005fsize_005f3d_005ftransposed-382"></a> +Here, <code>local_n0</code> and <code>local_0_start</code> give the size and +starting index of the <code>n0</code> dimension for the +<em>non</em>-transposed data, as in the previous sections. For +<em>transposed</em> data (e.g. the output for +<code>FFTW_MPI_TRANSPOSED_OUT</code>), <code>local_n1</code> and +<code>local_1_start</code> give the size and starting index of the <code>n1</code> +dimension, which is the first dimension of the transposed data +(<code>n1</code> by <code>n0</code> by <code>n2</code>). + + <p>(Note that <code>FFTW_MPI_TRANSPOSED_IN</code> is completely equivalent to +performing <code>FFTW_MPI_TRANSPOSED_OUT</code> and passing the first two +dimensions to the planner in reverse order, or vice versa. If you +pass <em>both</em> the <code>FFTW_MPI_TRANSPOSED_IN</code> and +<code>FFTW_MPI_TRANSPOSED_OUT</code> flags, it is equivalent to swapping the +first two dimensions passed to the planner and passing <em>neither</em> +flag.) + + </body></html> +