|
11 | 11 | * All rights reserved. |
12 | 12 | * Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved. |
13 | 13 | * 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. |
14 | 16 | * $COPYRIGHT$ |
15 | 17 | * |
16 | 18 | * Additional copyrights may follow |
@@ -184,6 +186,22 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata, |
184 | 186 | * properly set |
185 | 187 | */ |
186 | 188 | 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 | + } |
187 | 205 | } |
188 | 206 | /* if we have mapped everything, then we are done */ |
189 | 207 | if (nprocs_mapped == app->num_procs) { |
@@ -349,6 +367,22 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata, |
349 | 367 | * properly set |
350 | 368 | */ |
351 | 369 | 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 | + } |
352 | 386 | } |
353 | 387 | if (nprocs_mapped == app->num_procs) { |
354 | 388 | /* we are done */ |
@@ -550,6 +584,22 @@ int orte_rmaps_rr_byobj(orte_job_t *jdata, |
550 | 584 | * properly set |
551 | 585 | */ |
552 | 586 | 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 | + } |
553 | 603 | } |
554 | 604 | if (nprocs_mapped == app->num_procs) { |
555 | 605 | /* we are done */ |
|
0 commit comments