|
10 | 10 | * Copyright (c) 2004-2005 The Regents of the University of California. |
11 | 11 | * All rights reserved. |
12 | 12 | * 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. |
| 14 | + * Copyright (c) 2015 Research Organization for Information Science |
| 15 | + * and Technology (RIST). All rights reserved. |
14 | 16 | * $COPYRIGHT$ |
15 | 17 | * |
16 | 18 | * Additional copyrights may follow |
@@ -58,6 +60,7 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata, |
58 | 60 | if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) { |
59 | 61 | orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
60 | 62 | true, app->num_procs, app->app); |
| 63 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
61 | 64 | return ORTE_ERR_SILENT; |
62 | 65 | } |
63 | 66 | } |
@@ -184,6 +187,24 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata, |
184 | 187 | * properly set |
185 | 188 | */ |
186 | 189 | ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED); |
| 190 | + /* check for permission */ |
| 191 | + if (ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) { |
| 192 | + /* if we weren't given a directive either way, then we will error out |
| 193 | + * as the #slots were specifically given, either by the host RM or |
| 194 | + * via hostfile/dash-host */ |
| 195 | + if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) { |
| 196 | + orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
| 197 | + true, app->num_procs, app->app); |
| 198 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
| 199 | + return ORTE_ERR_SILENT; |
| 200 | + } else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) { |
| 201 | + /* if we were explicitly told not to oversubscribe, then don't */ |
| 202 | + orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
| 203 | + true, app->num_procs, app->app); |
| 204 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
| 205 | + return ORTE_ERR_SILENT; |
| 206 | + } |
| 207 | + } |
187 | 208 | } |
188 | 209 | /* if we have mapped everything, then we are done */ |
189 | 210 | if (nprocs_mapped == app->num_procs) { |
@@ -219,6 +240,7 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata, |
219 | 240 | if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) { |
220 | 241 | orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
221 | 242 | true, app->num_procs, app->app); |
| 243 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
222 | 244 | return ORTE_ERR_SILENT; |
223 | 245 | } |
224 | 246 | oversubscribed = true; |
@@ -349,6 +371,24 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata, |
349 | 371 | * properly set |
350 | 372 | */ |
351 | 373 | ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED); |
| 374 | + /* check for permission */ |
| 375 | + if (ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) { |
| 376 | + /* if we weren't given a directive either way, then we will error out |
| 377 | + * as the #slots were specifically given, either by the host RM or |
| 378 | + * via hostfile/dash-host */ |
| 379 | + if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) { |
| 380 | + orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
| 381 | + true, app->num_procs, app->app); |
| 382 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
| 383 | + return ORTE_ERR_SILENT; |
| 384 | + } else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) { |
| 385 | + /* if we were explicitly told not to oversubscribe, then don't */ |
| 386 | + orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
| 387 | + true, app->num_procs, app->app); |
| 388 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
| 389 | + return ORTE_ERR_SILENT; |
| 390 | + } |
| 391 | + } |
352 | 392 | } |
353 | 393 | if (nprocs_mapped == app->num_procs) { |
354 | 394 | /* we are done */ |
@@ -452,6 +492,7 @@ int orte_rmaps_rr_byobj(orte_job_t *jdata, |
452 | 492 | if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) { |
453 | 493 | orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
454 | 494 | true, app->num_procs, app->app); |
| 495 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
455 | 496 | return ORTE_ERR_SILENT; |
456 | 497 | } |
457 | 498 | } |
@@ -550,6 +591,24 @@ int orte_rmaps_rr_byobj(orte_job_t *jdata, |
550 | 591 | * properly set |
551 | 592 | */ |
552 | 593 | ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED); |
| 594 | + /* check for permission */ |
| 595 | + if (ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) { |
| 596 | + /* if we weren't given a directive either way, then we will error out |
| 597 | + * as the #slots were specifically given, either by the host RM or |
| 598 | + * via hostfile/dash-host */ |
| 599 | + if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) { |
| 600 | + orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
| 601 | + true, app->num_procs, app->app); |
| 602 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
| 603 | + return ORTE_ERR_SILENT; |
| 604 | + } else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) { |
| 605 | + /* if we were explicitly told not to oversubscribe, then don't */ |
| 606 | + orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
| 607 | + true, app->num_procs, app->app); |
| 608 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
| 609 | + return ORTE_ERR_SILENT; |
| 610 | + } |
| 611 | + } |
553 | 612 | } |
554 | 613 | if (nprocs_mapped == app->num_procs) { |
555 | 614 | /* we are done */ |
@@ -593,6 +652,7 @@ static int byobj_span(orte_job_t *jdata, |
593 | 652 | if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) { |
594 | 653 | orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error", |
595 | 654 | true, app->num_procs, app->app); |
| 655 | + ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE); |
596 | 656 | return ORTE_ERR_SILENT; |
597 | 657 | } |
598 | 658 | } |
|
0 commit comments