Skip to content

Commit 88077e1

Browse files
committed
ofi/common/ofi: fix package rank calculation bug
This patch fixes a bug in package rank calculation. The peer rank returned via PMIX_LOCAL_PEERS is the global rank. Matching it with local rank was wrong. Signed-off-by: Wenduo Wang <wenduwan@amazon.com>
1 parent 8185faf commit 88077e1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

opal/mca/common/ofi/common_ofi.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,13 +698,14 @@ static int count_providers(struct fi_info *provider_list)
698698
return num_provider;
699699
}
700700

701-
/* Calculate the current process package rank.
702-
* @param (IN) process_info struct opal_process_info_t information
703-
* about the current process. used to get
704-
* num_local_peers, myprocid.rank, and
705-
* my_local_rank.
701+
/**
702+
* @brief the current process package rank.
703+
*
704+
* @param[in] process_info struct opal_process_info_t information
705+
* about the current process. used to get
706+
* num_local_peers, myprocid.rank.
706707
*
707-
* @param (OUT) uint32_t package rank or myprocid.rank
708+
* @return package rank or myprocid.rank
708709
*
709710
* If successful, returns PMIX_PACKAGE_RANK, or an
710711
* equivalent calculated package rank.
@@ -765,7 +766,7 @@ static uint32_t get_package_rank(opal_process_info_t *process_info)
765766
locality_string);
766767
free(locality_string);
767768

768-
if ((uint16_t) pname.vpid == process_info->my_local_rank) {
769+
if ((uint16_t) pname.vpid == process_info->myprocid.rank) {
769770
return ranks_on_package;
770771
}
771772

0 commit comments

Comments
 (0)