122 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			122 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 | |
| <html>
 | |
| <!-- This manual is for FFTW
 | |
| (version 3.3.10, 10 December 2020).
 | |
| 
 | |
| Copyright (C) 2003 Matteo Frigo.
 | |
| 
 | |
| Copyright (C) 2003 Massachusetts Institute of Technology.
 | |
| 
 | |
| Permission is granted to make and distribute verbatim copies of this
 | |
| manual provided the copyright notice and this permission notice are
 | |
| preserved on all copies.
 | |
| 
 | |
| Permission is granted to copy and distribute modified versions of this
 | |
| manual under the conditions for verbatim copying, provided that the
 | |
| entire resulting derived work is distributed under the terms of a
 | |
| permission notice identical to this one.
 | |
| 
 | |
| Permission is granted to copy and distribute translations of this manual
 | |
| into another language, under the above conditions for modified versions,
 | |
| except that this permission notice may be stated in a translation
 | |
| approved by the Free Software Foundation. -->
 | |
| <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
 | |
| <head>
 | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 | |
| <title>Other Multi-dimensional Real-data MPI Transforms (FFTW 3.3.10)</title>
 | |
| 
 | |
| <meta name="description" content="Other Multi-dimensional Real-data MPI Transforms (FFTW 3.3.10)">
 | |
| <meta name="keywords" content="Other Multi-dimensional Real-data MPI Transforms (FFTW 3.3.10)">
 | |
| <meta name="resource-type" content="document">
 | |
| <meta name="distribution" content="global">
 | |
| <meta name="Generator" content="makeinfo">
 | |
| <link href="index.html" rel="start" title="Top">
 | |
| <link href="Concept-Index.html" rel="index" title="Concept Index">
 | |
| <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
 | |
| <link href="Distributed_002dmemory-FFTW-with-MPI.html" rel="up" title="Distributed-memory FFTW with MPI">
 | |
| <link href="FFTW-MPI-Transposes.html" rel="next" title="FFTW MPI Transposes">
 | |
| <link href="Multi_002ddimensional-MPI-DFTs-of-Real-Data.html" rel="prev" title="Multi-dimensional MPI DFTs of Real Data">
 | |
| <style type="text/css">
 | |
| <!--
 | |
| a.summary-letter {text-decoration: none}
 | |
| blockquote.indentedblock {margin-right: 0em}
 | |
| div.display {margin-left: 3.2em}
 | |
| div.example {margin-left: 3.2em}
 | |
| div.lisp {margin-left: 3.2em}
 | |
| kbd {font-style: oblique}
 | |
| pre.display {font-family: inherit}
 | |
| pre.format {font-family: inherit}
 | |
| pre.menu-comment {font-family: serif}
 | |
| pre.menu-preformatted {font-family: serif}
 | |
| span.nolinebreak {white-space: nowrap}
 | |
| span.roman {font-family: initial; font-weight: normal}
 | |
| span.sansserif {font-family: sans-serif; font-weight: normal}
 | |
| ul.no-bullet {list-style: none}
 | |
| -->
 | |
| </style>
 | |
| 
 | |
| 
 | |
| </head>
 | |
| 
 | |
| <body lang="en">
 | |
| <span id="Other-Multi_002ddimensional-Real_002ddata-MPI-Transforms"></span><div class="header">
 | |
| <p>
 | |
| Next: <a href="FFTW-MPI-Transposes.html" accesskey="n" rel="next">FFTW MPI Transposes</a>, Previous: <a href="Multi_002ddimensional-MPI-DFTs-of-Real-Data.html" accesskey="p" rel="prev">Multi-dimensional MPI DFTs of Real Data</a>, Up: <a href="Distributed_002dmemory-FFTW-with-MPI.html" accesskey="u" rel="up">Distributed-memory FFTW with MPI</a>   [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
 | |
| </div>
 | |
| <hr>
 | |
| <span id="Other-multi_002ddimensional-Real_002dData-MPI-Transforms"></span><h3 class="section">6.6 Other multi-dimensional Real-Data MPI Transforms</h3>
 | |
| 
 | |
| <span id="index-r2r-3"></span>
 | |
| <p>FFTW’s MPI interface also supports multi-dimensional ‘<samp>r2r</samp>’
 | |
| transforms of all kinds supported by the serial interface
 | |
| (e.g. discrete cosine and sine transforms, discrete Hartley
 | |
| transforms, etc.).  Only multi-dimensional ‘<samp>r2r</samp>’ transforms, not
 | |
| one-dimensional transforms, are currently parallelized.
 | |
| </p>
 | |
| <span id="index-fftw_005fr2r_005fkind-1"></span>
 | |
| <p>These are used much like the multidimensional complex DFTs discussed
 | |
| above, except that the data is real rather than complex, and one needs
 | |
| to pass an r2r transform kind (<code>fftw_r2r_kind</code>) for each
 | |
| dimension as in the serial FFTW (see <a href="More-DFTs-of-Real-Data.html">More DFTs of Real Data</a>).
 | |
| </p>
 | |
| <p>For example, one might perform a two-dimensional L × M
 | |
|  that is
 | |
| an REDFT10 (DCT-II) in the first dimension and an RODFT10 (DST-II) in
 | |
| the second dimension with code like:
 | |
| </p>
 | |
| <div class="example">
 | |
| <pre class="example">    const ptrdiff_t L = ..., M = ...;
 | |
|     fftw_plan plan;
 | |
|     double *data;
 | |
|     ptrdiff_t alloc_local, local_n0, local_0_start, i, j;
 | |
| 
 | |
|     /* <span class="roman">get local data size and allocate</span> */
 | |
|     alloc_local = fftw_mpi_local_size_2d(L, M, MPI_COMM_WORLD,
 | |
|                                          &local_n0, &local_0_start);
 | |
|     data = fftw_alloc_real(alloc_local);
 | |
| 
 | |
|     /* <span class="roman">create plan for in-place REDFT10 x RODFT10</span> */
 | |
|     plan = fftw_mpi_plan_r2r_2d(L, M, data, data, MPI_COMM_WORLD,
 | |
|                                 FFTW_REDFT10, FFTW_RODFT10, FFTW_MEASURE);
 | |
| 
 | |
|     /* <span class="roman">initialize data to some function</span> my_function(x,y) */
 | |
|     for (i = 0; i < local_n0; ++i) for (j = 0; j < M; ++j)
 | |
|        data[i*M + j] = my_function(local_0_start + i, j);
 | |
| 
 | |
|     /* <span class="roman">compute transforms, in-place, as many times as desired</span> */
 | |
|     fftw_execute(plan);
 | |
| 
 | |
|     fftw_destroy_plan(plan);
 | |
| </pre></div>
 | |
| 
 | |
| <span id="index-fftw_005falloc_005freal-3"></span>
 | |
| <p>Notice that we use the same ‘<samp>local_size</samp>’ functions as we did for
 | |
| complex data, only now we interpret the sizes in terms of real rather
 | |
| than complex values, and correspondingly use <code>fftw_alloc_real</code>.
 | |
| </p>
 | |
| 
 | |
| 
 | |
| 
 | |
| </body>
 | |
| </html>
 | 
