From 1487e22ec88d195cd340efd2a0d12ff89ad49d86 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 18 Jan 2007 20:00:15 +0000 Subject: [PATCH] Store the mapping mode so that it can be recovered later This commit was SVN r13197. --- orte/mca/rmaps/base/rmaps_base_registry_fns.c | 28 +++++++++---------- orte/mca/schema/schema_types.h | 1 + 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/orte/mca/rmaps/base/rmaps_base_registry_fns.c b/orte/mca/rmaps/base/rmaps_base_registry_fns.c index ef70666286..ee540acf12 100644 --- a/orte/mca/rmaps/base/rmaps_base_registry_fns.c +++ b/orte/mca/rmaps/base/rmaps_base_registry_fns.c @@ -69,6 +69,7 @@ int orte_rmaps_base_get_job_map(orte_job_map_t **map, orte_jobid_t jobid) ORTE_NODE_OVERSUBSCRIBED_KEY, ORTE_JOB_VPID_START_KEY, ORTE_JOB_VPID_RANGE_KEY, + ORTE_JOB_MAPPING_MODE_KEY, NULL }; @@ -87,13 +88,6 @@ int orte_rmaps_base_get_job_map(orte_job_map_t **map, orte_jobid_t jobid) /* set the jobid */ mapping->job = jobid; - /* get the vpid start/range info */ - if (ORTE_SUCCESS != (rc = orte_rmgr.get_vpid_range(jobid, &mapping->vpid_start, &mapping->vpid_range))) { - ORTE_ERROR_LOG(rc); - OBJ_RELEASE(mapping); - return rc; - } - /* get the job segment name */ if (ORTE_SUCCESS != (rc = orte_schema.get_job_segment_name(&segment, jobid))) { ORTE_ERROR_LOG(rc); @@ -150,6 +144,14 @@ int orte_rmaps_base_get_job_map(orte_job_map_t **map, orte_jobid_t jobid) mapping->vpid_range = *vptr; continue; } + if(strcmp(value->keyvals[kv]->key, ORTE_JOB_MAPPING_MODE_KEY) == 0) { + /* use the dss.copy function here to protect us against zero-length strings */ + if (ORTE_SUCCESS != (rc = orte_dss.copy((void**)&mapping->mapping_mode, value->keyvals[kv]->value->data, ORTE_STRING))) { + ORTE_ERROR_LOG(rc); + goto cleanup; + } + continue; + } } } @@ -332,12 +334,6 @@ int orte_rmaps_base_put_job_map(orte_job_map_t *map) return ORTE_ERR_BAD_PARAM; } - /* store the vpid start/range info */ - if (ORTE_SUCCESS != (rc = orte_rmgr.set_vpid_range(map->job, map->vpid_start, map->vpid_range))) { - ORTE_ERROR_LOG(rc); - return rc; - } - /** * allocate value array. We need to reserve one extra spot so we can set the counter * for the process INIT state to indicate that all procs are at that state. This will @@ -358,7 +354,7 @@ int orte_rmaps_base_put_job_map(orte_job_map_t *map) /** setup the last value in the array to store the vpid start/range and update the INIT counter */ if (ORTE_SUCCESS != (rc = orte_gpr.create_value(&(values[num_procs]), ORTE_GPR_OVERWRITE|ORTE_GPR_TOKENS_AND, - segment, 3, 1))) { + segment, 4, 1))) { ORTE_ERROR_LOG(rc); free(values); free(segment); @@ -376,6 +372,10 @@ int orte_rmaps_base_put_job_map(orte_job_map_t *map) ORTE_ERROR_LOG(rc); goto cleanup; } + if (ORTE_SUCCESS != (rc = orte_gpr.create_keyval(&(values[num_procs]->keyvals[3]), ORTE_JOB_MAPPING_MODE_KEY, ORTE_STRING, map->mapping_mode))) { + ORTE_ERROR_LOG(rc); + goto cleanup; + } values[num_procs]->tokens[0] = strdup(ORTE_JOB_GLOBALS); /* counter is in the job's globals container */ diff --git a/orte/mca/schema/schema_types.h b/orte/mca/schema/schema_types.h index 3716172a2b..4dec394956 100644 --- a/orte/mca/schema/schema_types.h +++ b/orte/mca/schema/schema_types.h @@ -81,6 +81,7 @@ #define ORTE_JOB_TOTAL_SLOTS_ALLOC_KEY "orte-job-total-slots" #define ORTE_JOB_IOF_KEY "orte-job-iof" #define ORTE_JOB_STATE_KEY "orte-job-state" +#define ORTE_JOB_MAPPING_MODE_KEY "orte-job-mapping-mode" #define ORTE_PROC_NAME_KEY "orte-proc-name" #define ORTE_PROC_RANK_KEY "orte-proc-rank" #define ORTE_PROC_PID_KEY "orte-proc-pid"