annotate src/fftw-3.3.3/doc/html/An-improved-replacement-for-MPI_005fAlltoall.html @ 106:532785b0ac5f

Ranlib
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 25 Mar 2013 16:29:40 +0000
parents 89f5e221ed7b
children
rev   line source
cannam@95 1 <html lang="en">
cannam@95 2 <head>
cannam@95 3 <title>An improved replacement for MPI_Alltoall - 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="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes" title="FFTW MPI Transposes">
cannam@95 9 <link rel="prev" href="Advanced-distributed_002dtranspose-interface.html#Advanced-distributed_002dtranspose-interface" title="Advanced distributed-transpose interface">
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="An-improved-replacement-for-MPI_Alltoall"></a>
cannam@95 49 <a name="An-improved-replacement-for-MPI_005fAlltoall"></a>
cannam@95 50 <p>
cannam@95 51 Previous:&nbsp;<a rel="previous" accesskey="p" href="Advanced-distributed_002dtranspose-interface.html#Advanced-distributed_002dtranspose-interface">Advanced distributed-transpose interface</a>,
cannam@95 52 Up:&nbsp;<a rel="up" accesskey="u" href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes">FFTW MPI Transposes</a>
cannam@95 53 <hr>
cannam@95 54 </div>
cannam@95 55
cannam@95 56 <h4 class="subsection">6.7.3 An improved replacement for MPI_Alltoall</h4>
cannam@95 57
cannam@95 58 <p>We close this section by noting that FFTW's MPI transpose routines can
cannam@95 59 be thought of as a generalization for the <code>MPI_Alltoall</code> function
cannam@95 60 (albeit only for floating-point types), and in some circumstances can
cannam@95 61 function as an improved replacement.
cannam@95 62 <a name="index-MPI_005fAlltoall-406"></a>
cannam@95 63
cannam@95 64 <p><code>MPI_Alltoall</code> is defined by the MPI standard as:
cannam@95 65
cannam@95 66 <pre class="example"> int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
cannam@95 67 void *recvbuf, int recvcnt, MPI_Datatype recvtype,
cannam@95 68 MPI_Comm comm);
cannam@95 69 </pre>
cannam@95 70 <p>In particular, for <code>double*</code> arrays <code>in</code> and <code>out</code>,
cannam@95 71 consider the call:
cannam@95 72
cannam@95 73 <pre class="example"> MPI_Alltoall(in, howmany, MPI_DOUBLE, out, howmany MPI_DOUBLE, comm);
cannam@95 74 </pre>
cannam@95 75 <p>This is completely equivalent to:
cannam@95 76
cannam@95 77 <pre class="example"> MPI_Comm_size(comm, &amp;P);
cannam@95 78 plan = fftw_mpi_plan_many_transpose(P, P, howmany, 1, 1, in, out, comm, FFTW_ESTIMATE);
cannam@95 79 fftw_execute(plan);
cannam@95 80 fftw_destroy_plan(plan);
cannam@95 81 </pre>
cannam@95 82 <p>That is, computing a P&nbsp;&times;&nbsp;P transpose on <code>P</code> processes,
cannam@95 83 with a block size of 1, is just a standard all-to-all communication.
cannam@95 84
cannam@95 85 <p>However, using the FFTW routine instead of <code>MPI_Alltoall</code> may
cannam@95 86 have certain advantages. First of all, FFTW's routine can operate
cannam@95 87 in-place (<code>in == out</code>) whereas <code>MPI_Alltoall</code> can only
cannam@95 88 operate out-of-place.
cannam@95 89 <a name="index-in_002dplace-407"></a>
cannam@95 90
cannam@95 91 <p>Second, even for out-of-place plans, FFTW's routine may be faster,
cannam@95 92 especially if you need to perform the all-to-all communication many
cannam@95 93 times and can afford to use <code>FFTW_MEASURE</code> or
cannam@95 94 <code>FFTW_PATIENT</code>. It should certainly be no slower, not including
cannam@95 95 the time to create the plan, since one of the possible algorithms that
cannam@95 96 FFTW uses for an out-of-place transpose <em>is</em> simply to call
cannam@95 97 <code>MPI_Alltoall</code>. However, FFTW also considers several other
cannam@95 98 possible algorithms that, depending on your MPI implementation and
cannam@95 99 your hardware, may be faster.
cannam@95 100 <a name="index-FFTW_005fMEASURE-408"></a><a name="index-FFTW_005fPATIENT-409"></a>
cannam@95 101 <!-- -->
cannam@95 102
cannam@95 103 </body></html>
cannam@95 104