cannam@95: <html lang="en">
cannam@95: <head>
cannam@95: <title>Using MPI Plans - FFTW 3.3.3</title>
cannam@95: <meta http-equiv="Content-Type" content="text/html">
cannam@95: <meta name="description" content="FFTW 3.3.3">
cannam@95: <meta name="generator" content="makeinfo 4.13">
cannam@95: <link title="Top" rel="start" href="index.html#Top">
cannam@95: <link rel="up" href="FFTW-MPI-Reference.html#FFTW-MPI-Reference" title="FFTW MPI Reference">
cannam@95: <link rel="prev" href="MPI-Initialization.html#MPI-Initialization" title="MPI Initialization">
cannam@95: <link rel="next" href="MPI-Data-Distribution-Functions.html#MPI-Data-Distribution-Functions" title="MPI Data Distribution Functions">
cannam@95: <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
cannam@95: <!--
cannam@95: This manual is for FFTW
cannam@95: (version 3.3.3, 25 November 2012).
cannam@95: 
cannam@95: Copyright (C) 2003 Matteo Frigo.
cannam@95: 
cannam@95: Copyright (C) 2003 Massachusetts Institute of Technology.
cannam@95: 
cannam@95:      Permission is granted to make and distribute verbatim copies of
cannam@95:      this manual provided the copyright notice and this permission
cannam@95:      notice are preserved on all copies.
cannam@95: 
cannam@95:      Permission is granted to copy and distribute modified versions of
cannam@95:      this manual under the conditions for verbatim copying, provided
cannam@95:      that the entire resulting derived work is distributed under the
cannam@95:      terms of a permission notice identical to this one.
cannam@95: 
cannam@95:      Permission is granted to copy and distribute translations of this
cannam@95:      manual into another language, under the above conditions for
cannam@95:      modified versions, except that this permission notice may be
cannam@95:      stated in a translation approved by the Free Software Foundation.
cannam@95:    -->
cannam@95: <meta http-equiv="Content-Style-Type" content="text/css">
cannam@95: <style type="text/css"><!--
cannam@95:   pre.display { font-family:inherit }
cannam@95:   pre.format  { font-family:inherit }
cannam@95:   pre.smalldisplay { font-family:inherit; font-size:smaller }
cannam@95:   pre.smallformat  { font-family:inherit; font-size:smaller }
cannam@95:   pre.smallexample { font-size:smaller }
cannam@95:   pre.smalllisp    { font-size:smaller }
cannam@95:   span.sc    { font-variant:small-caps }
cannam@95:   span.roman { font-family:serif; font-weight:normal; } 
cannam@95:   span.sansserif { font-family:sans-serif; font-weight:normal; } 
cannam@95: --></style>
cannam@95: </head>
cannam@95: <body>
cannam@95: <div class="node">
cannam@95: <a name="Using-MPI-Plans"></a>
cannam@95: <p>
cannam@95: Next:&nbsp;<a rel="next" accesskey="n" href="MPI-Data-Distribution-Functions.html#MPI-Data-Distribution-Functions">MPI Data Distribution Functions</a>,
cannam@95: Previous:&nbsp;<a rel="previous" accesskey="p" href="MPI-Initialization.html#MPI-Initialization">MPI Initialization</a>,
cannam@95: Up:&nbsp;<a rel="up" accesskey="u" href="FFTW-MPI-Reference.html#FFTW-MPI-Reference">FFTW MPI Reference</a>
cannam@95: <hr>
cannam@95: </div>
cannam@95: 
cannam@95: <h4 class="subsection">6.12.3 Using MPI Plans</h4>
cannam@95: 
cannam@95: <p>Once an MPI plan is created, you can execute and destroy it using
cannam@95: <code>fftw_execute</code>, <code>fftw_destroy_plan</code>, and the other functions
cannam@95: in the serial interface that operate on generic plans (see <a href="Using-Plans.html#Using-Plans">Using Plans</a>).
cannam@95: 
cannam@95:    <p><a name="index-collective-function-438"></a><a name="index-MPI-communicator-439"></a>The <code>fftw_execute</code> and <code>fftw_destroy_plan</code> functions, applied to
cannam@95: MPI plans, are <em>collective</em> calls: they must be called for all processes
cannam@95: in the communicator that was used to create the plan.
cannam@95: 
cannam@95:    <p><a name="index-new_002darray-execution-440"></a>You must <em>not</em> use the serial new-array plan-execution functions
cannam@95: <code>fftw_execute_dft</code> and so on (see <a href="New_002darray-Execute-Functions.html#New_002darray-Execute-Functions">New-array Execute Functions</a>) with MPI plans.  Such functions are specialized to the
cannam@95: problem type, and there are specific new-array execute functions for MPI plans:
cannam@95: 
cannam@95:    <p><a name="index-fftw_005fmpi_005fexecute_005fdft-441"></a><a name="index-fftw_005fmpi_005fexecute_005fdft_005fr2c-442"></a><a name="index-fftw_005fmpi_005fexecute_005fdft_005fc2r-443"></a><a name="index-fftw_005fmpi_005fexecute_005fr2r-444"></a>
cannam@95: <pre class="example">     void fftw_mpi_execute_dft(fftw_plan p, fftw_complex *in, fftw_complex *out);
cannam@95:      void fftw_mpi_execute_dft_r2c(fftw_plan p, double *in, fftw_complex *out);
cannam@95:      void fftw_mpi_execute_dft_c2r(fftw_plan p, fftw_complex *in, double *out);
cannam@95:      void fftw_mpi_execute_r2r(fftw_plan p, double *in, double *out);
cannam@95: </pre>
cannam@95:    <p><a name="index-alignment-445"></a><a name="index-fftw_005fmalloc-446"></a>These functions have the same restrictions as those of the serial
cannam@95: new-array execute functions.  They are <em>always</em> safe to apply to
cannam@95: the <em>same</em> <code>in</code> and <code>out</code> arrays that were used to
cannam@95: create the plan.  They can only be applied to new arrarys if those
cannam@95: arrays have the same types, dimensions, in-placeness, and alignment as
cannam@95: the original arrays, where the best way to ensure the same alignment
cannam@95: is to use FFTW's <code>fftw_malloc</code> and related allocation functions
cannam@95: for all arrays (see <a href="Memory-Allocation.html#Memory-Allocation">Memory Allocation</a>).  Note that distributed
cannam@95: transposes (see <a href="FFTW-MPI-Transposes.html#FFTW-MPI-Transposes">FFTW MPI Transposes</a>) use
cannam@95: <code>fftw_mpi_execute_r2r</code>, since they count as rank-zero r2r plans
cannam@95: from FFTW's perspective.
cannam@95: 
cannam@95:    </body></html>
cannam@95: