Skip to content

Commit 47ed8e8

Browse files
committed
btl/uct: fix compile warnings/errors
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
1 parent 7d6fd34 commit 47ed8e8

File tree

8 files changed

+36
-17
lines changed

8 files changed

+36
-17
lines changed

opal/mca/btl/uct/btl_uct.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "opal/class/opal_hash_table.h"
3939
#include "opal/mca/pmix/pmix.h"
4040
#include "opal/threads/tsd.h"
41-
#include <ucp/api/ucp.h>
4241
#include <uct/api/uct.h>
4342

4443
#include "btl_uct_types.h"

opal/mca/btl/uct/btl_uct_am.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414

1515
#include "btl_uct_frag.h"
1616

17+
struct mca_btl_base_descriptor_t *mca_btl_uct_prepare_src (mca_btl_base_module_t *btl,
18+
mca_btl_base_endpoint_t *endpoint,
19+
opal_convertor_t *convertor,
20+
uint8_t order, size_t reserve,
21+
size_t *size, uint32_t flags);
22+
1723
int mca_btl_uct_sendi (mca_btl_base_module_t *btl, mca_btl_base_endpoint_t *endpoint, opal_convertor_t *convertor,
1824
void *header, size_t header_size, size_t payload_size, uint8_t order, uint32_t flags,
1925
mca_btl_base_tag_t tag, mca_btl_base_descriptor_t **descriptor);

opal/mca/btl/uct/btl_uct_component.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static int mca_btl_uct_modex_send (void)
190190
uint8_t *modex_data;
191191
int rc;
192192

