1
1

Define a new key and store the process name of the local_rank=0 process on each node so that the MPI layer can retrieve it as desired.

This commit was SVN r30759.
Этот коммит содержится в:
Ralph Castain 2014-02-18 00:32:58 +00:00
родитель 98530055d1
Коммит 262c927778
4 изменённых файлов: 27 добавлений и 0 удалений

Просмотреть файл

@ -53,6 +53,7 @@ typedef struct {
/* define an RTE-agnostic process identifier */
typedef uint64_t opal_identifier_t;
#define OPAL_ID_T OPAL_UINT64
/* Type defines for packing and unpacking */
#define OPAL_UNDEF (opal_data_type_t) 0 /**< type hasn't been defined yet */

Просмотреть файл

@ -30,6 +30,7 @@ BEGIN_C_DECLS
#define OPAL_DB_JOB_SDIR "opal.job.session.dir"
#define OPAL_DB_MY_SDIR "opal.my.session.dir"
#define OPAL_DB_LOCALRANK "opal.local.rank"
#define OPAL_DB_LOCALLDR "opal.local.ldr"
END_C_DECLS

Просмотреть файл

@ -95,6 +95,7 @@ static int rte_init(void)
int *ranks=NULL;
orte_jobid_t jobid;
char *rmluri;
orte_process_name_t ldr;
/* run the prolog */
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
@ -333,6 +334,14 @@ static int rte_init(void)
break;
}
}
/* store the name of the local leader */
ldr.jobid = ORTE_PROC_MY_NAME->jobid;
ldr.vpid = ranks[0];
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)&ldr, OPAL_SCOPE_INTERNAL,
OPAL_DB_LOCALLDR, (opal_identifier_t*)&ldr, OPAL_ID_T))) {
error = "storing local leader";
goto error;
}
free(ranks);
/* setup process binding */

Просмотреть файл

@ -979,6 +979,14 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
/* set mine */
orte_process_info.my_local_rank = local_rank;
orte_process_info.my_node_rank = node_rank;
/* if we are the local leader (i.e., local_rank=0), then record it */
if (0 == local_rank) {
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_SCOPE_INTERNAL,
OPAL_DB_LOCALLDR, (opal_identifier_t*)&proc, OPAL_ID_T))) {
ORTE_ERROR_LOG(rc);
goto cleanup;
}
}
#if OPAL_HAVE_HWLOC
if (NULL != cpu_bitmap) {
orte_process_info.cpuset = strdup(cpu_bitmap);
@ -988,6 +996,14 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo)
dmn.vpid == ORTE_PROC_MY_DAEMON->vpid) {
/* if we share a daemon, then add to my local peers */
orte_process_info.num_local_peers++;
/* if this is the local leader (i.e., local_rank=0), then record it */
if (0 == local_rank) {
if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_SCOPE_INTERNAL,
OPAL_DB_LOCALLDR, (opal_identifier_t*)&proc, OPAL_ID_T))) {
ORTE_ERROR_LOG(rc);
goto cleanup;
}
}
}
/* apps don't need the rest of the data in the buffer for this proc,
* but we have to unpack it anyway to stay in sync