Skip to content

Commit d76f0ba

Browse files
author
rhc54
committed
Merge pull request #1543 from rhc54/topic/oversub
Ensure that we exit with a non-zero status when oversubscribe fails
2 parents 4b3995d + 1fa236b commit d76f0ba

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

orte/mca/rmaps/mindist/rmaps_mindist_module.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2006-2011 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
1414
* All rights reserved.
15-
* Copyright (c) 2014 Intel, Inc. All rights reserved.
15+
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
1616
* Copyright (c) 2014 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* $COPYRIGHT$
@@ -226,6 +226,7 @@ static int mindist_map(orte_job_t *jdata)
226226
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
227227
true, app->num_procs, app->app);
228228
rc = ORTE_ERR_SILENT;
229+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
229230
goto error;
230231
} else {
231232
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED);
@@ -329,6 +330,7 @@ static int mindist_map(orte_job_t *jdata)
329330
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
330331
true, app->num_procs, app->app);
331332
rc = ORTE_ERR_SILENT;
333+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
332334
goto error;
333335
}
334336
opal_output_verbose(2, orte_rmaps_base_framework.framework_output,

orte/mca/rmaps/ppr/rmaps_ppr.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2011 Los Alamos National Security, LLC.
44
* All rights reserved.
5-
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
5+
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
66
* Copyright (c) 2015 Research Organization for Information Science
77
* and Technology (RIST). All rights reserved.
88
* $COPYRIGHT$
@@ -341,6 +341,7 @@ static int ppr_mapper(orte_job_t *jdata)
341341
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
342342
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
343343
true, node->num_procs, app->app);
344+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
344345
rc = ORTE_ERR_SILENT;
345346
goto error;
346347
}
@@ -356,11 +357,13 @@ static int ppr_mapper(orte_job_t *jdata)
356357
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
357358
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
358359
true, app->num_procs, app->app);
360+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
359361
return ORTE_ERR_SILENT;
360362
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
361363
/* if we were explicitly told not to oversubscribe, then don't */
362364
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
363365
true, app->num_procs, app->app);
366+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
364367
return ORTE_ERR_SILENT;
365368
}
366369
}

orte/mca/rmaps/rank_file/rmaps_rank_file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* All rights reserved.
1515
* Copyright (c) 2008 Voltaire. All rights reserved
1616
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
17-
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
17+
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
1818
* Copyright (c) 2015 Research Organization for Information Science
1919
* and Technology (RIST). All rights reserved.
2020
*
@@ -289,6 +289,7 @@ static int orte_rmaps_rf_map(orte_job_t *jdata)
289289
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
290290
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
291291
true, node->num_procs, app->app);
292+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
292293
rc = ORTE_ERR_SILENT;
293294
goto error;
294295
}

orte/mca/rmaps/resilient/rmaps_resilient.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Corporation. All rights reserved.
66
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
77
* All rights reserved.
8-
* Copyright (c) 2014 Intel, Inc. All rights reserved.
8+
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
99
*
1010
* $COPYRIGHT$
1111
*
@@ -833,6 +833,7 @@ static int map_to_ftgrps(orte_job_t *jdata)
833833
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
834834
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
835835
true, nd->num_procs, app->app);
836+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
836837
return ORTE_ERR_SILENT;
837838
}
838839
/* flag the node as oversubscribed so that sched-yield gets

orte/mca/rmaps/round_robin/rmaps_rr_mappers.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
13-
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
13+
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
1414
* Copyright (c) 2015 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
1616
* $COPYRIGHT$
@@ -60,6 +60,7 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata,
6060
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
6161
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
6262
true, app->num_procs, app->app);
63+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
6364
return ORTE_ERR_SILENT;
6465
}
6566
}
@@ -194,11 +195,13 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata,
194195
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
195196
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
196197
true, app->num_procs, app->app);
198+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
197199
return ORTE_ERR_SILENT;
198200
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
199201
/* if we were explicitly told not to oversubscribe, then don't */
200202
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
201203
true, app->num_procs, app->app);
204+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
202205
return ORTE_ERR_SILENT;
203206
}
204207
}
@@ -237,6 +240,7 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
237240
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
238241
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
239242
true, app->num_procs, app->app);
243+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
240244
return ORTE_ERR_SILENT;
241245
}
242246
oversubscribed = true;
@@ -375,11 +379,13 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
375379
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
376380
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
377381
true, app->num_procs, app->app);
382+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
378383
return ORTE_ERR_SILENT;
379384
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
380385
/* if we were explicitly told not to oversubscribe, then don't */
381386
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
382387
true, app->num_procs, app->app);
388+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
383389
return ORTE_ERR_SILENT;
384390
}
385391
}
@@ -486,6 +492,7 @@ int orte_rmaps_rr_byobj(orte_job_t *jdata,
486492
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
487493
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
488494
true, app->num_procs, app->app);
495+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
489496
return ORTE_ERR_SILENT;
490497
}
491498
}
@@ -592,11 +599,13 @@ int orte_rmaps_rr_byobj(orte_job_t *jdata,
592599
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
593600
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
594601
true, app->num_procs, app->app);
602+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
595603
return ORTE_ERR_SILENT;
596604
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
597605
/* if we were explicitly told not to oversubscribe, then don't */
598606
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
599607
true, app->num_procs, app->app);
608+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
600609
return ORTE_ERR_SILENT;
601610
}
602611
}
@@ -643,6 +652,7 @@ static int byobj_span(orte_job_t *jdata,
643652
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
644653
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
645654
true, app->num_procs, app->app);
655+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
646656
return ORTE_ERR_SILENT;
647657
}
648658
}

orte/mca/rmaps/seq/rmaps_seq.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2006-2011 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2011 Los Alamos National Security, LLC.
1414
* All rights reserved.
15-
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
15+
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
1616
* Copyright (c) 2015 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* $COPYRIGHT$
@@ -363,6 +363,7 @@ static int orte_rmaps_seq_map(orte_job_t *jdata)
363363
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
364364
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
365365
true, node->num_procs, app->app);
366+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
366367
rc = ORTE_ERR_SILENT;
367368
goto error;
368369
}
@@ -378,11 +379,13 @@ static int orte_rmaps_seq_map(orte_job_t *jdata)
378379
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
379380
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
380381
true, app->num_procs, app->app);
382+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
381383
return ORTE_ERR_SILENT;
382384
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
383385
/* if we were explicitly told not to oversubscribe, then don't */
384386
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
385387
true, app->num_procs, app->app);
388+
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
386389
return ORTE_ERR_SILENT;
387390
}
388391
}

0 commit comments

Comments
 (0)