annotate Lib/fftw-3.2.1/doc/html/.svn/text-base/An-improved-replacement-for-MPI_005fAlltoall.html.svn-base @ 0:25bf17994ef1

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