757cbe25c2937ef387b9f76bad83d26c405fbffe
[platform/upstream/boost.git] / doc / html / boost / mpi / scatter.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Function scatter</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="../../mpi/reference.html#header.boost.mpi.collectives_hpp" title="Header &lt;boost/mpi/collectives.hpp&gt;">
9 <link rel="prev" href="gather.html" title="Function gather">
10 <link rel="next" href="reduce.html" title="Function reduce">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15 <td align="center"><a href="../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="gather.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../mpi/reference.html#header.boost.mpi.collectives_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="reduce.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="refentry">
26 <a name="boost.mpi.scatter"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Function scatter</span></h2>
29 <p>boost::mpi::scatter &#8212; Scatter the values stored at the root to all processes within the communicator. </p>
30 </div>
31 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
32 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../mpi/reference.html#header.boost.mpi.collectives_hpp" title="Header &lt;boost/mpi/collectives.hpp&gt;">boost/mpi/collectives.hpp</a>&gt;
33
34 </span>
35 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
36   <span class="keyword">void</span> <span class="identifier">scatter</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="communicator.html" title="Class communicator">communicator</a> <span class="special">&amp;</span> comm<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> in_values<span class="special">,</span> 
37                <span class="identifier">T</span> <span class="special">&amp;</span> out_value<span class="special">,</span> <span class="keyword">int</span> root<span class="special">)</span><span class="special">;</span>
38 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
39   <span class="keyword">void</span> <span class="identifier">scatter</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="communicator.html" title="Class communicator">communicator</a> <span class="special">&amp;</span> comm<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="special">*</span> in_values<span class="special">,</span> <span class="identifier">T</span> <span class="special">&amp;</span> out_value<span class="special">,</span> 
40                <span class="keyword">int</span> root<span class="special">)</span><span class="special">;</span>
41 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
42   <span class="keyword">void</span> <span class="identifier">scatter</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="communicator.html" title="Class communicator">communicator</a> <span class="special">&amp;</span> comm<span class="special">,</span> <span class="identifier">T</span> <span class="special">&amp;</span> out_value<span class="special">,</span> <span class="keyword">int</span> root<span class="special">)</span><span class="special">;</span>
43 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
44   <span class="keyword">void</span> <span class="identifier">scatter</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="communicator.html" title="Class communicator">communicator</a> <span class="special">&amp;</span> comm<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> in_values<span class="special">,</span> 
45                <span class="identifier">T</span> <span class="special">*</span> out_values<span class="special">,</span> <span class="keyword">int</span> n<span class="special">,</span> <span class="keyword">int</span> root<span class="special">)</span><span class="special">;</span>
46 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
47   <span class="keyword">void</span> <span class="identifier">scatter</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="communicator.html" title="Class communicator">communicator</a> <span class="special">&amp;</span> comm<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="special">*</span> in_values<span class="special">,</span> <span class="identifier">T</span> <span class="special">*</span> out_values<span class="special">,</span> 
48                <span class="keyword">int</span> n<span class="special">,</span> <span class="keyword">int</span> root<span class="special">)</span><span class="special">;</span>
49 <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
50   <span class="keyword">void</span> <span class="identifier">scatter</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="communicator.html" title="Class communicator">communicator</a> <span class="special">&amp;</span> comm<span class="special">,</span> <span class="identifier">T</span> <span class="special">*</span> out_values<span class="special">,</span> <span class="keyword">int</span> n<span class="special">,</span> <span class="keyword">int</span> root<span class="special">)</span><span class="special">;</span></pre></div>
51 <div class="refsect1">
52 <a name="id2507154"></a><h2>Description</h2>
53 <p><code class="computeroutput">scatter</code> is a collective algorithm that scatters the values stored in the <code class="computeroutput">root</code> process (inside a vector) to all of the processes in the communicator. The vector <code class="computeroutput">out_values</code> (only significant at the <code class="computeroutput">root</code>) is indexed by the process number to which the corresponding value will be sent. The type <code class="computeroutput">T</code> of the values may be any type that is serializable or has an associated MPI data type.</p>
54 <p>When the type <code class="computeroutput">T</code> has an associated MPI data type, this routine invokes <code class="computeroutput">MPI_Scatter</code> to scatter the values.</p>
55 <p>
56 </p>
57 <div class="variablelist"><table border="0">
58 <col align="left" valign="top">
59 <tbody><tr>
60 <td><p><span class="term">Parameters:</span></p></td>
61 <td><div class="variablelist"><table border="0">
62 <col align="left" valign="top">
63 <tbody>
64 <tr>
65 <td><p><span class="term"><code class="computeroutput">comm</code></span></p></td>
66 <td><p>The communicator over which the gather will occur.</p></td>
67 </tr>
68 <tr>
69 <td><p><span class="term"><code class="computeroutput">in_values</code></span></p></td>
70 <td><p>A vector or pointer to storage that will contain the values to send to each process, indexed by the process rank. For non-root processes, this parameter may be omitted. If it is still provided, however, it will be unchanged.</p></td>
71 </tr>
72 <tr>
73 <td><p><span class="term"><code class="computeroutput">out_value</code></span></p></td>
74 <td><p>The value received by each process. When scattering an array of values, <code class="computeroutput">out_values</code> points to the <code class="computeroutput">n</code> values that will be received by each process.</p></td>
75 </tr>
76 <tr>
77 <td><p><span class="term"><code class="computeroutput">root</code></span></p></td>
78 <td><p>The process ID number that will scatter the values. This value must be the same on all processes. </p></td>
79 </tr>
80 </tbody>
81 </table></div></td>
82 </tr></tbody>
83 </table></div>
84 </div>
85 </div>
86 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
87 <td align="left"></td>
88 <td align="right"><div class="copyright-footer">Copyright &#169; 2005-2007 Douglas Gregor,
89       Matthias Troyer, Trustees of Indiana University<p>
90         Distributed under the Boost Software License, Version 1.0. (See accompanying
91         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
92         http://www.boost.org/LICENSE_1_0.txt </a>)
93       </p>
94 </div></td>
95 </tr></table>
96 <hr>
97 <div class="spirit-nav">
98 <a accesskey="p" href="gather.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../mpi/reference.html#header.boost.mpi.collectives_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="reduce.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
99 </div>
100 </body>
101 </html>