-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMPI_Comm_split.html
173 lines (127 loc) · 3.65 KB
/
MPI_Comm_split.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<!--
SAME AS NELSON SOFTWARE
-->
<head>
<meta name="generator" content=
"HTML Generated by Nelson"/>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" href="mono-blue.css" type="text/css" />
<script src = "highlight.pack.js" type = "text/javascript">
</script>
<script type = "text/javascript">hljs.highlightAll();</script>
</script>
<meta http-equiv="Content-Type" content = "text/html; charset=utf-8" />
<title>MPI_Comm_split</title>
</head>
<body>
<div class = "manualnavbar">
<table width = "100%"><tr>
<td width="30%" class="previous">
<span class="top"><a href="MPI_Comm_size.html"><< MPI_Comm_size</a></span>
</td>
<td width="40%" class="center">
<span class="top"><a href="chapter_mpi.html">Message Passing Interface</a></span>
</td>
<td width = "30%" class = "next">
<span class = "next"><a href = "MPI_Comm_used.html">MPI_Comm_used >></a></span>
</td>
</tr></table>
<hr />
<h1 class="refname">MPI_Comm_split</h1>
<hr/>
<h3>Partitions the group that is associated with the specified communicator into a specified number of disjoint subgroups.</h3>
<hr/>
<h3>Syntax</h3>
<hr/>
<table summary="syntax" style="width:50%">
<tr>
<td>newcomm = MPI_Comm_split(comm, color, key)</td>
</tr>
</table>
<h3>Input argument</h3>
<hr/>
<dl>
<dt><span class="term">comm</span></dt>
<dd>
<p class="para">a MPI_Comm object.</p>
</dd>
<dt><span class="term">color</span></dt>
<dd>
<p class="para">an integer value: The new communicator that the calling process is to be assigned to. The value of color must be non-negative.</p>
</dd>
<dt><span class="term">key</span></dt>
<dd>
<p class="para">an integer value: The relative rank of the calling process in the group of the new communicator.</p>
</dd>
</dl>
<h3>Output argument</h3>
<hr/>
<dl>
<dt><span class="term">newcomm</span></dt>
<dd>
<p class="para">MPI_Comm object: handle to a new communicator.</p>
</dd>
</dl>
<h3>Description</h3>
<hr/>
<p></p>
<p>Partitions the group that is associated with the specified communicator into a specified number of disjoint subgroups.</p>
<h3>See also</h3>
<hr/>
<p>
<a href = "MPI_Comm_rank.html" class = "link">MPI_Comm_rank</a>.</p>
<h3>Example</h3>
<hr/>
<p>mpiexec([modulepath('mpi'), '/examples/help_examples/MPI_Comm_split.m'], 10)</p>
<pre>
<code class = "nelson">if ~MPI_Initialized()
MPI_Init();
end
comm = MPI_Comm_object();
world_rank = MPI_Comm_rank();
world_size = MPI_Comm_size();
color = world_rank * inv(4);
% Split the communicator based on the color and use the
% original rank for ordering
row_comm = MPI_Comm_split(comm, color, world_rank);
row_rank = MPI_Comm_rank();
row_size = MPI_Comm_size();
disp(['WORLD RANK/SIZE: ',int2str(world_rank), '/', int2str(world_size), ' ROW RANK/SIZE: ', int2str(row_rank), '/', int2str(row_size)]);
if MPI_Initialized()
MPI_Finalize();
end
</code>
</pre>
<h3>History</h3>
<hr/>
<table summary = "history" style="width:50%">
<tr>
<th>Version</th>
<th>Description</th>
</tr>
<tr>
<td>1.0.0</td>
<td>initial version</td>
</tr>
</table>
<h3>Author</h3>
<hr/>
<p>Allan CORNET</p>
<div class = "manualnavbar">
<table width = "100%"><tr>
<td width="30%" class="previous">
<span class="top"><a href="MPI_Comm_size.html"><< MPI_Comm_size</a></span>
</td>
<td width="40%" class="center">
<span class="top"><a href="chapter_mpi.html">Message Passing Interface</a></span>
</td>
<td width = "30%" class = "next">
<span class = "next"><a href = "MPI_Comm_used.html">MPI_Comm_used >></a></span>
</td>
</tr></table>
<hr />
</body>
</html>