@@ -613,6 +613,7 @@ ompi_proc_pack(ompi_proc_t **proclist, int proclistsize,
613613 opal_buffer_t * buf )
614614{
615615 int rc ;
616+ char * nspace ;
616617
617618 OPAL_THREAD_LOCK (& ompi_proc_lock );
618619
@@ -629,18 +630,30 @@ ompi_proc_pack(ompi_proc_t **proclist, int proclistsize,
629630 * can be sent.
630631 */
631632 for (int i = 0 ; i < proclistsize ; ++ i ) {
633+ /* send proc name */
632634 rc = opal_dss .pack (buf , & (proclist [i ]-> super .proc_name ), 1 , OMPI_NAME );
633635 if (rc != OPAL_SUCCESS ) {
634636 OMPI_ERROR_LOG (rc );
635637 OPAL_THREAD_UNLOCK (& ompi_proc_lock );
636638 return rc ;
637639 }
640+ /* retrieve and send the corresponding nspace for this job
641+ * as the remote side may not know the translation */
642+ nspace = (char * )opal_pmix .get_nspace (proclist [i ]-> super .proc_name .jobid );
643+ rc = opal_dss .pack (buf , & nspace , 1 , OPAL_STRING );
644+ if (rc != OPAL_SUCCESS ) {
645+ OMPI_ERROR_LOG (rc );
646+ OPAL_THREAD_UNLOCK (& ompi_proc_lock );
647+ return rc ;
648+ }
649+ /* pack architecture flag */
638650 rc = opal_dss .pack (buf , & (proclist [i ]-> super .proc_arch ), 1 , OPAL_UINT32 );
639651 if (rc != OPAL_SUCCESS ) {
640652 OMPI_ERROR_LOG (rc );
641653 OPAL_THREAD_UNLOCK (& ompi_proc_lock );
642654 return rc ;
643655 }
656+ /* pass the name of the host this proc is on */
644657 rc = opal_dss .pack (buf , & (proclist [i ]-> super .proc_hostname ), 1 , OPAL_STRING );
645658 if (rc != OPAL_SUCCESS ) {
646659 OMPI_ERROR_LOG (rc );
@@ -720,6 +733,7 @@ ompi_proc_unpack(opal_buffer_t* buf,
720733 char * new_hostname ;
721734 bool isnew = false;
722735 int rc ;
736+ char * nspace ;
723737
724738 rc = opal_dss .unpack (buf , & new_name , & count , OMPI_NAME );
725739 if (rc != OPAL_SUCCESS ) {
@@ -728,6 +742,15 @@ ompi_proc_unpack(opal_buffer_t* buf,
728742 free (newprocs );
729743 return rc ;
730744 }
745+ rc = opal_dss .unpack (buf , & nspace , & count , OPAL_STRING );
746+ if (rc != OPAL_SUCCESS ) {
747+ OMPI_ERROR_LOG (rc );
748+ free (plist );
749+ free (newprocs );
750+ return rc ;
751+ }
752+ opal_pmix .register_jobid (new_name .jobid , nspace );
753+ free (nspace );
731754 rc = opal_dss .unpack (buf , & new_arch , & count , OPAL_UINT32 );
732755 if (rc != OPAL_SUCCESS ) {
733756 OMPI_ERROR_LOG (rc );
0 commit comments