Changeset 5667

Show
Ignore:
Timestamp:
11/02/09 18:10:03 (3 weeks ago)
Author:
balaji
Message:

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.

Location:
mpich2/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/src/include/mpiimpl.h

    r5665 r5667  
    6363#endif 
    6464 
     65/* Default PMI version to use */ 
     66#define MPIU_DEFAULT_PMI_VERSION 1 
     67#define MPIU_DEFAULT_PMI_SUBVERSION 1 
    6568 
    6669/* This allows us to keep names local to a single file when we can use 
  • mpich2/trunk/src/mpid/ch3/src/mpid_vc.c

    r5664 r5667  
    10861086    int no_local = 0; 
    10871087    int odd_even_cliques = 0; 
     1088    int pmi_version = MPIU_DEFAULT_PMI_VERSION, pmi_subversion = MPIU_DEFAULT_PMI_SUBVERSION; 
    10881089    MPIU_CHKLMEM_DECL(4); 
     1090 
     1091    /* See if the user wants to override our default values */ 
     1092    MPIU_GetEnvInt("PMI_VERSION", &pmi_version); 
     1093    MPIU_GetEnvInt("PMI_SUBVERSION", &pmi_subversion); 
    10891094 
    10901095    if (pg->size == 1) { 
     
    11891194 
    11901195    /* FIXME 'PMI_process_mapping' only applies for the original PG (MPI_COMM_WORLD) */ 
    1191     pmi_errno = PMI_KVS_Get(kvs_name, "PMI_process_mapping", value, val_max_sz); 
    1192     if (pmi_errno == 0) { 
    1193         int did_map = 0; 
    1194         int num_nodes = 0; 
    1195         /* this code currently assumes pg is comm_world */ 
    1196         mpi_errno = populate_ids_from_mapping(value, &num_nodes, pg, &did_map); 
    1197         if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
    1198         g_num_nodes = num_nodes; 
    1199         if (did_map) { 
    1200             goto fn_exit; 
     1196    if (pmi_version == 1 && pmi_subversion == 1) { 
     1197        pmi_errno = PMI_KVS_Get(kvs_name, "PMI_process_mapping", value, val_max_sz); 
     1198        if (pmi_errno == 0) { 
     1199            int did_map = 0; 
     1200            int num_nodes = 0; 
     1201            /* this code currently assumes pg is comm_world */ 
     1202            mpi_errno = populate_ids_from_mapping(value, &num_nodes, pg, &did_map); 
     1203            if (mpi_errno) MPIU_ERR_POP(mpi_errno); 
     1204            g_num_nodes = num_nodes; 
     1205            if (did_map) { 
     1206                goto fn_exit; 
     1207            } 
     1208            else { 
     1209                MPIU_DBG_MSG_S(CH3_OTHER,TERSE,"did_map==0, unable to populate node ids from mapping=%s",value); 
     1210            } 
     1211            /* else fall through to O(N^2) PMI_KVS_Gets version */ 
    12011212        } 
    12021213        else { 
    1203             MPIU_DBG_MSG_S(CH3_OTHER,TERSE,"did_map==0, unable to populate node ids from mapping=%s",value); 
     1214            MPIU_DBG_MSG(CH3_OTHER,TERSE,"unable to obtain the 'PMI_process_mapping' PMI key"); 
    12041215        } 
    1205         /* else fall through to O(N^2) PMI_KVS_Gets version */ 
    1206     } 
    1207     else { 
    1208         MPIU_DBG_MSG(CH3_OTHER,TERSE,"unable to obtain the 'PMI_process_mapping' PMI key"); 
    12091216    } 
    12101217