Commit a12a4110 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r5667] Allow users to pick the PMI version they want based on environment

settings. We currently use this to switch between PMI-1 and
PMI-1.1. PMI-2 is still a configure option, but with the recent
changes to use non-conflicting symbols, it can use this code in the
future as well.

Reviewed by goodell.
parent 817e88c4
......@@ -62,6 +62,9 @@
#define MAX_HOSTNAME_LEN MAXHOSTNAMELEN
#endif
/* Default PMI version to use */
#define MPIU_DEFAULT_PMI_VERSION 1
#define MPIU_DEFAULT_PMI_SUBVERSION 1
/* This allows us to keep names local to a single file when we can use
weak symbols */
......
......@@ -1085,8 +1085,13 @@ int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
char *node_name_buf;
int no_local = 0;
int odd_even_cliques = 0;
int pmi_version = MPIU_DEFAULT_PMI_VERSION, pmi_subversion = MPIU_DEFAULT_PMI_SUBVERSION;
MPIU_CHKLMEM_DECL(4);
/* See if the user wants to override our default values */
MPIU_GetEnvInt("PMI_VERSION", &pmi_version);
MPIU_GetEnvInt("PMI_SUBVERSION", &pmi_subversion);
if (pg->size == 1) {
pg->vct[0].node_id = g_num_nodes++;
goto fn_exit;
......@@ -1188,24 +1193,26 @@ int MPIDI_Populate_vc_node_ids(MPIDI_PG_t *pg, int our_pg_rank)
/* See if process manager supports PMI_process_mapping keyval */
/* FIXME 'PMI_process_mapping' only applies for the original PG (MPI_COMM_WORLD) */
pmi_errno = PMI_KVS_Get(kvs_name, "PMI_process_mapping", value, val_max_sz);
if (pmi_errno == 0) {
int did_map = 0;
int num_nodes = 0;
/* this code currently assumes pg is comm_world */
mpi_errno = populate_ids_from_mapping(value, &num_nodes, pg, &did_map);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
g_num_nodes = num_nodes;
if (did_map) {
goto fn_exit;
if (pmi_version == 1 && pmi_subversion == 1) {
pmi_errno = PMI_KVS_Get(kvs_name, "PMI_process_mapping", value, val_max_sz);
if (pmi_errno == 0) {
int did_map = 0;
int num_nodes = 0;
/* this code currently assumes pg is comm_world */
mpi_errno = populate_ids_from_mapping(value, &num_nodes, pg, &did_map);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
g_num_nodes = num_nodes;
if (did_map) {
goto fn_exit;
}
else {
MPIU_DBG_MSG_S(CH3_OTHER,TERSE,"did_map==0, unable to populate node ids from mapping=%s",value);
}
/* else fall through to O(N^2) PMI_KVS_Gets version */
}
else {
MPIU_DBG_MSG_S(CH3_OTHER,TERSE,"did_map==0, unable to populate node ids from mapping=%s",value);
MPIU_DBG_MSG(CH3_OTHER,TERSE,"unable to obtain the 'PMI_process_mapping' PMI key");
}
/* else fall through to O(N^2) PMI_KVS_Gets version */
}
else {
MPIU_DBG_MSG(CH3_OTHER,TERSE,"unable to obtain the 'PMI_process_mapping' PMI key");
}
mpi_errno = publish_node_id(pg, our_pg_rank);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment