mpir/pmi: Reorder options for building nodemap

1. Try to get process mapping string from PMI server. This is how Hydra
   provides the information and is thus the preferred method for MPICH.
2. If using PMIx, use discovery functions. This is the preferred method
   when using 3rd party PMIx libraries.
3. Use fallback method, i.e. putting and getting node,rank pairs via the
   PMI KVS.
Esse commit está contido em:
Ken Raffenetti
2024-10-09 09:48:21 -05:00
commit c25a2c7864
+10 -12
Ver Arquivo
@@ -343,20 +343,18 @@ char *MPIR_pmi_get_jobattr(const char *key)
int MPIR_pmi_build_nodemap(int *nodemap, int sz)
{
int mpi_errno = MPI_SUCCESS;
if (MPIR_CVAR_PMI_VERSION == MPIR_CVAR_PMI_VERSION_x) {
char *process_mapping = MPIR_pmi_get_jobattr("PMI_process_mapping");
if (process_mapping) {
int mpl_err = MPL_rankmap_str_to_array(process_mapping, sz, nodemap);
MPIR_ERR_CHKINTERNAL(mpl_err, mpi_errno,
"unable to populate node ids from PMI_process_mapping");
MPL_free(process_mapping);
} else if (MPIR_CVAR_PMI_VERSION == MPIR_CVAR_PMI_VERSION_x) {
mpi_errno = pmix_build_nodemap(nodemap, sz);
} else {
char *process_mapping = MPIR_pmi_get_jobattr("PMI_process_mapping");
if (process_mapping) {
int mpl_err = MPL_rankmap_str_to_array(process_mapping, sz, nodemap);
MPIR_ERR_CHKINTERNAL(mpl_err, mpi_errno,
"unable to populate node ids from PMI_process_mapping");
MPL_free(process_mapping);
} else {
/* build nodemap based on allgather hostnames */
mpi_errno = MPIR_pmi_build_nodemap_fallback(sz, MPIR_Process.rank, nodemap);
};
}
/* build nodemap based on allgather hostnames */
mpi_errno = MPIR_pmi_build_nodemap_fallback(sz, MPIR_Process.rank, nodemap);
};
fn_exit:
return mpi_errno;
fn_fail: