cannam@95: <html lang="en"> cannam@95: <head> cannam@95: <title>Basic distributed-transpose interface - FFTW 3.3.3</title> cannam@95: <meta http-equiv="Content-Type" content="text/html"> cannam@95: <meta name="description" content="FFTW 3.3.3"> cannam@95: <meta name="generator" content="makeinfo 4.13"> cannam@95: <link title="Top" rel="start" href="index.html#Top"> cannam@95: <link rel="up" href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes" title="FFTW MPI Transposes"> cannam@95: <link rel="prev" href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes" title="FFTW MPI Transposes"> cannam@95: <link rel="next" href="Advanced-distributed_002dtranspose-interface.html#Advanced-distributed_002dtranspose-interface" title="Advanced distributed-transpose interface"> cannam@95: <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> cannam@95: <!-- cannam@95: This manual is for FFTW cannam@95: (version 3.3.3, 25 November 2012). cannam@95: cannam@95: Copyright (C) 2003 Matteo Frigo. cannam@95: cannam@95: Copyright (C) 2003 Massachusetts Institute of Technology. cannam@95: cannam@95: Permission is granted to make and distribute verbatim copies of cannam@95: this manual provided the copyright notice and this permission cannam@95: notice are preserved on all copies. cannam@95: cannam@95: Permission is granted to copy and distribute modified versions of cannam@95: this manual under the conditions for verbatim copying, provided cannam@95: that the entire resulting derived work is distributed under the cannam@95: terms of a permission notice identical to this one. cannam@95: cannam@95: Permission is granted to copy and distribute translations of this cannam@95: manual into another language, under the above conditions for cannam@95: modified versions, except that this permission notice may be cannam@95: stated in a translation approved by the Free Software Foundation. cannam@95: --> cannam@95: <meta http-equiv="Content-Style-Type" content="text/css"> cannam@95: <style type="text/css"><!-- cannam@95: pre.display { font-family:inherit } cannam@95: pre.format { font-family:inherit } cannam@95: pre.smalldisplay { font-family:inherit; font-size:smaller } cannam@95: pre.smallformat { font-family:inherit; font-size:smaller } cannam@95: pre.smallexample { font-size:smaller } cannam@95: pre.smalllisp { font-size:smaller } cannam@95: span.sc { font-variant:small-caps } cannam@95: span.roman { font-family:serif; font-weight:normal; } cannam@95: span.sansserif { font-family:sans-serif; font-weight:normal; } cannam@95: --></style> cannam@95: </head> cannam@95: <body> cannam@95: <div class="node"> cannam@95: <a name="Basic-distributed-transpose-interface"></a> cannam@95: <a name="Basic-distributed_002dtranspose-interface"></a> cannam@95: <p> cannam@95: Next: <a rel="next" accesskey="n" href="Advanced-distributed_002dtranspose-interface.html#Advanced-distributed_002dtranspose-interface">Advanced distributed-transpose interface</a>, cannam@95: Previous: <a rel="previous" accesskey="p" href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes">FFTW MPI Transposes</a>, cannam@95: Up: <a rel="up" accesskey="u" href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes">FFTW MPI Transposes</a> cannam@95: <hr> cannam@95: </div> cannam@95: cannam@95: <h4 class="subsection">6.7.1 Basic distributed-transpose interface</h4> cannam@95: cannam@95: <p>In particular, suppose that we have an <code>n0</code> by <code>n1</code> array in cannam@95: row-major order, block-distributed across the <code>n0</code> dimension. To cannam@95: transpose this into an <code>n1</code> by <code>n0</code> array block-distributed cannam@95: across the <code>n1</code> dimension, we would create a plan by calling the cannam@95: following function: cannam@95: cannam@95: <pre class="example"> fftw_plan fftw_mpi_plan_transpose(ptrdiff_t n0, ptrdiff_t n1, cannam@95: double *in, double *out, cannam@95: MPI_Comm comm, unsigned flags); cannam@95: </pre> cannam@95: <p><a name="index-fftw_005fmpi_005fplan_005ftranspose-397"></a> cannam@95: The input and output arrays (<code>in</code> and <code>out</code>) can be the cannam@95: same. The transpose is actually executed by calling cannam@95: <code>fftw_execute</code> on the plan, as usual. cannam@95: <a name="index-fftw_005fexecute-398"></a> cannam@95: cannam@95: <p>The <code>flags</code> are the usual FFTW planner flags, but support cannam@95: two additional flags: <code>FFTW_MPI_TRANSPOSED_OUT</code> and/or cannam@95: <code>FFTW_MPI_TRANSPOSED_IN</code>. What these flags indicate, for cannam@95: transpose plans, is that the output and/or input, respectively, are cannam@95: <em>locally</em> transposed. That is, on each process input data is cannam@95: normally stored as a <code>local_n0</code> by <code>n1</code> array in row-major cannam@95: order, but for an <code>FFTW_MPI_TRANSPOSED_IN</code> plan the input data is cannam@95: stored as <code>n1</code> by <code>local_n0</code> in row-major order. Similarly, cannam@95: <code>FFTW_MPI_TRANSPOSED_OUT</code> means that the output is <code>n0</code> by cannam@95: <code>local_n1</code> instead of <code>local_n1</code> by <code>n0</code>. cannam@95: <a name="index-FFTW_005fMPI_005fTRANSPOSED_005fOUT-399"></a><a name="index-FFTW_005fMPI_005fTRANSPOSED_005fIN-400"></a> cannam@95: cannam@95: <p>To determine the local size of the array on each process before and cannam@95: after the transpose, as well as the amount of storage that must be cannam@95: allocated, one should call <code>fftw_mpi_local_size_2d_transposed</code>, cannam@95: just as for a 2d DFT as described in the previous section: cannam@95: <a name="index-data-distribution-401"></a> cannam@95: <pre class="example"> ptrdiff_t fftw_mpi_local_size_2d_transposed cannam@95: (ptrdiff_t n0, ptrdiff_t n1, MPI_Comm comm, cannam@95: ptrdiff_t *local_n0, ptrdiff_t *local_0_start, cannam@95: ptrdiff_t *local_n1, ptrdiff_t *local_1_start); cannam@95: </pre> cannam@95: <p><a name="index-fftw_005fmpi_005flocal_005fsize_005f2d_005ftransposed-402"></a> cannam@95: Again, the return value is the local storage to allocate, which in cannam@95: this case is the number of <em>real</em> (<code>double</code>) values rather cannam@95: than complex numbers as in the previous examples. cannam@95: cannam@95: </body></html> cannam@95: