d@0
|
1 <html lang="en">
|
d@0
|
2 <head>
|
d@0
|
3 <title>MPI data distribution - 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="Distributed_002dmemory-FFTW-with-MPI.html#Distributed_002dmemory-FFTW-with-MPI" title="Distributed-memory FFTW with MPI">
|
d@0
|
9 <link rel="prev" href="Simple-MPI-example.html#Simple-MPI-example" title="Simple MPI example">
|
d@0
|
10 <link rel="next" href="Multi_002ddimensional-MPI-DFT-of-Real-Data.html#Multi_002ddimensional-MPI-DFT-of-Real-Data" title="Multi-dimensional MPI DFT of Real Data">
|
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="MPI-data-distribution"></a>
|
d@0
|
51 Next: <a rel="next" accesskey="n" href="Multi_002ddimensional-MPI-DFT-of-Real-Data.html#Multi_002ddimensional-MPI-DFT-of-Real-Data">Multi-dimensional MPI DFT of Real Data</a>,
|
d@0
|
52 Previous: <a rel="previous" accesskey="p" href="Simple-MPI-example.html#Simple-MPI-example">Simple MPI example</a>,
|
d@0
|
53 Up: <a rel="up" accesskey="u" href="Distributed_002dmemory-FFTW-with-MPI.html#Distributed_002dmemory-FFTW-with-MPI">Distributed-memory FFTW with MPI</a>
|
d@0
|
54 <hr>
|
d@0
|
55 </div>
|
d@0
|
56
|
d@0
|
57 <h3 class="section">6.4 MPI data distribution</h3>
|
d@0
|
58
|
d@0
|
59 <p><a name="index-data-distribution-350"></a>
|
d@0
|
60 The most important concept to understand in using FFTW's MPI interface
|
d@0
|
61 is the data distribution. With a serial or multithreaded FFT, all of
|
d@0
|
62 the input and outputs are stored as a single contiguous chunk of
|
d@0
|
63 memory. With a distributed-memory FFT, the inputs and outputs are
|
d@0
|
64 broken into disjoint blocks, one per process.
|
d@0
|
65
|
d@0
|
66 <p>In particular, FFTW uses a <em>1d block distribution</em> of the data,
|
d@0
|
67 distributed along the <em>first dimension</em>. For example, if you
|
d@0
|
68 want to perform a 100 × 200 complex DFT, distributed over 4
|
d@0
|
69 processes, each process will get a 25 × 200 slice of the data.
|
d@0
|
70 That is, process 0 will get rows 0 through 24, process 1 will get rows
|
d@0
|
71 25 through 49, process 2 will get rows 50 through 74, and process 3
|
d@0
|
72 will get rows 75 through 99. If you take the same array but
|
d@0
|
73 distribute it over 3 processes, then it is not evenly divisible so the
|
d@0
|
74 different processes will have unequal chunks. FFTW's default choice
|
d@0
|
75 in this case is to assign 34 rows to processes 0 and 1, and 32 rows to
|
d@0
|
76 process 2.
|
d@0
|
77 <a name="index-block-distribution-351"></a>
|
d@0
|
78 FFTW provides several `<samp><span class="samp">fftw_mpi_local_size</span></samp>' routines that you can
|
d@0
|
79 call to find out what portion of an array is stored on the current
|
d@0
|
80 process. In most cases, you should use the default block sizes picked
|
d@0
|
81 by FFTW, but it is also possible to specify your own block size. For
|
d@0
|
82 example, with a 100 × 200 array on three processes, you can
|
d@0
|
83 tell FFTW to use a block size of 40, which would assign 40 rows to
|
d@0
|
84 processes 0 and 1, and 20 rows to process 2. FFTW's default is to
|
d@0
|
85 divide the data equally among the processes if possible, and as best
|
d@0
|
86 it can otherwise. The rows are always assigned in “rank order,”
|
d@0
|
87 i.e. process 0 gets the first block of rows, then process 1, and so
|
d@0
|
88 on. (You can change this by using <code>MPI_Comm_split</code> to create a
|
d@0
|
89 new communicator with re-ordered processes.) However, you should
|
d@0
|
90 always call the `<samp><span class="samp">fftw_mpi_local_size</span></samp>' routines, if possible,
|
d@0
|
91 rather than trying to predict FFTW's distribution choices.
|
d@0
|
92
|
d@0
|
93 <ul class="menu">
|
d@0
|
94 <li><a accesskey="1" href="Basic-and-advanced-distribution-interfaces.html#Basic-and-advanced-distribution-interfaces">Basic and advanced distribution interfaces</a>
|
d@0
|
95 <li><a accesskey="2" href="Load-balancing.html#Load-balancing">Load balancing</a>
|
d@0
|
96 <li><a accesskey="3" href="Transposed-distributions.html#Transposed-distributions">Transposed distributions</a>
|
d@0
|
97 <li><a accesskey="4" href="One_002ddimensional-distributions.html#One_002ddimensional-distributions">One-dimensional distributions</a>
|
d@0
|
98 </ul>
|
d@0
|
99
|
d@0
|
100 </body></html>
|
d@0
|
101
|