Skip to content

Commit 8b07775

Browse files
committed
Use an OPAL-prefixed abstraction for PMIX_PACKAGE_RANK
If someone configures against PMIx v4.1 or above, the configure logic will correctly detect the presence of PMIX_PACKAGE_RANK. However, the internal code only includes the opal/mca/pmix headers and thus only the OPAL-prefixed PMIx abstractions are available. Add an OPAL_PMIX_PACKAGE_RANK abstraction and update the common/ofi code to use it. Signed-off-by: Ralph Castain <[email protected]>
1 parent 09c0ada commit 8b07775

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

opal/mca/common/ofi/common_ofi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,19 +312,17 @@ static uint32_t get_package_rank(int32_t num_local_peers, uint16_t my_local_rank
312312
char *local_peers = NULL;
313313
char *locality_string = NULL;
314314
char *mylocality = NULL;
315+
uint16_t *package_rank_ptr;
315316

316317
pname.jobid = OPAL_PROC_MY_NAME.jobid;
317318
pname.vpid = OPAL_VPID_WILDCARD;
318319

319-
#if HAVE_DECL_PMIX_PACKAGE_RANK
320-
uint16_t *package_rank_ptr;
321320
// Try to get the PACKAGE_RANK from PMIx
322-
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_PACKAGE_RANK,
321+
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_PACKAGE_RANK,
323322
&pname, &package_rank_ptr, OPAL_UINT16);
324323
if (OPAL_SUCCESS == rc) {
325324
return (uint32_t)*package_rank_ptr;
326325
}
327-
#endif
328326

329327
// Get the local peers
330328
OPAL_MODEX_RECV_VALUE(rc, OPAL_PMIX_LOCAL_PEERS,

opal/mca/pmix/pmix_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
33
* Copyright (c) 2016 Research Organization for Information Science
44
* and Technology (RIST). All rights reserved.
5+
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
56
* $COPYRIGHT$
67
*
78
* Additional copyrights may follow
@@ -130,6 +131,7 @@ BEGIN_C_DECLS
130131
#define OPAL_PMIX_NPROC_OFFSET "pmix.offset" // (uint32_t) starting global rank of this job
131132
#define OPAL_PMIX_LOCAL_RANK "pmix.lrank" // (uint16_t) rank on this node within this job
132133
#define OPAL_PMIX_NODE_RANK "pmix.nrank" // (uint16_t) rank on this node spanning all jobs
134+
#define OPAL_PMIX_PACKAGE_RANK "pmix.pkgrank" // (uint16_t) rank within this job on the package where this proc resides
133135
#define OPAL_PMIX_LOCALLDR "pmix.lldr" // (uint64_t) opal_identifier of lowest rank on this node within this job
134136
#define OPAL_PMIX_APPLDR "pmix.aldr" // (uint32_t) lowest rank in this app within this job
135137
#define OPAL_PMIX_PROC_PID "pmix.ppid" // (pid_t) pid of specified proc

0 commit comments

Comments
 (0)