Skip to content

Commit 45f23ca

Browse files
author
Ralph Castain
committed
Update mapping system
Correctly transfer job-level mapping directives for dynamically spawned jobs to the mapping system. Signed-off-by: Ralph Castain <[email protected]>
1 parent 23271c9 commit 45f23ca

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

orte/mca/rmaps/base/base.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ ORTE_DECLSPEC int orte_rmaps_base_filter_nodes(orte_app_context_t *app,
123123
opal_list_t *nodes,
124124
bool remove);
125125

126-
ORTE_DECLSPEC int orte_rmaps_base_set_mapping_policy(orte_mapping_policy_t *policy,
126+
ORTE_DECLSPEC int orte_rmaps_base_set_mapping_policy(orte_job_t *jdata,
127+
orte_mapping_policy_t *policy,
127128
char **device, char *spec);
128129
ORTE_DECLSPEC int orte_rmaps_base_set_ranking_policy(orte_ranking_policy_t *policy,
129130
orte_mapping_policy_t mapping,

orte/mca/rmaps/base/rmaps_base_frame.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static int orte_rmaps_base_open(mca_base_open_flag_t flags)
296296
"rmaps_base_cpus_per_proc", "rmaps_base_mapping_policy=<obj>:PE=N, default <obj>=NUMA");
297297
}
298298

299-
if (ORTE_SUCCESS != (rc = orte_rmaps_base_set_mapping_policy(&orte_rmaps_base.mapping,
299+
if (ORTE_SUCCESS != (rc = orte_rmaps_base_set_mapping_policy(NULL, &orte_rmaps_base.mapping,
300300
&orte_rmaps_base.device,
301301
rmaps_base_mapping_policy))) {
302302
return rc;
@@ -593,7 +593,8 @@ static int check_modifiers(char *ck, orte_mapping_policy_t *tmp)
593593
return ORTE_ERR_TAKE_NEXT_OPTION;
594594
}
595595

596-
int orte_rmaps_base_set_mapping_policy(orte_mapping_policy_t *policy,
596+
int orte_rmaps_base_set_mapping_policy(orte_job_t *jdata,
597+
orte_mapping_policy_t *policy,
597598
char **device, char *inspec)
598599
{
599600
char *ck;
@@ -681,7 +682,11 @@ int orte_rmaps_base_set_mapping_policy(orte_mapping_policy_t *policy,
681682
}
682683
}
683684
/* now save the pattern */
684-
orte_rmaps_base.ppr = strdup(ck);
685+
if (NULL == jdata || NULL == jdata->map) {
686+
orte_rmaps_base.ppr = strdup(ck);
687+
} else {
688+
jdata->map->ppr = strdup(ck);
689+
}
685690
ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_PPR);
686691
ORTE_SET_MAPPING_DIRECTIVE(tmp, ORTE_MAPPING_GIVEN);
687692
free(spec);
@@ -747,7 +752,11 @@ int orte_rmaps_base_set_mapping_policy(orte_mapping_policy_t *policy,
747752
}
748753

749754
setpolicy:
750-
*policy = tmp;
755+
if (NULL == jdata || NULL == jdata->map) {
756+
*policy = tmp;
757+
} else {
758+
jdata->map->mapping = tmp;
759+
}
751760

752761
return ORTE_SUCCESS;
753762
}

orte/orted/orted_submit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ int orte_submit_job(char *argv[], int *index,
876876
jdata->map = OBJ_NEW(orte_job_map_t);
877877

878878
if (NULL != orte_cmd_options.mapping_policy) {
879-
if (ORTE_SUCCESS != (rc = orte_rmaps_base_set_mapping_policy(&jdata->map->mapping, NULL, orte_cmd_options.mapping_policy))) {
879+
if (ORTE_SUCCESS != (rc = orte_rmaps_base_set_mapping_policy(jdata, &jdata->map->mapping, NULL, orte_cmd_options.mapping_policy))) {
880880
ORTE_ERROR_LOG(rc);
881881
return rc;
882882
}

orte/orted/pmix/pmix_server_dyn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ int pmix_server_spawn_fn(opal_process_name_t *requestor,
308308
orte_rmaps_base_print_mapping(orte_rmaps_base.mapping));
309309
return ORTE_ERR_BAD_PARAM;
310310
}
311-
rc = orte_rmaps_base_set_mapping_policy(&jdata->map->mapping,
311+
rc = orte_rmaps_base_set_mapping_policy(jdata, &jdata->map->mapping,
312312
NULL, info->data.string);
313313
if (ORTE_SUCCESS != rc) {
314314
return rc;

orte/orted/pmix/pmix_server_gen.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ static void _query(int sd, short args, void *cbdata)
489489
orte_job_t *jdata;
490490
orte_proc_t *proct;
491491
orte_app_context_t *app;
492-
int rc, i, k, num_replies;
492+
int rc = ORTE_SUCCESS, i, k, num_replies;
493493
opal_list_t *results, targets, *array;
494494
size_t n;
495495
uint32_t key;
@@ -716,7 +716,7 @@ static void _query(int sd, short args, void *cbdata)
716716
}
717717
}
718718
if (ORTE_JOBID_INVALID == jobid) {
719-
rc = ORTE_ERR_BAD_PARAM;
719+
rc = ORTE_ERR_NOT_FOUND;
720720
goto done;
721721
}
722722
/* construct a list of values with opal_proc_info_t
@@ -810,12 +810,12 @@ static void _query(int sd, short args, void *cbdata)
810810
}
811811

812812
done:
813-
if (0 == opal_list_get_size(results)) {
814-
rc = ORTE_ERR_NOT_FOUND;
815-
} else if (opal_list_get_size(results) < opal_list_get_size(cd->info)) {
816-
rc = ORTE_ERR_PARTIAL_SUCCESS;
817-
} else {
818-
rc = ORTE_SUCCESS;
813+
if (ORTE_SUCCESS == rc) {
814+
if (0 == opal_list_get_size(results)) {
815+
rc = ORTE_ERR_NOT_FOUND;
816+
} else if (opal_list_get_size(results) < opal_list_get_size(cd->info)) {
817+
rc = ORTE_ERR_PARTIAL_SUCCESS;
818+
}
819819
}
820820
cd->infocbfunc(rc, results, cd->cbdata, qrel, results);
821821
}

0 commit comments

Comments
 (0)