193-
for (unsigned i = 0 ; i < mca_btl_uct_component.module_count ; ++i) {
193+
for (int i = 0 ; i < mca_btl_uct_component.module_count ; ++i) {
194194
modex_size += mca_btl_uct_module_modex_size (mca_btl_uct_component.modules[i]);
195195
}
196196

@@ -199,7 +199,7 @@ static int mca_btl_uct_modex_send (void)
199199

200200
modex->module_count = mca_btl_uct_component.module_count;
201201

202-
for (unsigned i = 0 ; i < mca_btl_uct_component.module_count ; ++i) {
202+
for (int i = 0 ; i < mca_btl_uct_component.module_count ; ++i) {
203203
mca_btl_uct_module_t *module = mca_btl_uct_component.modules[i];
204204
size_t name_len = strlen (module->md_name);
205205

@@ -434,7 +434,7 @@ static mca_btl_base_module_t **mca_btl_uct_component_init (int *num_btl_modules,
434434
return base_modules;
435435
}
436436

437-
int mca_btl_uct_tl_progress (mca_btl_uct_tl_t *tl, int starting_index)
437+
static int mca_btl_uct_tl_progress (mca_btl_uct_tl_t *tl, int starting_index)
438438
{
439439
unsigned int ret = 0;
440440

@@ -488,7 +488,7 @@ static int mca_btl_uct_component_progress (void)
488488
int starting_index = mca_btl_uct_get_context_index ();
489489
unsigned ret = 0;
490490

491-
for (unsigned i = 0 ; i < mca_btl_uct_component.module_count ; ++i) {
491+
for (int i = 0 ; i < mca_btl_uct_component.module_count ; ++i) {
492492
mca_btl_uct_module_t *module = mca_btl_uct_component.modules[i];
493493

494494
/* unlike ucp, uct actually tells us something useful! its almost like it was "inspired"

opal/mca/btl/uct/btl_uct_endpoint.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ int mca_btl_uct_endpoint_connect (mca_btl_uct_module_t *uct_btl, mca_btl_uct_end
312312
return OPAL_ERR_UNREACH;
313313
}
314314

315-
BTL_VERBOSE(("checking endpoint %p with context id %d. cached uct ep: %p, ready: %d", endpoint, context_id,
316-
tl_endpoint->uct_ep, !!(MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY & tl_endpoint->flags)));
315+
BTL_VERBOSE(("checking endpoint %p with context id %d. cached uct ep: %p, ready: %d", (void *) endpoint, context_id,
316+
(void *) tl_endpoint->uct_ep, !!(MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY & tl_endpoint->flags)));
317317

318318
opal_mutex_lock (&endpoint->ep_lock);
319319
if (MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY & tl_endpoint->flags) {

opal/mca/btl/uct/btl_uct_endpoint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ BEGIN_C_DECLS
3131
mca_btl_base_endpoint_t *mca_btl_uct_endpoint_create (opal_proc_t *proc);
3232
int mca_btl_uct_endpoint_connect (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint, int ep_index, void *ep_addr, int tl_index);
3333

34-
static int mca_btl_uct_endpoint_test_am (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint,
35-
mca_btl_uct_device_context_t *context, uct_ep_h *ep_handle)
34+
static inline int mca_btl_uct_endpoint_test_am (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint,
35+
mca_btl_uct_device_context_t *context, uct_ep_h *ep_handle)
3636
{
3737
int tl_index = module->am_tl->tl_index;
3838
int ep_index = context->context_id;

opal/mca/btl/uct/btl_uct_module.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct mca_btl_base_endpoint_t *mca_btl_uct_get_ep (struct mca_btl_base_module_t
6262
break;
6363
}
6464

65-
BTL_VERBOSE(("endpoint initialized. new endpoint: %p", ep));
65+
BTL_VERBOSE(("endpoint initialized. new endpoint: %p", (void *) ep));
6666

6767
/* add this endpoint to the connection lookup table */
6868
(void) opal_hash_table_set_value_uint64 (&uct_module->id_to_endpoint, (intptr_t) proc, ep);
@@ -344,6 +344,7 @@ mca_btl_uct_module_t mca_btl_uct_module_template = {
344344
.btl_flush = mca_btl_uct_flush,
345345

346346
.btl_sendi = mca_btl_uct_sendi,
347+
.btl_prepare_src = mca_btl_uct_prepare_src,
347348
.btl_send = mca_btl_uct_send,
348349
.btl_alloc = mca_btl_uct_alloc,
349350
.btl_free = mca_btl_uct_free,
@@ -370,12 +371,12 @@ mca_btl_uct_module_t mca_btl_uct_module_template = {
370371

371372
OBJ_CLASS_INSTANCE(mca_btl_uct_reg_t, opal_free_list_item_t, NULL, NULL);
372373

373-
void mca_btl_uct_md_construct (mca_btl_uct_md_t *md)
374+
static void mca_btl_uct_md_construct (mca_btl_uct_md_t *md)
374375
{
375376
md->uct_md = NULL;
376377
}
377378

378-
void mca_btl_uct_md_destruct (mca_btl_uct_md_t *md)
379+
static void mca_btl_uct_md_destruct (mca_btl_uct_md_t *md)
379380
{
380381
if (md->uct_md) {
381382
uct_md_close (md->uct_md);

opal/mca/btl/uct/btl_uct_tl.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ static uint64_t mca_btl_uct_cap_to_btl_atomic_flag[][2] = {
111111
static void mca_btl_uct_module_set_atomic_flags (mca_btl_uct_module_t *module, mca_btl_uct_tl_t *tl)
112112
{
113113
uint64_t cap_flags = tl->uct_iface_attr.cap.flags;
114-
uint32_t flags = 0;
115114

116115
module->super.btl_atomic_flags = 0;
117116

@@ -173,7 +172,7 @@ static ucs_status_t mca_btl_uct_conn_req_cb (void *arg, void *data, size_t lengt
173172
int32_t ep_flags;
174173
int rc;
175174

176-
BTL_VERBOSE(("got connection request for endpoint %p. length = %lu", endpoint, length));
175+
BTL_VERBOSE(("got connection request for endpoint %p. length = %lu", (void *) endpoint, length));
177176

178177
if (NULL == endpoint) {
179178
BTL_ERROR(("could not create endpoint for connection request"));
@@ -200,7 +199,6 @@ static ucs_status_t mca_btl_uct_conn_req_cb (void *arg, void *data, size_t lengt
200199
* an endpoint can be used. */
201200
if ((ep_flags & (MCA_BTL_UCT_ENDPOINT_FLAG_CONN_REM_READY | MCA_BTL_UCT_ENDPOINT_FLAG_CONN_REC)) ==
202201
(MCA_BTL_UCT_ENDPOINT_FLAG_CONN_REM_READY | MCA_BTL_UCT_ENDPOINT_FLAG_CONN_REC)) {
203-
mca_btl_uct_device_context_t *tl_context = mca_btl_uct_module_get_tl_context_specific (module, module->comm_tls[req->tl_index], req->context_id);
204202
mca_btl_uct_base_frag_t *frag;
205203

206204
/* to avoid a race with send adding pending frags grab the lock here */
@@ -280,13 +278,17 @@ mca_btl_uct_device_context_t *mca_btl_uct_context_create (mca_btl_uct_module_t *
280278
break;
281279
}
282280

283-
BTL_VERBOSE(("enabling progress for tl %p context id %d", tl, context_id));
281+
BTL_VERBOSE(("enabling progress for tl %p context id %d", (void *) tl, context_id));
284282

283+
#if HAVE_DECL_UCT_PROGRESS_THREAD_SAFE
285284
uct_iface_progress_enable (context->uct_iface, UCT_PROGRESS_THREAD_SAFE | UCT_PROGRESS_SEND |
286285
UCT_PROGRESS_RECV);
286+
#else
287+
uct_iface_progress_enable (context->uct_iface, UCT_PROGRESS_SEND | UCT_PROGRESS_RECV);
288+
#endif
287289

288290
if (context_id > 0 && tl == module->am_tl) {
289-
BTL_VERBOSE(("installing AM handler for tl %p context id %d", tl, context_id));
291+
BTL_VERBOSE(("installing AM handler for tl %p context id %d", (void *) tl, context_id));
290292
uct_iface_set_am_handler (context->uct_iface, MCA_BTL_UCT_FRAG, mca_btl_uct_am_handler,
291293
context, UCT_CB_FLAG_SYNC);
292294
}

opal/mca/btl/uct/configure.m4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ AC_DEFUN([MCA_opal_btl_uct_CONFIG],[
3333
OMPI_CHECK_UCX([btl_uct],
3434
[btl_uct_happy="yes"],
3535
[btl_uct_happy="no"])
36+
if test "$btl_uct_happy" = "yes" ; then
37+
OPAL_VAR_SCOPE_PUSH([CPPFLAGS_save])
38+
39+
CPPFLAGS_save="$CPPFLAGS"
40+
CPPFLAGS="$CPPFLAGS $btl_uct_CPPFLAGS"
41+
42+
AC_CHECK_DECLS([UCT_PROGRESS_THREAD_SAFE], [], [], [[#include <uct/api/uct.h>]])
43+
44+
CPPFLAGS="$CPPFLAGS_save"
45+
OPAL_VAR_SCOPE_POP
46+
fi
3647

3748
AS_IF([test "$btl_uct_happy" = "yes"],
3849
[$1

0 commit comments

Comments
 (0)