Skip to content

Commit b1efec9

Browse files
committed
ofi: fix compile warnings
Properly prefix global symbols, thereby also fixing some "parameter shadows global variable name" warnings. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 99fbd70 commit b1efec9

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* reserved.
77
* Copyright (c) 2018-2020 Amazon.com, Inc. or its affiliates. All rights
88
* reserved.
9-
*
9+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
1010
* $COPYRIGHT$
1111
*
1212
* Additional copyrights may follow
@@ -68,16 +68,16 @@ extern int ompi_mtl_ofi_del_procs(struct mca_mtl_base_module_t *mtl,
6868
int ompi_mtl_ofi_progress_no_inline(void);
6969

7070
#if OPAL_HAVE_THREAD_LOCAL
71-
extern opal_thread_local int per_thread_ctx;
72-
extern opal_thread_local struct fi_cq_tagged_entry wc[MTL_OFI_MAX_PROG_EVENT_COUNT];
71+
extern opal_thread_local int ompi_mtl_ofi_per_thread_ctx;
72+
extern opal_thread_local struct fi_cq_tagged_entry ompi_mtl_ofi_wc[MTL_OFI_MAX_PROG_EVENT_COUNT];
7373
#endif
7474

7575
/* Set OFI context for operations which generate completion events */
7676
__opal_attribute_always_inline__ static inline void
7777
set_thread_context(int ctxt)
7878
{
7979
#if OPAL_HAVE_THREAD_LOCAL
80-
per_thread_ctx = ctxt;
80+
ompi_mtl_ofi_per_thread_ctx = ctxt;
8181
return;
8282
#endif
8383
}
@@ -87,7 +87,7 @@ __opal_attribute_always_inline__ static inline void
8787
get_thread_context(int *ctxt)
8888
{
8989
#if OPAL_HAVE_THREAD_LOCAL
90-
*ctxt = per_thread_ctx;
90+
*ctxt = ompi_mtl_ofi_per_thread_ctx;
9191
#endif
9292
return;
9393
}
@@ -106,24 +106,24 @@ ompi_mtl_ofi_context_progress(int ctxt_id)
106106
struct fi_cq_err_entry error = { 0 };
107107
ssize_t ret;
108108
#if !OPAL_HAVE_THREAD_LOCAL
109-
struct fi_cq_tagged_entry wc[MTL_OFI_MAX_PROG_EVENT_COUNT];
109+
struct fi_cq_tagged_entry ompi_mtl_ofi_wc[MTL_OFI_MAX_PROG_EVENT_COUNT];
110110
#endif
111111

112112
/**
113113
* Read the work completions from the CQ.
114114
* From the completion's op_context, we get the associated OFI request.
115115
* Call the request's callback.
116116
*/
117-
ret = fi_cq_read(ompi_mtl_ofi.ofi_ctxt[ctxt_id].cq, (void *)&wc,
117+
ret = fi_cq_read(ompi_mtl_ofi.ofi_ctxt[ctxt_id].cq, (void *)&ompi_mtl_ofi_wc,
118118
ompi_mtl_ofi.ofi_progress_event_count);
119119
if (ret > 0) {
120120
count+= ret;
121121
events_read = ret;
122122
for (i = 0; i < events_read; i++) {
123-
if (NULL != wc[i].op_context) {
124-
ofi_req = TO_OFI_REQ(wc[i].op_context);
123+
if (NULL != ompi_mtl_ofi_wc[i].op_context) {
124+
ofi_req = TO_OFI_REQ(ompi_mtl_ofi_wc[i].op_context);
125125
assert(ofi_req);
126-
ret = ofi_req->event_callback(&wc[i], ofi_req);
126+
ret = ofi_req->event_callback(&ompi_mtl_ofi_wc[i], ofi_req);
127127
if (OMPI_SUCCESS != ret) {
128128
opal_output(0, "%s:%d: Error returned by request event callback: %zd.\n"
129129
"*** The Open MPI OFI MTL is aborting the MPI job (via exit(3)).\n",

ompi/mca/mtl/ofi/mtl_ofi_component.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved
44
*
5-
* Copyright (c) 2014-2017 Cisco Systems, Inc. All rights reserved
5+
* Copyright (c) 2014-2021 Cisco Systems, Inc. All rights reserved
66
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
77
* reserved.
88
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
@@ -40,8 +40,8 @@ static int av_type;
4040
static int ofi_tag_mode;
4141

4242
#if OPAL_HAVE_THREAD_LOCAL
43-
opal_thread_local int per_thread_ctx;
44-
opal_thread_local struct fi_cq_tagged_entry wc[MTL_OFI_MAX_PROG_EVENT_COUNT];
43+
opal_thread_local int ompi_mtl_ofi_per_thread_ctx;
44+
opal_thread_local struct fi_cq_tagged_entry ompi_mtl_ofi_wc[MTL_OFI_MAX_PROG_EVENT_COUNT];
4545
#endif
4646

4747
/*
@@ -374,8 +374,8 @@ select_ofi_provider(struct fi_info *providers,
374374
}
375375

376376
static void
377-
ompi_mtl_ofi_define_tag_mode(int ofi_tag_mode, int *bits_for_cid) {
378-
switch (ofi_tag_mode) {
377+
ompi_mtl_ofi_define_tag_mode(int ofi_tag_mode_arg, int *bits_for_cid) {
378+
switch (ofi_tag_mode_arg) {
379379
case MTL_OFI_TAG_1:
380380
*bits_for_cid = (int) MTL_OFI_CID_BIT_COUNT_1;
381381
ompi_mtl_ofi.base.mtl_max_tag = (int)((1ULL << (MTL_OFI_TAG_BIT_COUNT_1 - 1)) - 1);

0 commit comments

Comments
 (0)