Index: ompi/mca/mtl/psm/mtl_psm.c =================================================================== --- ompi/mca/mtl/psm/mtl_psm.c (revision 17385) +++ ompi/mca/mtl/psm/mtl_psm.c (working copy) @@ -102,6 +102,18 @@ } + /* + * Figure out how many procs are running on this host to handle context + * sharing corner cases. + */ + if (orte_process_info.num_local_procs > 0) { + char buf[16]; + snprintf(buf, sizeof buf - 1, "%d", orte_process_info.num_local_procs); + setenv("MPI_LOCALNRANKS", buf, 0); + snprintf(buf, sizeof buf - 1, "%d", orte_process_info.local_rank); + setenv("MPI_LOCALRANKID", buf, 0); + } + /* Handle our own errors for opening endpoints */ psm_error_register_handler(ompi_mtl_psm.ep, ompi_mtl_psm_errhandler);