Split out the nidmap init function that adds entries for the local node and proc so these can be separate functions
This commit was SVN r20597.
Этот коммит содержится в:
родитель
2759b8e5e5
Коммит
9c2c17beb0
@ -157,7 +157,11 @@ static int rte_init(char flags)
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_util_setup_local_nidmap_entries())) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* use the std app init to complete the procedure */
|
||||
if (ORTE_SUCCESS != (rc = orte_ess_base_app_setup())) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
|
@ -149,6 +149,10 @@ static int rte_init(char flags)
|
||||
error = "orte_util_nidmap_init";
|
||||
goto error;
|
||||
}
|
||||
if (ORTE_SUCCESS != (ret = orte_util_setup_local_nidmap_entries())) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
|
||||
|
@ -30,17 +30,6 @@ int orte_ess_slurm_component_open(void);
|
||||
int orte_ess_slurm_component_close(void);
|
||||
int orte_ess_slurm_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
/*
|
||||
* Startup / Shutdown
|
||||
*/
|
||||
int orte_ess_slurm_finalize(void);
|
||||
|
||||
/*
|
||||
* Module functions
|
||||
*/
|
||||
int orte_ess_slurm_set_name(void);
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* ORTE_ESS_SLURM_H */
|
||||
|
@ -125,6 +125,11 @@ static int rte_init(char flags)
|
||||
error = "orte_util_nidmap_init";
|
||||
goto error;
|
||||
}
|
||||
if (ORTE_SUCCESS != (ret = orte_util_setup_local_nidmap_entries())) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
error = "orte_util_nidmap_init";
|
||||
goto error;
|
||||
}
|
||||
/* extract the node info from the environment and
|
||||
* build a nidmap from it
|
||||
*/
|
||||
|
@ -48,9 +48,6 @@ int orte_util_nidmap_init(opal_buffer_t *buffer)
|
||||
int32_t cnt;
|
||||
int rc;
|
||||
opal_byte_object_t *bo;
|
||||
orte_nid_t *node;
|
||||
orte_jmap_t *jmap;
|
||||
orte_pmap_t pmap;
|
||||
|
||||
if (!initialized) {
|
||||
/* need to construct the global arrays */
|
||||
@ -68,28 +65,6 @@ int orte_util_nidmap_init(opal_buffer_t *buffer)
|
||||
|
||||
/* it is okay if the buffer is empty */
|
||||
if (NULL == buffer || 0 == buffer->bytes_used) {
|
||||
/* if the buffer is empty, add a jmap entry for myself */
|
||||
jmap = OBJ_NEW(orte_jmap_t);
|
||||
jmap->job = ORTE_PROC_MY_NAME->jobid;
|
||||
opal_pointer_array_add(&orte_jobmap, jmap);
|
||||
jmap->num_procs = 1;
|
||||
|
||||
/* create a nidmap entry for this node */
|
||||
node = OBJ_NEW(orte_nid_t);
|
||||
node->name = strdup(orte_process_info.nodename);
|
||||
node->daemon = ORTE_PROC_MY_DAEMON->vpid;
|
||||
node->arch = orte_process_info.arch;
|
||||
OBJ_CONSTRUCT(&pmap, orte_pmap_t);
|
||||
pmap.local_rank = 0;
|
||||
pmap.node_rank = 0;
|
||||
pmap.node = opal_pointer_array_add(&orte_nidmap, node);
|
||||
/* value array copies values, so everything must be set before
|
||||
* calling the set_item function
|
||||
*/
|
||||
opal_value_array_set_item(&jmap->pmap, ORTE_PROC_MY_NAME->vpid, &pmap);
|
||||
OBJ_DESTRUCT(&pmap);
|
||||
|
||||
/* all done */
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
@ -149,6 +124,38 @@ void orte_util_nidmap_finalize(void)
|
||||
initialized = false;
|
||||
}
|
||||
|
||||
int orte_util_setup_local_nidmap_entries(void)
|
||||
{
|
||||
orte_nid_t *node;
|
||||
orte_jmap_t *jmap;
|
||||
orte_pmap_t pmap;
|
||||
|
||||
/* add a jmap entry for myself */
|
||||
jmap = OBJ_NEW(orte_jmap_t);
|
||||
jmap->job = ORTE_PROC_MY_NAME->jobid;
|
||||
opal_pointer_array_add(&orte_jobmap, jmap);
|
||||
jmap->num_procs = 1;
|
||||
|
||||
/* create a nidmap entry for this node */
|
||||
node = OBJ_NEW(orte_nid_t);
|
||||
node->name = strdup(orte_process_info.nodename);
|
||||
node->daemon = ORTE_PROC_MY_DAEMON->vpid;
|
||||
node->arch = orte_process_info.arch;
|
||||
OBJ_CONSTRUCT(&pmap, orte_pmap_t);
|
||||
pmap.local_rank = 0;
|
||||
pmap.node_rank = 0;
|
||||
node->index = opal_pointer_array_add(&orte_nidmap, node);
|
||||
/* value array copies values, so everything must be set before
|
||||
* calling the set_item function
|
||||
*/
|
||||
pmap.node = node->index;
|
||||
opal_value_array_set_item(&jmap->pmap, ORTE_PROC_MY_NAME->vpid, &pmap);
|
||||
OBJ_DESTRUCT(&pmap);
|
||||
|
||||
/* all done */
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
int orte_util_encode_nodemap(opal_byte_object_t *boptr)
|
||||
{
|
||||
orte_vpid_t *vpids;
|
||||
|
@ -45,6 +45,8 @@ BEGIN_C_DECLS
|
||||
|
||||
ORTE_DECLSPEC int orte_util_nidmap_init(opal_buffer_t *buffer);
|
||||
ORTE_DECLSPEC void orte_util_nidmap_finalize(void);
|
||||
ORTE_DECLSPEC int orte_util_setup_local_nidmap_entries(void);
|
||||
|
||||
ORTE_DECLSPEC orte_jmap_t* orte_util_lookup_jmap(orte_jobid_t job);
|
||||
ORTE_DECLSPEC orte_pmap_t* orte_util_lookup_pmap(orte_process_name_t *proc);
|
||||
ORTE_DECLSPEC orte_nid_t* orte_util_lookup_nid(orte_process_name_t *proc);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user