/usr/share/doc/libfftw3-doc/html/Basic-and-advanced-distribution-interfaces.html is in libfftw3-doc 3.3.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | <!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.7, 29 October 2017).
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.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Basic and advanced distribution interfaces (FFTW 3.3.7)</title>
<meta name="description" content="Basic and advanced distribution interfaces (FFTW 3.3.7)">
<meta name="keywords" content="Basic and advanced distribution interfaces (FFTW 3.3.7)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="MPI-Data-Distribution.html#MPI-Data-Distribution" rel="up" title="MPI Data Distribution">
<link href="Load-balancing.html#Load-balancing" rel="next" title="Load balancing">
<link href="MPI-Data-Distribution.html#MPI-Data-Distribution" rel="prev" title="MPI Data Distribution">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {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}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
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">
<a name="Basic-and-advanced-distribution-interfaces"></a>
<div class="header">
<p>
Next: <a href="Load-balancing.html#Load-balancing" accesskey="n" rel="next">Load balancing</a>, Previous: <a href="MPI-Data-Distribution.html#MPI-Data-Distribution" accesskey="p" rel="prev">MPI Data Distribution</a>, Up: <a href="MPI-Data-Distribution.html#MPI-Data-Distribution" accesskey="u" rel="up">MPI Data Distribution</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Basic-and-advanced-distribution-interfaces-1"></a>
<h4 class="subsection">6.4.1 Basic and advanced distribution interfaces</h4>
<p>As with the planner interface, the ‘<samp>fftw_mpi_local_size</samp>’
distribution interface is broken into basic and advanced
(‘<samp>_many</samp>’) interfaces, where the latter allows you to specify the
block size manually and also to request block sizes when computing
multiple transforms simultaneously. These functions are documented
more exhaustively by the FFTW MPI Reference, but we summarize the
basic ideas here using a couple of two-dimensional examples.
</p>
<p>For the 100 × 200
complex-DFT example, above, we would find
the distribution by calling the following function in the basic
interface:
</p>
<div class="example">
<pre class="example">ptrdiff_t fftw_mpi_local_size_2d(ptrdiff_t n0, ptrdiff_t n1, MPI_Comm comm,
ptrdiff_t *local_n0, ptrdiff_t *local_0_start);
</pre></div>
<a name="index-fftw_005fmpi_005flocal_005fsize_005f2d-1"></a>
<p>Given the total size of the data to be transformed (here, <code>n0 =
100</code> and <code>n1 = 200</code>) and an MPI communicator (<code>comm</code>), this
function provides three numbers.
</p>
<p>First, it describes the shape of the local data: the current process
should store a <code>local_n0</code> by <code>n1</code> slice of the overall
dataset, in row-major order (<code>n1</code> dimension contiguous), starting
at index <code>local_0_start</code>. That is, if the total dataset is
viewed as a <code>n0</code> by <code>n1</code> matrix, the current process should
store the rows <code>local_0_start</code> to
<code>local_0_start+local_n0-1</code>. Obviously, if you are running with
only a single MPI process, that process will store the entire array:
<code>local_0_start</code> will be zero and <code>local_n0</code> will be
<code>n0</code>. See <a href="Row_002dmajor-Format.html#Row_002dmajor-Format">Row-major Format</a>.
<a name="index-row_002dmajor-4"></a>
</p>
<p>Second, the return value is the total number of data elements (e.g.,
complex numbers for a complex DFT) that should be allocated for the
input and output arrays on the current process (ideally with
<code>fftw_malloc</code> or an ‘<samp>fftw_alloc</samp>’ function, to ensure optimal
alignment). It might seem that this should always be equal to
<code>local_n0 * n1</code>, but this is <em>not</em> the case. FFTW’s
distributed FFT algorithms require data redistributions at
intermediate stages of the transform, and in some circumstances this
may require slightly larger local storage. This is discussed in more
detail below, under <a href="Load-balancing.html#Load-balancing">Load balancing</a>.
<a name="index-fftw_005fmalloc-5"></a>
<a name="index-fftw_005falloc_005fcomplex-3"></a>
</p>
<a name="index-advanced-interface-4"></a>
<p>The advanced-interface ‘<samp>local_size</samp>’ function for multidimensional
transforms returns the same three things (<code>local_n0</code>,
<code>local_0_start</code>, and the total number of elements to allocate),
but takes more inputs:
</p>
<div class="example">
<pre class="example">ptrdiff_t fftw_mpi_local_size_many(int rnk, const ptrdiff_t *n,
ptrdiff_t howmany,
ptrdiff_t block0,
MPI_Comm comm,
ptrdiff_t *local_n0,
ptrdiff_t *local_0_start);
</pre></div>
<a name="index-fftw_005fmpi_005flocal_005fsize_005fmany"></a>
<p>The two-dimensional case above corresponds to <code>rnk = 2</code> and an
array <code>n</code> of length 2 with <code>n[0] = n0</code> and <code>n[1] = n1</code>.
This routine is for any <code>rnk > 1</code>; one-dimensional transforms
have their own interface because they work slightly differently, as
discussed below.
</p>
<p>First, the advanced interface allows you to perform multiple
transforms at once, of interleaved data, as specified by the
<code>howmany</code> parameter. (<code>hoamany</code> is 1 for a single
transform.)
</p>
<p>Second, here you can specify your desired block size in the <code>n0</code>
dimension, <code>block0</code>. To use FFTW’s default block size, pass
<code>FFTW_MPI_DEFAULT_BLOCK</code> (0) for <code>block0</code>. Otherwise, on
<code>P</code> processes, FFTW will return <code>local_n0</code> equal to
<code>block0</code> on the first <code>P / block0</code> processes (rounded down),
return <code>local_n0</code> equal to <code>n0 - block0 * (P / block0)</code> on
the next process, and <code>local_n0</code> equal to zero on any remaining
processes. In general, we recommend using the default block size
(which corresponds to <code>n0 / P</code>, rounded up).
<a name="index-FFTW_005fMPI_005fDEFAULT_005fBLOCK"></a>
<a name="index-block-distribution-1"></a>
</p>
<p>For example, suppose you have <code>P = 4</code> processes and <code>n0 =
21</code>. The default will be a block size of <code>6</code>, which will give
<code>local_n0 = 6</code> on the first three processes and <code>local_n0 =
3</code> on the last process. Instead, however, you could specify
<code>block0 = 5</code> if you wanted, which would give <code>local_n0 = 5</code>
on processes 0 to 2, <code>local_n0 = 6</code> on process 3. (This choice,
while it may look superficially more “balanced,” has the same
critical path as FFTW’s default but requires more communications.)
</p>
<hr>
<div class="header">
<p>
Next: <a href="Load-balancing.html#Load-balancing" accesskey="n" rel="next">Load balancing</a>, Previous: <a href="MPI-Data-Distribution.html#MPI-Data-Distribution" accesskey="p" rel="prev">MPI Data Distribution</a>, Up: <a href="MPI-Data-Distribution.html#MPI-Data-Distribution" accesskey="u" rel="up">MPI Data Distribution</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|