Skip to content

Commit 4755f91

Browse files
authored
Merge pull request #6829 from garlick/clique_term
doc: update glossary with parallel program terms + trivial broker cleanup
2 parents 087cd3e + 7cbe95a commit 4755f91

File tree

3 files changed

+36
-34
lines changed

3 files changed

+36
-34
lines changed

doc/guide/glossary.rst

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ used in our documentation that may not be familiar to all readers.
66

77
.. glossary::
88

9+
clique
10+
A group of :term:`tasks <task>` belonging to a :term:`parallel program`
11+
that are co-located on a node. Cliques may communicate with each other
12+
more efficiently than tasks on different nodes.
13+
914
enclosing instance
1015
The Flux instance that a process naturally interacts with. It is
1116
the instance referred to by the :envvar:`FLUX_URI` environment variable,
@@ -60,7 +65,9 @@ used in our documentation that may not be familiar to all readers.
6065

6166
job
6267
The smallest unit of work that can be allocated resources and run by Flux.
63-
A job can be a Flux instance which in turn can run more jobs.
68+
A job is typically a :term:`parallel program`, but may consist of one
69+
or more :term:`singletons <singleton>`. A job can be a Flux instance
70+
which in turn can run more jobs.
6471

6572
jobspec
6673
The JSON or YAML object representing a Flux job request, defined by
@@ -77,6 +84,10 @@ used in our documentation that may not be familiar to all readers.
7784
A moldable job requests a variable, bounded quantity of resources
7885
that, once allocated by the system, is fixed at runtime [#Feitelson96]_.
7986

87+
parallel program
88+
A ranked group of :term:`tasks`, often the same executable, launched
89+
in parallel and working together to solve a problem.
90+
8091
priority
8192
The order in which the scheduler considers jobs. By default, priority
8293
is derived from the :term:`urgency` and submit time, but a priority plugin
@@ -102,8 +113,11 @@ used in our documentation that may not be familiar to all readers.
102113
and resource utilization when it decides upon a schedule for fulfilling
103114
competing requests.
104115

116+
singleton
117+
A degenerate :term:`parallel program` with only one :term:`task`.
118+
105119
slot
106-
The abstract resource requirements of one task.
120+
The abstract resource requirements of one :term:`task`.
107121

108122
step
109123
In other workload managers, a job step is a unit of work within a job.
@@ -116,8 +130,12 @@ used in our documentation that may not be familiar to all readers.
116130
system user like ``flux``, is started by :linux:man1:`systemd`, and
117131
allows :term:`guest` users to run jobs.
118132

133+
task
134+
A process at the operating system level. A task may represent one
135+
rank of a :term:`parallel program`.
136+
119137
taskmap
120-
A compact mapping between job task ranks and node IDs, defined by
138+
A compact mapping between job :term:`task` ranks and node IDs, defined by
121139
:doc:`rfc:spec_34`.
122140

123141
TBON

doc/man1/flux-start.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,12 @@ OPTIONS
204204

205205
.. option:: --test-pmi-clique=MODE
206206

207-
Set the pmi clique mode, which determines how ``PMI_process_mapping`` is set
208-
in the PMI server used to bootstrap the brokers. If ``none``, the mapping
209-
is not created. If ``single``, all brokers are placed in one clique. If
210-
``per-broker``, each broker is placed in its own clique. Otherwise the
211-
option argument is interpreted as an RFC 34 taskmap. Default: ``single``.
207+
Set the PMI :term:`clique` mode, which determines how
208+
``PMI_process_mapping`` is set in the PMI server used to bootstrap the
209+
brokers. If ``none``, the mapping is not created. If ``single``, all
210+
brokers are placed in one clique. If ``per-broker``, each broker is placed
211+
in its own clique. Otherwise the option argument is interpreted as an
212+
RFC 34 taskmap. Default: ``single``.
212213

213214
.. option:: -r, --recovery=[TARGET]
214215

src/broker/boot_pmi.c

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static int fetch_taskmap (struct upmi *upmi,
133133
return 0;
134134
}
135135

136-
/* Set broker.mapping attribute from enclosing instance taskmap.
136+
/* Set broker.mapping attribute.
137137
* It is not an error if the map is NULL.
138138
*/
139139
static int set_broker_mapping_attr (attr_t *attrs, struct taskmap *map)
@@ -150,38 +150,24 @@ static int set_broker_mapping_attr (attr_t *attrs, struct taskmap *map)
150150
return 0;
151151
}
152152

153-
/* Count the number of TBON children that could be reached by IPC.
153+
/* Return the number of ranks[] members that are in the same clique as rank.
154154
*/
155-
static int count_local_children (struct taskmap *map,
156-
int *child_ranks,
157-
int child_count,
158-
int rank)
155+
static int clique_ranks (struct taskmap *map, int rank, int *ranks, int nranks)
159156
{
160157
int count = 0;
161158

162159
if (map) {
163-
int nodeid = taskmap_nodeid (map, rank); // this broker's nodeid
164-
if (nodeid >= 0) {
165-
for (int i = 0; i < child_count; i++) {
166-
if (taskmap_nodeid (map, child_ranks[i]) == nodeid)
160+
int nid = taskmap_nodeid (map, rank);
161+
if (nid >= 0) {
162+
for (int i = 0; i < nranks; i++) {
163+
if (taskmap_nodeid (map, ranks[i]) == nid)
167164
count++;
168165
}
169166
}
170167
}
171168
return count;
172169
}
173170

174-
static bool ranks_are_peers (struct taskmap *map, int rank1, int rank2)
175-
{
176-
int nid1;
177-
int nid2;
178-
179-
if ((nid1 = taskmap_nodeid (map, rank1)) < 0
180-
|| (nid2 = taskmap_nodeid (map, rank2)) < 0)
181-
return false;
182-
return (nid1 == nid2 ? true : false);
183-
}
184-
185171
/* Check if TCP should be used, even if IPC could work.
186172
*/
187173
static bool get_prefer_tcp (attr_t *attrs)
@@ -532,10 +518,7 @@ int boot_pmi (const char *hostname, struct overlay *overlay, attr_t *attrs)
532518
char tcp[1024];
533519
char ipc[1024];
534520

535-
nlocal = count_local_children (taskmap,
536-
child_ranks,
537-
child_count,
538-
info.rank);
521+
nlocal = clique_ranks (taskmap, info.rank, child_ranks, child_count);
539522

540523
if (format_tcp_uri (tcp, sizeof (tcp), attrs, &error) < 0) {
541524
log_err ("%s", error.text);
@@ -600,7 +583,7 @@ int boot_pmi (const char *hostname, struct overlay *overlay, attr_t *attrs)
600583
goto error;
601584
}
602585
if (!get_prefer_tcp (attrs)
603-
&& ranks_are_peers (taskmap, info.rank, parent_rank))
586+
&& clique_ranks (taskmap, info.rank, &parent_rank, 1) == 1)
604587
uri = bizcard_uri_find (bc, "ipc://");
605588
if (!uri)
606589
uri = bizcard_uri_find (bc, NULL);

0 commit comments

Comments
 (0)