Skip to content

Commit b7b4231

Browse files
author
rhc54
committed
Merge pull request #1261 from ggouaillardet/topic/rmaps_rr_oversubsription
rmaps/round_robin: warn if oversubscribing when manually setting the …
2 parents 4f8c0c5 + 352b05a commit b7b4231

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

orte/mca/rmaps/ppr/rmaps_ppr.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright (c) 2011 Los Alamos National Security, LLC.
44
* All rights reserved.
55
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
6+
* Copyright (c) 2015 Research Organization for Information Science
7+
* and Technology (RIST). All rights reserved.
68
* $COPYRIGHT$
79
*
810
* Additional copyrights may follow
@@ -346,6 +348,22 @@ static int ppr_mapper(orte_job_t *jdata)
346348
* properly set
347349
*/
348350
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED);
351+
/* check for permission */
352+
if (ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
353+
/* if we weren't given a directive either way, then we will error out
354+
* as the #slots were specifically given, either by the host RM or
355+
* via hostfile/dash-host */
356+
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
357+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
358+
true, app->num_procs, app->app);
359+
return ORTE_ERR_SILENT;
360+
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
361+
/* if we were explicitly told not to oversubscribe, then don't */
362+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
363+
true, app->num_procs, app->app);
364+
return ORTE_ERR_SILENT;
365+
}
366+
}
349367
}
350368

351369
/* if we haven't mapped all the procs, continue on to the

orte/mca/rmaps/round_robin/rmaps_rr_mappers.c

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* All rights reserved.
1212
* Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
14+
* Copyright (c) 2015 Research Organization for Information Science
15+
* and Technology (RIST). All rights reserved.
1416
* $COPYRIGHT$
1517
*
1618
* Additional copyrights may follow
@@ -184,6 +186,22 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata,
184186
* properly set
185187
*/
186188
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED);
189+
/* check for permission */
190+
if (ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
191+
/* if we weren't given a directive either way, then we will error out
192+
* as the #slots were specifically given, either by the host RM or
193+
* via hostfile/dash-host */
194+
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
195+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
196+
true, app->num_procs, app->app);
197+
return ORTE_ERR_SILENT;
198+
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
199+
/* if we were explicitly told not to oversubscribe, then don't */
200+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
201+
true, app->num_procs, app->app);
202+
return ORTE_ERR_SILENT;
203+
}
204+
}
187205
}
188206
/* if we have mapped everything, then we are done */
189207
if (nprocs_mapped == app->num_procs) {
@@ -349,6 +367,22 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
349367
* properly set
350368
*/
351369
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED);
370+
/* check for permission */
371+
if (ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
372+
/* if we weren't given a directive either way, then we will error out
373+
* as the #slots were specifically given, either by the host RM or
374+
* via hostfile/dash-host */
375+
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
376+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
377+
true, app->num_procs, app->app);
378+
return ORTE_ERR_SILENT;
379+
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
380+
/* if we were explicitly told not to oversubscribe, then don't */
381+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
382+
true, app->num_procs, app->app);
383+
return ORTE_ERR_SILENT;
384+
}
385+
}
352386
}
353387
if (nprocs_mapped == app->num_procs) {
354388
/* we are done */
@@ -550,6 +584,22 @@ int orte_rmaps_rr_byobj(orte_job_t *jdata,
550584
* properly set
551585
*/
552586
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED);
587+
/* check for permission */
588+
if (ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
589+
/* if we weren't given a directive either way, then we will error out
590+
* as the #slots were specifically given, either by the host RM or
591+
* via hostfile/dash-host */
592+
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
593+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
594+
true, app->num_procs, app->app);
595+
return ORTE_ERR_SILENT;
596+
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
597+
/* if we were explicitly told not to oversubscribe, then don't */
598+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
599+
true, app->num_procs, app->app);
600+
return ORTE_ERR_SILENT;
601+
}
602+
}
553603
}
554604
if (nprocs_mapped == app->num_procs) {
555605
/* we are done */

orte/mca/rmaps/seq/rmaps_seq.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,22 @@ static int orte_rmaps_seq_map(orte_job_t *jdata)
370370
* properly set
371371
*/
372372
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED);
373+
/* check for permission */
374+
if (ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
375+
/* if we weren't given a directive either way, then we will error out
376+
* as the #slots were specifically given, either by the host RM or
377+
* via hostfile/dash-host */
378+
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
379+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
380+
true, app->num_procs, app->app);
381+
return ORTE_ERR_SILENT;
382+
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
383+
/* if we were explicitly told not to oversubscribe, then don't */
384+
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
385+
true, app->num_procs, app->app);
386+
return ORTE_ERR_SILENT;
387+
}
388+
}
373389
}
374390
/* assign the vpid */
375391
proc->name.vpid = vpid++;

0 commit comments

Comments
 (0)