Mercurial > hg > sv-dependency-builds
comparison src/fftw-3.3.3/doc/html/An-improved-replacement-for-MPI_005fAlltoall.html @ 10:37bf6b4a2645
Add FFTW3
author | Chris Cannam |
---|---|
date | Wed, 20 Mar 2013 15:35:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9:c0fb53affa76 | 10:37bf6b4a2645 |
---|---|
1 <html lang="en"> | |
2 <head> | |
3 <title>An improved replacement for MPI_Alltoall - FFTW 3.3.3</title> | |
4 <meta http-equiv="Content-Type" content="text/html"> | |
5 <meta name="description" content="FFTW 3.3.3"> | |
6 <meta name="generator" content="makeinfo 4.13"> | |
7 <link title="Top" rel="start" href="index.html#Top"> | |
8 <link rel="up" href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes" title="FFTW MPI Transposes"> | |
9 <link rel="prev" href="Advanced-distributed_002dtranspose-interface.html#Advanced-distributed_002dtranspose-interface" title="Advanced distributed-transpose interface"> | |
10 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> | |
11 <!-- | |
12 This manual is for FFTW | |
13 (version 3.3.3, 25 November 2012). | |
14 | |
15 Copyright (C) 2003 Matteo Frigo. | |
16 | |
17 Copyright (C) 2003 Massachusetts Institute of Technology. | |
18 | |
19 Permission is granted to make and distribute verbatim copies of | |
20 this manual provided the copyright notice and this permission | |
21 notice are preserved on all copies. | |
22 | |
23 Permission is granted to copy and distribute modified versions of | |
24 this manual under the conditions for verbatim copying, provided | |
25 that the entire resulting derived work is distributed under the | |
26 terms of a permission notice identical to this one. | |
27 | |
28 Permission is granted to copy and distribute translations of this | |
29 manual into another language, under the above conditions for | |
30 modified versions, except that this permission notice may be | |
31 stated in a translation approved by the Free Software Foundation. | |
32 --> | |
33 <meta http-equiv="Content-Style-Type" content="text/css"> | |
34 <style type="text/css"><!-- | |
35 pre.display { font-family:inherit } | |
36 pre.format { font-family:inherit } | |
37 pre.smalldisplay { font-family:inherit; font-size:smaller } | |
38 pre.smallformat { font-family:inherit; font-size:smaller } | |
39 pre.smallexample { font-size:smaller } | |
40 pre.smalllisp { font-size:smaller } | |
41 span.sc { font-variant:small-caps } | |
42 span.roman { font-family:serif; font-weight:normal; } | |
43 span.sansserif { font-family:sans-serif; font-weight:normal; } | |
44 --></style> | |
45 </head> | |
46 <body> | |
47 <div class="node"> | |
48 <a name="An-improved-replacement-for-MPI_Alltoall"></a> | |
49 <a name="An-improved-replacement-for-MPI_005fAlltoall"></a> | |
50 <p> | |
51 Previous: <a rel="previous" accesskey="p" href="Advanced-distributed_002dtranspose-interface.html#Advanced-distributed_002dtranspose-interface">Advanced distributed-transpose interface</a>, | |
52 Up: <a rel="up" accesskey="u" href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes">FFTW MPI Transposes</a> | |
53 <hr> | |
54 </div> | |
55 | |
56 <h4 class="subsection">6.7.3 An improved replacement for MPI_Alltoall</h4> | |
57 | |
58 <p>We close this section by noting that FFTW's MPI transpose routines can | |
59 be thought of as a generalization for the <code>MPI_Alltoall</code> function | |
60 (albeit only for floating-point types), and in some circumstances can | |
61 function as an improved replacement. | |
62 <a name="index-MPI_005fAlltoall-406"></a> | |
63 | |
64 <p><code>MPI_Alltoall</code> is defined by the MPI standard as: | |
65 | |
66 <pre class="example"> int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, | |
67 void *recvbuf, int recvcnt, MPI_Datatype recvtype, | |
68 MPI_Comm comm); | |
69 </pre> | |
70 <p>In particular, for <code>double*</code> arrays <code>in</code> and <code>out</code>, | |
71 consider the call: | |
72 | |
73 <pre class="example"> MPI_Alltoall(in, howmany, MPI_DOUBLE, out, howmany MPI_DOUBLE, comm); | |
74 </pre> | |
75 <p>This is completely equivalent to: | |
76 | |
77 <pre class="example"> MPI_Comm_size(comm, &P); | |
78 plan = fftw_mpi_plan_many_transpose(P, P, howmany, 1, 1, in, out, comm, FFTW_ESTIMATE); | |
79 fftw_execute(plan); | |
80 fftw_destroy_plan(plan); | |
81 </pre> | |
82 <p>That is, computing a P × P transpose on <code>P</code> processes, | |
83 with a block size of 1, is just a standard all-to-all communication. | |
84 | |
85 <p>However, using the FFTW routine instead of <code>MPI_Alltoall</code> may | |
86 have certain advantages. First of all, FFTW's routine can operate | |
87 in-place (<code>in == out</code>) whereas <code>MPI_Alltoall</code> can only | |
88 operate out-of-place. | |
89 <a name="index-in_002dplace-407"></a> | |
90 | |
91 <p>Second, even for out-of-place plans, FFTW's routine may be faster, | |
92 especially if you need to perform the all-to-all communication many | |
93 times and can afford to use <code>FFTW_MEASURE</code> or | |
94 <code>FFTW_PATIENT</code>. It should certainly be no slower, not including | |
95 the time to create the plan, since one of the possible algorithms that | |
96 FFTW uses for an out-of-place transpose <em>is</em> simply to call | |
97 <code>MPI_Alltoall</code>. However, FFTW also considers several other | |
98 possible algorithms that, depending on your MPI implementation and | |
99 your hardware, may be faster. | |
100 <a name="index-FFTW_005fMEASURE-408"></a><a name="index-FFTW_005fPATIENT-409"></a> | |
101 <!-- --> | |
102 | |
103 </body></html> | |
104 |