@@ -86,9 +86,6 @@ void ompi_proc_destruct(ompi_proc_t* proc)
8686 * destroyed here. It will be destroyed later when the ompi_datatype_finalize is called.
8787 */
8888 OBJ_RELEASE ( proc -> super .proc_convertor );
89- if (NULL != proc -> super .proc_hostname ) {
90- free (proc -> super .proc_hostname );
91- }
9289 opal_mutex_lock (& ompi_proc_lock );
9390 opal_list_remove_item (& ompi_proc_list , (opal_list_item_t * )proc );
9491 opal_hash_table_remove_value_ptr (& ompi_proc_hash , & proc -> super .proc_name , sizeof (proc -> super .proc_name ));
@@ -135,22 +132,12 @@ static int ompi_proc_allocate (ompi_jobid_t jobid, ompi_vpid_t vpid, ompi_proc_t
135132 */
136133int ompi_proc_complete_init_single (ompi_proc_t * proc )
137134{
138- int ret ;
139-
140135 if ((OMPI_CAST_RTE_NAME (& proc -> super .proc_name )-> jobid == OMPI_PROC_MY_NAME -> jobid ) &&
141136 (OMPI_CAST_RTE_NAME (& proc -> super .proc_name )-> vpid == OMPI_PROC_MY_NAME -> vpid )) {
142137 /* nothing else to do */
143138 return OMPI_SUCCESS ;
144139 }
145140
146- /* we can retrieve the hostname at no cost because it
147- * was provided at startup - but make it optional so
148- * we don't chase after it if some system doesn't
149- * provide it */
150- proc -> super .proc_hostname = NULL ;
151- OPAL_MODEX_RECV_VALUE_OPTIONAL (ret , PMIX_HOSTNAME , & proc -> super .proc_name ,
152- (char * * )& (proc -> super .proc_hostname ), PMIX_STRING );
153-
154141#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
155142 /* get the remote architecture - this might force a modex except
156143 * for those environments where the RM provides it */
@@ -264,7 +251,6 @@ int ompi_proc_init(void)
264251 /* set local process data */
265252 ompi_proc_local_proc = proc ;
266253 proc -> super .proc_flags = OPAL_PROC_ALL_LOCAL ;
267- proc -> super .proc_hostname = strdup (ompi_process_info .nodename );
268254 proc -> super .proc_arch = opal_local_arch ;
269255 /* Register the local proc with OPAL */
270256 opal_proc_local_set (& proc -> super );
@@ -609,7 +595,6 @@ int ompi_proc_refresh(void)
609595 if (i == OMPI_PROC_MY_NAME -> vpid ) {
610596 ompi_proc_local_proc = proc ;
611597 proc -> super .proc_flags = OPAL_PROC_ALL_LOCAL ;
612- proc -> super .proc_hostname = ompi_process_info .nodename ;
613598 proc -> super .proc_arch = opal_local_arch ;
614599 opal_proc_local_set (& proc -> super );
615600 } else {
@@ -676,13 +661,6 @@ ompi_proc_pack(ompi_proc_t **proclist, int proclistsize,
676661 opal_mutex_unlock (& ompi_proc_lock );
677662 return rc ;
678663 }
679- /* pass the name of the host this proc is on */
680- rc = opal_dss .pack (buf , & (proc -> super .proc_hostname ), 1 , OPAL_STRING );
681- if (rc != OPAL_SUCCESS ) {
682- OMPI_ERROR_LOG (rc );
683- opal_mutex_unlock (& ompi_proc_lock );
684- return rc ;
685- }
686664 }
687665 opal_mutex_unlock (& ompi_proc_lock );
688666 return OMPI_SUCCESS ;
@@ -747,10 +725,10 @@ ompi_proc_unpack(opal_buffer_t* buf,
747725 int32_t count = 1 ;
748726 ompi_process_name_t new_name ;
749727 uint32_t new_arch ;
750- char * new_hostname ;
751728 bool isnew = false;
752729 int rc ;
753730 char * nspace ;
731+ uint16_t u16 , * u16ptr ;
754732
755733 rc = opal_dss .unpack (buf , & new_name , & count , OMPI_NAME );
756734 if (rc != OPAL_SUCCESS ) {
@@ -774,13 +752,6 @@ ompi_proc_unpack(opal_buffer_t* buf,
774752 free (newprocs );
775753 return rc ;
776754 }
777- rc = opal_dss .unpack (buf , & new_hostname , & count , OPAL_STRING );
778- if (rc != OPAL_SUCCESS ) {
779- OMPI_ERROR_LOG (rc );
780- free (plist );
781- free (newprocs );
782- return rc ;
783- }
784755 /* see if this proc is already on our ompi_proc_list */
785756 plist [i ] = ompi_proc_find_and_add (& new_name , & isnew );
786757 if (isnew ) {
@@ -798,27 +769,25 @@ ompi_proc_unpack(opal_buffer_t* buf,
798769 OBJ_RELEASE (plist [i ]-> super .proc_convertor );
799770 plist [i ]-> super .proc_convertor = opal_convertor_create (plist [i ]-> super .proc_arch , 0 );
800771#else
772+ char * errhost = opal_get_proc_hostname (& plist [i ]-> super );
801773 opal_show_help ("help-mpi-runtime.txt" ,
802774 "heterogeneous-support-unavailable" ,
803775 true, ompi_process_info .nodename ,
804- new_hostname == NULL ? "<hostname unavailable>" :
805- new_hostname );
776+ errhost );
806777 free (plist );
807778 free (newprocs );
779+ free (errhost );
808780 return OMPI_ERR_NOT_SUPPORTED ;
809781#endif
810782 }
811783
812- if (NULL != new_hostname ) {
813- if (0 == strcmp (ompi_proc_local_proc -> super .proc_hostname , new_hostname )) {
814- plist [i ]-> super .proc_flags |= (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER );
815- }
816-
817- /* Save the hostname */
818- plist [i ]-> super .proc_hostname = new_hostname ;
784+ /* get the locality information - all RTEs are required
785+ * to provide this information at startup */
786+ u16ptr = & u16 ;
787+ OPAL_MODEX_RECV_VALUE_OPTIONAL (rc , PMIX_LOCALITY , & plist [i ]-> super .proc_name , & u16ptr , PMIX_UINT16 );
788+ if (OPAL_SUCCESS == rc ) {
789+ plist [i ]-> super .proc_flags = u16 ;
819790 }
820- } else if (NULL != new_hostname ) {
821- free (new_hostname );
822791 }
823792 }
824793
0 commit comments