Skip to content

Commit

Permalink
Minor formatting cleanups
Browse files Browse the repository at this point in the history
Just to make the code a little clearer

Signed-off-by: Ralph Castain <rhc@pmix.org>
  • Loading branch information
rhc54 committed Apr 7, 2022
1 parent 6284d34 commit 577145f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 37 deletions.
8 changes: 4 additions & 4 deletions src/mca/rmaps/rank_file/rmaps_rank_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,10 @@ static int prte_rmaps_rf_map(prte_job_t *jdata)
rc = PRTE_ERR_OUT_OF_RESOURCE;
goto error;
}
if ((node->slots < (int) node->num_procs)
|| (0 < node->slots_max && node->slots_max < (int) node->num_procs)) {
if (PRTE_MAPPING_NO_OVERSUBSCRIBE
& PRTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
/* check if we are oversubscribed */
if ((node->slots < (int) node->num_procs) ||
(0 < node->slots_max && node->slots_max < (int) node->num_procs)) {
if (PRTE_MAPPING_NO_OVERSUBSCRIBE & PRTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
prte_show_help("help-prte-rmaps-base.txt", "prte-rmaps-base:alloc-error", true,
node->num_procs, app->app);
PRTE_UPDATE_EXIT_STATUS(PRTE_ERROR_DEFAULT_EXIT_CODE);
Expand Down
65 changes: 32 additions & 33 deletions src/mca/rmaps/seq/rmaps_seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,43 +331,42 @@ static int prte_rmaps_seq_map(prte_job_t *jdata)
PRTE_FLAG_SET(node, PRTE_NODE_FLAG_MAPPED);
}
proc = prte_rmaps_base_setup_proc(jdata, node, i);
if (!PRTE_FLAG_TEST(app, PRTE_APP_FLAG_TOOL) &&
(node->slots < (int) node->num_procs) ||
(0 < node->slots_max && node->slots_max < (int) node->num_procs)) {
if (PRTE_MAPPING_NO_OVERSUBSCRIBE
& PRTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
prte_show_help("help-prte-rmaps-base.txt", "prte-rmaps-base:alloc-error", true,
node->num_procs, app->app);
PRTE_UPDATE_EXIT_STATUS(PRTE_ERROR_DEFAULT_EXIT_CODE);
rc = PRTE_ERR_SILENT;
goto error;
}
/* flag the node as oversubscribed so that sched-yield gets
* properly set
*/
PRTE_FLAG_SET(node, PRTE_NODE_FLAG_OVERSUBSCRIBED);
PRTE_FLAG_SET(jdata, PRTE_JOB_FLAG_OVERSUBSCRIBED);
/* check for permission */
if (PRTE_FLAG_TEST(node, PRTE_NODE_FLAG_SLOTS_GIVEN)) {
/* if we weren't given a directive either way, then we will error out
* as the #slots were specifically given, either by the host RM or
* via hostfile/dash-host */
if (!(PRTE_MAPPING_SUBSCRIBE_GIVEN
& PRTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
prte_show_help("help-prte-rmaps-base.txt", "prte-rmaps-base:alloc-error",
true, app->num_procs, app->app);
PRTE_UPDATE_EXIT_STATUS(PRTE_ERROR_DEFAULT_EXIT_CODE);
rc = PRTE_ERR_SILENT;
goto error;
} else if (PRTE_MAPPING_NO_OVERSUBSCRIBE
& PRTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
/* if we were explicitly told not to oversubscribe, then don't */
prte_show_help("help-prte-rmaps-base.txt", "prte-rmaps-base:alloc-error",
true, app->num_procs, app->app);
if (!PRTE_FLAG_TEST(app, PRTE_APP_FLAG_TOOL)) {
/* check if we are oversubscribed */
if ((node->slots < (int) node->num_procs) ||
(0 < node->slots_max && node->slots_max < (int) node->num_procs)) {
if (PRTE_MAPPING_NO_OVERSUBSCRIBE & PRTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
prte_show_help("help-prte-rmaps-base.txt", "prte-rmaps-base:alloc-error", true,
node->num_procs, app->app);
PRTE_UPDATE_EXIT_STATUS(PRTE_ERROR_DEFAULT_EXIT_CODE);
rc = PRTE_ERR_SILENT;
goto error;
}
/* flag the node as oversubscribed so that sched-yield gets
* properly set
*/
PRTE_FLAG_SET(node, PRTE_NODE_FLAG_OVERSUBSCRIBED);
PRTE_FLAG_SET(jdata, PRTE_JOB_FLAG_OVERSUBSCRIBED);
/* check for permission */
if (PRTE_FLAG_TEST(node, PRTE_NODE_FLAG_SLOTS_GIVEN)) {
/* if we weren't given a directive either way, then we will error out
* as the #slots were specifically given, either by the host RM or
* via hostfile/dash-host */
if (!(PRTE_MAPPING_SUBSCRIBE_GIVEN & PRTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
prte_show_help("help-prte-rmaps-base.txt", "prte-rmaps-base:alloc-error",
true, app->num_procs, app->app);
PRTE_UPDATE_EXIT_STATUS(PRTE_ERROR_DEFAULT_EXIT_CODE);
rc = PRTE_ERR_SILENT;
goto error;
} else if (PRTE_MAPPING_NO_OVERSUBSCRIBE & PRTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
/* if we were explicitly told not to oversubscribe, then don't */
prte_show_help("help-prte-rmaps-base.txt", "prte-rmaps-base:alloc-error",
true, app->num_procs, app->app);
PRTE_UPDATE_EXIT_STATUS(PRTE_ERROR_DEFAULT_EXIT_CODE);
rc = PRTE_ERR_SILENT;
goto error;
}
}
}
}
/* assign the vpid */
Expand Down

0 comments on commit 577145f

Please sign in to comment.