cannam@95
|
1 <html lang="en">
|
cannam@95
|
2 <head>
|
cannam@95
|
3 <title>One-dimensional distributions - FFTW 3.3.3</title>
|
cannam@95
|
4 <meta http-equiv="Content-Type" content="text/html">
|
cannam@95
|
5 <meta name="description" content="FFTW 3.3.3">
|
cannam@95
|
6 <meta name="generator" content="makeinfo 4.13">
|
cannam@95
|
7 <link title="Top" rel="start" href="index.html#Top">
|
cannam@95
|
8 <link rel="up" href="MPI-Data-Distribution.html#MPI-Data-Distribution" title="MPI Data Distribution">
|
cannam@95
|
9 <link rel="prev" href="Transposed-distributions.html#Transposed-distributions" title="Transposed distributions">
|
cannam@95
|
10 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
cannam@95
|
11 <!--
|
cannam@95
|
12 This manual is for FFTW
|
cannam@95
|
13 (version 3.3.3, 25 November 2012).
|
cannam@95
|
14
|
cannam@95
|
15 Copyright (C) 2003 Matteo Frigo.
|
cannam@95
|
16
|
cannam@95
|
17 Copyright (C) 2003 Massachusetts Institute of Technology.
|
cannam@95
|
18
|
cannam@95
|
19 Permission is granted to make and distribute verbatim copies of
|
cannam@95
|
20 this manual provided the copyright notice and this permission
|
cannam@95
|
21 notice are preserved on all copies.
|
cannam@95
|
22
|
cannam@95
|
23 Permission is granted to copy and distribute modified versions of
|
cannam@95
|
24 this manual under the conditions for verbatim copying, provided
|
cannam@95
|
25 that the entire resulting derived work is distributed under the
|
cannam@95
|
26 terms of a permission notice identical to this one.
|
cannam@95
|
27
|
cannam@95
|
28 Permission is granted to copy and distribute translations of this
|
cannam@95
|
29 manual into another language, under the above conditions for
|
cannam@95
|
30 modified versions, except that this permission notice may be
|
cannam@95
|
31 stated in a translation approved by the Free Software Foundation.
|
cannam@95
|
32 -->
|
cannam@95
|
33 <meta http-equiv="Content-Style-Type" content="text/css">
|
cannam@95
|
34 <style type="text/css"><!--
|
cannam@95
|
35 pre.display { font-family:inherit }
|
cannam@95
|
36 pre.format { font-family:inherit }
|
cannam@95
|
37 pre.smalldisplay { font-family:inherit; font-size:smaller }
|
cannam@95
|
38 pre.smallformat { font-family:inherit; font-size:smaller }
|
cannam@95
|
39 pre.smallexample { font-size:smaller }
|
cannam@95
|
40 pre.smalllisp { font-size:smaller }
|
cannam@95
|
41 span.sc { font-variant:small-caps }
|
cannam@95
|
42 span.roman { font-family:serif; font-weight:normal; }
|
cannam@95
|
43 span.sansserif { font-family:sans-serif; font-weight:normal; }
|
cannam@95
|
44 --></style>
|
cannam@95
|
45 </head>
|
cannam@95
|
46 <body>
|
cannam@95
|
47 <div class="node">
|
cannam@95
|
48 <a name="One-dimensional-distributions"></a>
|
cannam@95
|
49 <a name="One_002ddimensional-distributions"></a>
|
cannam@95
|
50 <p>
|
cannam@95
|
51 Previous: <a rel="previous" accesskey="p" href="Transposed-distributions.html#Transposed-distributions">Transposed distributions</a>,
|
cannam@95
|
52 Up: <a rel="up" accesskey="u" href="MPI-Data-Distribution.html#MPI-Data-Distribution">MPI Data Distribution</a>
|
cannam@95
|
53 <hr>
|
cannam@95
|
54 </div>
|
cannam@95
|
55
|
cannam@95
|
56 <h4 class="subsection">6.4.4 One-dimensional distributions</h4>
|
cannam@95
|
57
|
cannam@95
|
58 <p>For one-dimensional distributed DFTs using FFTW, matters are slightly
|
cannam@95
|
59 more complicated because the data distribution is more closely tied to
|
cannam@95
|
60 how the algorithm works. In particular, you can no longer pass an
|
cannam@95
|
61 arbitrary block size and must accept FFTW's default; also, the block
|
cannam@95
|
62 sizes may be different for input and output. Also, the data
|
cannam@95
|
63 distribution depends on the flags and transform direction, in order
|
cannam@95
|
64 for forward and backward transforms to work correctly.
|
cannam@95
|
65
|
cannam@95
|
66 <pre class="example"> ptrdiff_t fftw_mpi_local_size_1d(ptrdiff_t n0, MPI_Comm comm,
|
cannam@95
|
67 int sign, unsigned flags,
|
cannam@95
|
68 ptrdiff_t *local_ni, ptrdiff_t *local_i_start,
|
cannam@95
|
69 ptrdiff_t *local_no, ptrdiff_t *local_o_start);
|
cannam@95
|
70 </pre>
|
cannam@95
|
71 <p><a name="index-fftw_005fmpi_005flocal_005fsize_005f1d-383"></a>
|
cannam@95
|
72 This function computes the data distribution for a 1d transform of
|
cannam@95
|
73 size <code>n0</code> with the given transform <code>sign</code> and <code>flags</code>.
|
cannam@95
|
74 Both input and output data use block distributions. The input on the
|
cannam@95
|
75 current process will consist of <code>local_ni</code> numbers starting at
|
cannam@95
|
76 index <code>local_i_start</code>; e.g. if only a single process is used,
|
cannam@95
|
77 then <code>local_ni</code> will be <code>n0</code> and <code>local_i_start</code> will
|
cannam@95
|
78 be <code>0</code>. Similarly for the output, with <code>local_no</code> numbers
|
cannam@95
|
79 starting at index <code>local_o_start</code>. The return value of
|
cannam@95
|
80 <code>fftw_mpi_local_size_1d</code> will be the total number of elements to
|
cannam@95
|
81 allocate on the current process (which might be slightly larger than
|
cannam@95
|
82 the local size due to intermediate steps in the algorithm).
|
cannam@95
|
83
|
cannam@95
|
84 <p>As mentioned above (see <a href="Load-balancing.html#Load-balancing">Load balancing</a>), the data will be divided
|
cannam@95
|
85 equally among the processes if <code>n0</code> is divisible by the
|
cannam@95
|
86 <em>square</em> of the number of processes. In this case,
|
cannam@95
|
87 <code>local_ni</code> will equal <code>local_no</code>. Otherwise, they may be
|
cannam@95
|
88 different.
|
cannam@95
|
89
|
cannam@95
|
90 <p>For some applications, such as convolutions, the order of the output
|
cannam@95
|
91 data is irrelevant. In this case, performance can be improved by
|
cannam@95
|
92 specifying that the output data be stored in an FFTW-defined
|
cannam@95
|
93 “scrambled” format. (In particular, this is the analogue of
|
cannam@95
|
94 transposed output in the multidimensional case: scrambled output saves
|
cannam@95
|
95 a communications step.) If you pass <code>FFTW_MPI_SCRAMBLED_OUT</code> in
|
cannam@95
|
96 the flags, then the output is stored in this (undocumented) scrambled
|
cannam@95
|
97 order. Conversely, to perform the inverse transform of data in
|
cannam@95
|
98 scrambled order, pass the <code>FFTW_MPI_SCRAMBLED_IN</code> flag.
|
cannam@95
|
99 <a name="index-FFTW_005fMPI_005fSCRAMBLED_005fOUT-384"></a><a name="index-FFTW_005fMPI_005fSCRAMBLED_005fIN-385"></a>
|
cannam@95
|
100
|
cannam@95
|
101 <p>In MPI FFTW, only composite sizes <code>n0</code> can be parallelized; we
|
cannam@95
|
102 have not yet implemented a parallel algorithm for large prime sizes.
|
cannam@95
|
103
|
cannam@95
|
104 <!-- -->
|
cannam@95
|
105 </body></html>
|
cannam@95
|
106
|