@@ -1285,7 +1285,7 @@ static int ompi_instance_get_pmix_pset_size (ompi_instance_t *instance, const ch
12851285 OPAL_PMIX_CONVERT_NAME (& p , & name );
12861286 rc = PMIx_Get (& p , PMIX_PSET_NAME , NULL , 0 , & pval );
12871287 if (OPAL_UNLIKELY (PMIX_SUCCESS != rc )) {
1288- return rc ;
1288+ return opal_pmix_convert_status ( rc ) ;
12891289 }
12901290
12911291 PMIX_VALUE_UNLOAD (rc ,
@@ -1296,6 +1296,7 @@ static int ompi_instance_get_pmix_pset_size (ompi_instance_t *instance, const ch
12961296 size += (0 == strcmp (pset_name , stmp ));
12971297 PMIX_VALUE_RELEASE (pval );
12981298 free (stmp );
1299+ stmp = NULL ;
12991300
13001301 ++ size ;
13011302 }
@@ -1336,7 +1337,7 @@ int ompi_instance_get_pset_info (ompi_instance_t *instance, const char *pset_nam
13361337 ompi_info_t * info = ompi_info_allocate ();
13371338 char tmp [16 ];
13381339 size_t size = 0UL ;
1339- int ret ;
1340+ int ret = OMPI_SUCCESS ;
13401341
13411342 * info_used = (opal_info_t * ) MPI_INFO_NULL ;
13421343
@@ -1346,25 +1347,31 @@ int ompi_instance_get_pset_info (ompi_instance_t *instance, const char *pset_nam
13461347
13471348 if (0 == strncmp (pset_name , "mpi://" , 6 )) {
13481349 pset_name += 6 ;
1349- if (0 == strcmp (pset_name , "world " )) {
1350+ if (0 == strcasecmp (pset_name , "WORLD " )) {
13501351 size = ompi_process_info .num_procs ;
1351- } else if (0 == strcmp (pset_name , "self " )) {
1352+ } else if (0 == strcasecmp (pset_name , "SELF " )) {
13521353 size = 1 ;
1353- } else if (0 == strcmp (pset_name , "shared" )) {
1354+ }
1355+ } else if (0 == strncmp (pset_name , "mpix://" , 7 )) {
1356+ pset_name += 7 ;
1357+ if (0 == strcasecmp (pset_name , "SHARED" )) {
13541358 size = ompi_process_info .num_local_peers + 1 ;
13551359 }
13561360 } else {
1357- ompi_instance_get_pmix_pset_size (instance , pset_name , & size );
1361+ ret = ompi_instance_get_pmix_pset_size (instance , pset_name , & size );
13581362 }
13591363
1360- snprintf (tmp , 16 , "%" PRIsize_t , size );
1361- ret = opal_info_set (& info -> super , MPI_INFO_KEY_SESSION_PSET_SIZE , tmp );
1362- if (OPAL_UNLIKELY (OPAL_SUCCESS != ret )) {
1364+ if (OMPI_SUCCESS == ret ) {
1365+ snprintf (tmp , 16 , "%" PRIsize_t , size );
1366+ ret = opal_info_set (& info -> super , MPI_INFO_KEY_SESSION_PSET_SIZE , tmp );
1367+ if (OPAL_UNLIKELY (OPAL_SUCCESS != ret )) {
1368+ ompi_info_free (& info );
1369+ return ret ;
1370+ }
1371+ * info_used = & info -> super ;
1372+ } else {
13631373 ompi_info_free (& info );
1364- return ret ;
13651374 }
13661375
1367- * info_used = & info -> super ;
1368-
1369- return OMPI_SUCCESS ;
1376+ return ret ;
13701377}
0 commit comments