@@ -134,12 +134,6 @@ void free_ofi_prov_resources( int ofi_prov_id)
134134 opal_output_verbose (10 ,orte_rml_base_framework .framework_output ,
135135 " %s - close ep" ,ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ));
136136 CLOSE_FID (orte_rml_ofi .ofi_prov [ofi_prov_id ].ep );
137- if (ret )
138- {
139- opal_output_verbose (10 ,orte_rml_base_framework .framework_output ,
140- " %s - fi_close(ep) failed with error- %d" ,
141- ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),ret );
142- }
143137 }
144138 if (orte_rml_ofi .ofi_prov [ofi_prov_id ].mr_multi_recv ) {
145139 opal_output_verbose (10 ,orte_rml_base_framework .framework_output ,
@@ -745,28 +739,33 @@ static int rml_ofi_component_init(void)
745739 /* pack the provider's name */
746740 if (OPAL_SUCCESS != (ret = opal_dss .pack (& entry , & (orte_rml_ofi .ofi_prov [cur_ofi_prov ].fabric_info -> fabric_attr -> prov_name ), 1 , OPAL_STRING ))) {
747741 OBJ_DESTRUCT (& entry );
742+ free_ofi_prov_resources (cur_ofi_prov );
748743 continue ;
749744 }
750745 /* pack the provider's local index */
751746 if (OPAL_SUCCESS != (ret = opal_dss .pack (& entry , & cur_ofi_prov , 1 , OPAL_UINT8 ))) {
752747 OBJ_DESTRUCT (& entry );
748+ free_ofi_prov_resources (cur_ofi_prov );
753749 continue ;
754750 }
755751 /* pack the size of the provider's connection blob */
756752 if (OPAL_SUCCESS != (ret = opal_dss .pack (& entry , & orte_rml_ofi .ofi_prov [cur_ofi_prov ].epnamelen , 1 , OPAL_SIZE ))) {
757753 OBJ_DESTRUCT (& entry );
754+ free_ofi_prov_resources (cur_ofi_prov );
758755 continue ;
759756 }
760757 /* pack the blob itself */
761- if (OPAL_SUCCESS != (ret = opal_dss .pack (& entry , & orte_rml_ofi .ofi_prov [cur_ofi_prov ].ep_name ,
758+ if (OPAL_SUCCESS != (ret = opal_dss .pack (& entry , orte_rml_ofi .ofi_prov [cur_ofi_prov ].ep_name ,
762759 orte_rml_ofi .ofi_prov [cur_ofi_prov ].epnamelen , OPAL_BYTE ))) {
763760 OBJ_DESTRUCT (& entry );
761+ free_ofi_prov_resources (cur_ofi_prov );
764762 continue ;
765763 }
766764 /* add this entry to the overall modex object */
767765 eptr = & entry ;
768766 if (OPAL_SUCCESS != (ret = opal_dss .pack (& modex , & eptr , 1 , OPAL_BUFFER ))) {
769767 OBJ_DESTRUCT (& entry );
768+ free_ofi_prov_resources (cur_ofi_prov );
770769 continue ;
771770 }
772771 OBJ_DESTRUCT (& entry );
@@ -789,15 +788,6 @@ static int rml_ofi_component_init(void)
789788 ntohs (ep_sockaddr -> sin_port ), inet_ntoa (ep_sockaddr -> sin_addr ));
790789 break ;
791790 }
792- /* end of printing opal_modex_string and port, IP */
793- if (ORTE_SUCCESS != ret ) {
794- opal_output_verbose (1 , orte_rml_base_framework .framework_output ,
795- "%s:%d: OPAL_MODEX_SEND failed: %s\n" ,
796- __FILE__ , __LINE__ , fi_strerror (- ret ));
797- free_ofi_prov_resources (cur_ofi_prov );
798- /*abort this current transport, but check if next transport can be opened*/
799- continue ;
800- }
801791
802792 /**
803793 * Set the ANY_SRC address.
@@ -944,7 +934,8 @@ int get_ofi_prov_id( opal_list_t *attributes)
944934 * (or) ORTE_RML_OFI_PROV_NAME key with values "socket" or "OPA"
945935 * if both above attributes are missing return failure
946936 */
947- if (orte_get_attribute (attributes , ORTE_RML_TRANSPORT_ATTRIB , (void * * )& transport , OPAL_STRING ) ) {
937+ if (orte_get_attribute (attributes , ORTE_RML_TRANSPORT_ATTRIB , (void * * )& transport , OPAL_STRING ) &&
938+ NULL != transport ) {
948939 if ( 0 == strcmp ( transport , "ethernet" ) ) {
949940 provider = ethernet ;
950941 } else if ( 0 == strcmp ( transport , "fabric" ) ) {
@@ -953,21 +944,19 @@ int get_ofi_prov_id( opal_list_t *attributes)
953944 }
954945 /* if from the transport we don't know which provider we want, then check for the ORTE_RML_OFI_PROV_NAME_ATTRIB */
955946 if ( NULL == provider ) {
956- orte_get_attribute (attributes , ORTE_RML_PROVIDER_ATTRIB , (void * * )& provider , OPAL_STRING );
957- }
958- if (NULL != provider )
959- {
960- // loop the orte_rml_ofi.ofi_provs[] and find the provider name that matches
961- for ( prov_num = 0 ; prov_num < orte_rml_ofi .ofi_prov_open_num && ofi_prov_id == RML_OFI_PROV_ID_INVALID ; prov_num ++ ) {
962- cur_fi = orte_rml_ofi .ofi_prov [prov_num ].fabric_info ;
963- opal_output_verbose (20 ,orte_rml_base_framework .framework_output ,
964- "%s - get_ofi_prov_id() -> comparing %s = %s " ,
965- ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),provider ,cur_fi -> fabric_attr -> prov_name );
966- if ( strcmp (provider ,cur_fi -> fabric_attr -> prov_name ) == 0 ) {
967- ofi_prov_id = prov_num ;
947+ if (orte_get_attribute (attributes , ORTE_RML_PROVIDER_ATTRIB , (void * * )& provider , OPAL_STRING ) &&
948+ NULL != provider ) {
949+ // loop the orte_rml_ofi.ofi_provs[] and find the provider name that matches
950+ for ( prov_num = 0 ; prov_num < orte_rml_ofi .ofi_prov_open_num && ofi_prov_id == RML_OFI_PROV_ID_INVALID ; prov_num ++ ) {
951+ cur_fi = orte_rml_ofi .ofi_prov [prov_num ].fabric_info ;
952+ opal_output_verbose (20 ,orte_rml_base_framework .framework_output ,
953+ "%s - get_ofi_prov_id() -> comparing %s = %s " ,
954+ ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),provider ,cur_fi -> fabric_attr -> prov_name );
955+ if ( strcmp (provider ,cur_fi -> fabric_attr -> prov_name ) == 0 ) {
956+ ofi_prov_id = prov_num ;
957+ }
968958 }
969959 }
970-
971960 }
972961
973962 opal_output_verbose (20 ,orte_rml_base_framework .framework_output ,
0 commit comments