Skip to content

Commit cbceb37

Browse files
authored
Merge pull request #9101 from jsquyres/pr/ofi-fixes
OFI and usNIC fixes
2 parents 1cf9612 + 6429a3d commit cbceb37

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
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);

opal/mca/btl/usnic/btl_usnic_cagent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static opal_event_t ipc_event;
4747
static struct timeval ack_timeout;
4848
static opal_list_t udp_port_listeners;
4949
static opal_list_t ipc_listeners;
50-
static volatile int ipc_accepts = 0;
50+
static volatile uint32_t ipc_accepts = 0;
5151
/* JMS The pings_pending and ping_results should probably both be hash
5252
tables for more efficient lookups */
5353
static opal_list_t pings_pending;

opal/mca/btl/usnic/btl_usnic_stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static void setup_mpit_pvars_enum(void)
380380

381381
/* Free the strings (mca_base_var_enum_create() strdup()'ed them
382382
into private storage, so we don't need them any more) */
383-
for (int i = 0; i < mca_btl_usnic_component.num_modules; ++i) {
383+
for (i = 0; i < mca_btl_usnic_component.num_modules; ++i) {
384384
free((char *) devices[i].string);
385385
}
386386
free(devices);

opal/mca/common/ofi/common_ofi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* reserved.
55
* Copyright (c) 2020-2021 Triad National Security, LLC. All rights
66
* reserved.
7-
* Copyright (c) 2020 Cisco Systems, Inc. All rights reserved
7+
* Copyright (c) 2020-2021 Cisco Systems, Inc. All rights reserved
88
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
99
* $COPYRIGHT$
1010
*
@@ -31,7 +31,7 @@ OPAL_DECLSPEC opal_common_ofi_module_t opal_common_ofi = {.prov_include = NULL,
3131
.registered = 0,
3232
.verbose = 0};
3333

34-
static const char default_prov_exclude_list[] = "shm,sockets,tcp,udp,rstream";
34+
static const char default_prov_exclude_list[] = "shm,sockets,tcp,udp,rstream,usnic";
3535
static opal_mutex_t opal_common_ofi_mutex = OPAL_MUTEX_STATIC_INIT;
3636

3737
OPAL_DECLSPEC int opal_common_ofi_is_in_list(char **list, char *item)

0 commit comments

Comments
 (0)