Skip to content

Commit 0ce9cae

Browse files
committed
some PR feedback
Signed-off-by: Howard Pritchard <[email protected]>
1 parent e7ef1be commit 0ce9cae

File tree

4 files changed

+31
-18
lines changed

4 files changed

+31
-18
lines changed

ompi/communicator/comm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* Copyright (c) 2015 Mellanox Technologies. All rights reserved.
2525
* Copyright (c) 2017-2022 IBM Corporation. All rights reserved.
2626
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
27-
* Copyright (c) 2018-2022 Triad National Security, LLC. All rights
27+
* Copyright (c) 2018-2024 Triad National Security, LLC. All rights
2828
* reserved.
2929
* Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
3030
* $COPYRIGHT$
@@ -1738,7 +1738,7 @@ int ompi_intercomm_create_from_groups (ompi_group_t *local_group, int local_lead
17381738
ompi_communicator_t **newintercomm)
17391739
{
17401740
ompi_communicator_t *newcomp = NULL, *local_comm, *leader_comm = MPI_COMM_NULL;
1741-
ompi_comm_extended_cid_block_t new_block = {{0}};
1741+
ompi_comm_extended_cid_block_t new_block = {0};
17421742
bool i_am_leader = local_leader == local_group->grp_my_rank;
17431743
ompi_proc_t **rprocs;
17441744
uint64_t data[4];

ompi/communicator/comm_cid.c

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static int ompi_comm_ext_cid_new_block (ompi_communicator_t *newcomm, ompi_commu
315315
opal_process_name_t opal_proc_name;
316316
bool cid_base_set = false;
317317
char *tag = NULL;
318-
size_t proc_count = 0, rproc_count = 0, cid_base = 0UL, ninfo;
318+
size_t proc_count = 0, rproc_count = 0, tproc_count = 0, cid_base = 0UL, ninfo;
319319
int rc, leader_rank;
320320
pmix_proc_t *procs;
321321
void *grpinfo = NULL, *list = NULL;
@@ -338,13 +338,15 @@ static int ompi_comm_ext_cid_new_block (ompi_communicator_t *newcomm, ompi_commu
338338

339339
grpinfo = PMIx_Info_list_start();
340340
if (NULL == grpinfo) {
341-
return OMPI_ERR_OUT_OF_RESOURCE ;
341+
rc = OMPI_ERR_OUT_OF_RESOURCE;
342+
goto fn_exit;
342343
}
343344

344345
rc = PMIx_Info_list_add(grpinfo, PMIX_GROUP_ASSIGN_CONTEXT_ID, NULL, PMIX_BOOL);
345346
if (PMIX_SUCCESS != rc) {
346347
OPAL_OUTPUT_VERBOSE((10, ompi_comm_output, "PMIx_Info_list_add failed %s %d", PMIx_Error_string(rc), __LINE__));
347-
return OMPI_ERR_OUT_OF_RESOURCE ;
348+
rc = OMPI_ERR_OUT_OF_RESOURCE;
349+
goto fn_exit;
348350
}
349351

350352
list = PMIx_Info_list_start();
@@ -353,32 +355,34 @@ static int ompi_comm_ext_cid_new_block (ompi_communicator_t *newcomm, ompi_commu
353355
rc = PMIx_Info_list_add(list, PMIX_GROUP_LOCAL_CID, &c_index, PMIX_SIZE);
354356
if (PMIX_SUCCESS != rc) {
355357
OPAL_OUTPUT_VERBOSE((10, ompi_comm_output, "PMIx_Info_list_add failed %s %d", PMIx_Error_string(rc), __LINE__));
356-
return OMPI_ERR_OUT_OF_RESOURCE ;
358+
rc = OMPI_ERR_OUT_OF_RESOURCE;
359+
goto fn_exit;
357360
}
358361

359362
rc = PMIx_Info_list_convert(list, &darray);
360363
if (PMIX_SUCCESS != rc) {
361364
OPAL_OUTPUT_VERBOSE((10, ompi_comm_output, "PMIx_Info_list_convert failed %s %d", PMIx_Error_string(rc), __LINE__));
362-
return OMPI_ERR_OUT_OF_RESOURCE ;
365+
rc = OMPI_ERR_OUT_OF_RESOURCE;
366+
goto fn_exit;
363367
}
364368
rc = PMIx_Info_list_add(grpinfo, PMIX_GROUP_INFO, &darray, PMIX_DATA_ARRAY);
365369
if (PMIX_SUCCESS != rc) {
366370
OPAL_OUTPUT_VERBOSE((10, ompi_comm_output, "PMIx_Info_list_add failed %s %d", PMIx_Error_string(rc), __LINE__));
367-
return OMPI_ERR_OUT_OF_RESOURCE ;
371+
PMIX_DATA_ARRAY_DESTRUCT(&darray);
372+
rc = OMPI_ERR_OUT_OF_RESOURCE;
373+
goto fn_exit;
368374
}
369-
PMIx_Info_list_release(list);
370375
PMIX_DATA_ARRAY_DESTRUCT(&darray);
371376

372-
373377
rc = PMIx_Info_list_convert(grpinfo, &darray);
374378
if (PMIX_SUCCESS != rc) {
375379
OPAL_OUTPUT_VERBOSE((10, ompi_comm_output, "PMIx_Info_list_convert failed %s %d", PMIx_Error_string(rc), __LINE__));
376-
return OMPI_ERR_OUT_OF_RESOURCE ;
380+
rc = OMPI_ERR_OUT_OF_RESOURCE;
381+
goto fn_exit;
377382
}
378383

379384
pinfo = (pmix_info_t*)darray.array;
380385
ninfo = darray.size;
381-
PMIx_Info_list_release(grpinfo);
382386

383387
proc_count = newcomm->c_local_group->grp_proc_count;
384388
if ( OMPI_COMM_IS_INTER (newcomm) ){
@@ -396,10 +400,11 @@ static int ompi_comm_ext_cid_new_block (ompi_communicator_t *newcomm, ompi_commu
396400
OPAL_PMIX_CONVERT_NAME(&procs[proc_count+i],&opal_proc_name);
397401
}
398402

403+
tproc_count = proc_count + rproc_count;
399404

400405
OPAL_OUTPUT_VERBOSE((10, ompi_comm_output, "calling PMIx_Group_construct - tag %s size %ld ninfo %ld cid_base %ld\n",
401-
tag, proc_count + rproc_count, ninfo, cid_base));
402-
rc = PMIx_Group_construct(tag, procs, proc_count + rproc_count, pinfo, ninfo, &results, &nresults);
406+
tag, tproc_count, ninfo, cid_base));
407+
rc = PMIx_Group_construct(tag, procs, tproc_count, pinfo, ninfo, &results, &nresults);
403408
PMIX_DATA_ARRAY_DESTRUCT(&darray);
404409
if(PMIX_SUCCESS != rc) {
405410
char msg_string[1024];
@@ -443,7 +448,7 @@ static int ompi_comm_ext_cid_new_block (ompi_communicator_t *newcomm, ompi_commu
443448
}
444449

445450
OPAL_OUTPUT_VERBOSE((10, ompi_comm_output, "PMIx_Group_construct - tag %s size %ld ninfo %ld cid_base %ld\n",
446-
tag, proc_count + rproc_count, ninfo, cid_base));
451+
tag, tproc_count, ninfo, cid_base));
447452

448453
/* destruct the group */
449454
rc = PMIx_Group_destruct (tag, NULL, 0);
@@ -468,10 +473,18 @@ static int ompi_comm_ext_cid_new_block (ompi_communicator_t *newcomm, ompi_commu
468473
}
469474

470475
if(NULL != procs) {
471-
PMIX_PROC_FREE(procs, proc_count);
476+
PMIX_PROC_FREE(procs, tproc_count);
472477
procs = NULL;
473478
}
474479

480+
if (NULL != grpinfo) {
481+
PMIx_Info_list_release(grpinfo);
482+
}
483+
484+
if (NULL != list) {
485+
PMIx_Info_list_release(list);
486+
}
487+
475488
return rc;
476489
}
477490

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ ompi_mtl_ofi_send_generic(struct mca_mtl_base_module_t *mtl,
591591
mtl_comm = comm->c_mtl_comm;
592592
/*
593593
* if we do not have the local cid for the target receiver,
594-
* retrive via the PMIx modex
594+
* retrieve via the PMIx modex
595595
*/
596596
if (mtl_comm->c_index_vec[dest].c_index == 0) {
597597
ompi_ret = ompi_comm_get_remote_cid(comm, dest, &remote_cid);

ompi/runtime/params.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ OMPI_DECLSPEC extern int ompi_mpi_event_tick_rate;
192192
OMPI_DECLSPEC extern bool ompi_mpi_yield_when_idle;
193193

194194
/**
195-
* A integer value specifying verbosity level for communicator management
195+
* An integer value specifying verbosity level for communicator management
196196
* subsystem.
197197
*/
198198
OMPI_DECLSPEC extern int ompi_comm_verbose_level;

0 commit comments

Comments
 (0)