From b6bd3d33f1e1fa4308c5c6b1b30e1f0a292ad2fb Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 23 Jul 2018 12:55:03 -0600 Subject: [PATCH] btl/uct: fix compile warnings/errors Signed-off-by: Nathan Hjelm (cherry picked from commit 47ed8e8830749b6b59c84592c15b7576ea164f0c) Signed-off-by: Nathan Hjelm --- opal/mca/btl/uct/btl_uct.h | 1 - opal/mca/btl/uct/btl_uct_am.h | 6 ++++++ opal/mca/btl/uct/btl_uct_component.c | 8 ++++---- opal/mca/btl/uct/btl_uct_endpoint.c | 4 ++-- opal/mca/btl/uct/btl_uct_endpoint.h | 4 ++-- opal/mca/btl/uct/btl_uct_module.c | 7 ++++--- opal/mca/btl/uct/btl_uct_tl.c | 12 +++++++----- opal/mca/btl/uct/configure.m4 | 11 +++++++++++ 8 files changed, 36 insertions(+), 17 deletions(-) diff --git a/opal/mca/btl/uct/btl_uct.h b/opal/mca/btl/uct/btl_uct.h index 0a896dd736..00e8d4383c 100644 --- a/opal/mca/btl/uct/btl_uct.h +++ b/opal/mca/btl/uct/btl_uct.h @@ -38,7 +38,6 @@ #include "opal/class/opal_hash_table.h" #include "opal/mca/pmix/pmix.h" #include "opal/threads/tsd.h" -#include #include #include "btl_uct_types.h" diff --git a/opal/mca/btl/uct/btl_uct_am.h b/opal/mca/btl/uct/btl_uct_am.h index 07d7223eab..97cf46bb66 100644 --- a/opal/mca/btl/uct/btl_uct_am.h +++ b/opal/mca/btl/uct/btl_uct_am.h @@ -14,6 +14,12 @@ #include "btl_uct_frag.h" +struct mca_btl_base_descriptor_t *mca_btl_uct_prepare_src (mca_btl_base_module_t *btl, + mca_btl_base_endpoint_t *endpoint, + opal_convertor_t *convertor, + uint8_t order, size_t reserve, + size_t *size, uint32_t flags); + int mca_btl_uct_sendi (mca_btl_base_module_t *btl, mca_btl_base_endpoint_t *endpoint, opal_convertor_t *convertor, void *header, size_t header_size, size_t payload_size, uint8_t order, uint32_t flags, mca_btl_base_tag_t tag, mca_btl_base_descriptor_t **descriptor); diff --git a/opal/mca/btl/uct/btl_uct_component.c b/opal/mca/btl/uct/btl_uct_component.c index aa88fe82d0..58da56dd5a 100644 --- a/opal/mca/btl/uct/btl_uct_component.c +++ b/opal/mca/btl/uct/btl_uct_component.c @@ -190,7 +190,7 @@ static int mca_btl_uct_modex_send (void) uint8_t *modex_data; int rc; - for (unsigned i = 0 ; i < mca_btl_uct_component.module_count ; ++i) { + for (int i = 0 ; i < mca_btl_uct_component.module_count ; ++i) { modex_size += mca_btl_uct_module_modex_size (mca_btl_uct_component.modules[i]); } @@ -199,7 +199,7 @@ static int mca_btl_uct_modex_send (void) modex->module_count = mca_btl_uct_component.module_count; - for (unsigned i = 0 ; i < mca_btl_uct_component.module_count ; ++i) { + for (int i = 0 ; i < mca_btl_uct_component.module_count ; ++i) { mca_btl_uct_module_t *module = mca_btl_uct_component.modules[i]; size_t name_len = strlen (module->md_name); @@ -434,7 +434,7 @@ static mca_btl_base_module_t **mca_btl_uct_component_init (int *num_btl_modules, return base_modules; } -int mca_btl_uct_tl_progress (mca_btl_uct_tl_t *tl, int starting_index) +static int mca_btl_uct_tl_progress (mca_btl_uct_tl_t *tl, int starting_index) { unsigned int ret = 0; @@ -488,7 +488,7 @@ static int mca_btl_uct_component_progress (void) int starting_index = mca_btl_uct_get_context_index (); unsigned ret = 0; - for (unsigned i = 0 ; i < mca_btl_uct_component.module_count ; ++i) { + for (int i = 0 ; i < mca_btl_uct_component.module_count ; ++i) { mca_btl_uct_module_t *module = mca_btl_uct_component.modules[i]; /* unlike ucp, uct actually tells us something useful! its almost like it was "inspired" diff --git a/opal/mca/btl/uct/btl_uct_endpoint.c b/opal/mca/btl/uct/btl_uct_endpoint.c index e0dd6eee50..286326d8fe 100644 --- a/opal/mca/btl/uct/btl_uct_endpoint.c +++ b/opal/mca/btl/uct/btl_uct_endpoint.c @@ -312,8 +312,8 @@ int mca_btl_uct_endpoint_connect (mca_btl_uct_module_t *uct_btl, mca_btl_uct_end return OPAL_ERR_UNREACH; } - BTL_VERBOSE(("checking endpoint %p with context id %d. cached uct ep: %p, ready: %d", endpoint, context_id, - tl_endpoint->uct_ep, !!(MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY & tl_endpoint->flags))); + BTL_VERBOSE(("checking endpoint %p with context id %d. cached uct ep: %p, ready: %d", (void *) endpoint, context_id, + (void *) tl_endpoint->uct_ep, !!(MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY & tl_endpoint->flags))); opal_mutex_lock (&endpoint->ep_lock); if (MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY & tl_endpoint->flags) { diff --git a/opal/mca/btl/uct/btl_uct_endpoint.h b/opal/mca/btl/uct/btl_uct_endpoint.h index f8d5e6f522..9a264bddbb 100644 --- a/opal/mca/btl/uct/btl_uct_endpoint.h +++ b/opal/mca/btl/uct/btl_uct_endpoint.h @@ -31,8 +31,8 @@ BEGIN_C_DECLS mca_btl_base_endpoint_t *mca_btl_uct_endpoint_create (opal_proc_t *proc); 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); -static int mca_btl_uct_endpoint_test_am (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint, - mca_btl_uct_device_context_t *context, uct_ep_h *ep_handle) +static inline int mca_btl_uct_endpoint_test_am (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint, + mca_btl_uct_device_context_t *context, uct_ep_h *ep_handle) { int tl_index = module->am_tl->tl_index; int ep_index = context->context_id; diff --git a/opal/mca/btl/uct/btl_uct_module.c b/opal/mca/btl/uct/btl_uct_module.c index 245c3eddd1..aa69ebb73c 100644 --- a/opal/mca/btl/uct/btl_uct_module.c +++ b/opal/mca/btl/uct/btl_uct_module.c @@ -62,7 +62,7 @@ struct mca_btl_base_endpoint_t *mca_btl_uct_get_ep (struct mca_btl_base_module_t break; } - BTL_VERBOSE(("endpoint initialized. new endpoint: %p", ep)); + BTL_VERBOSE(("endpoint initialized. new endpoint: %p", (void *) ep)); /* add this endpoint to the connection lookup table */ (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 = { .btl_flush = mca_btl_uct_flush, .btl_sendi = mca_btl_uct_sendi, + .btl_prepare_src = mca_btl_uct_prepare_src, .btl_send = mca_btl_uct_send, .btl_alloc = mca_btl_uct_alloc, .btl_free = mca_btl_uct_free, @@ -370,12 +371,12 @@ mca_btl_uct_module_t mca_btl_uct_module_template = { OBJ_CLASS_INSTANCE(mca_btl_uct_reg_t, opal_free_list_item_t, NULL, NULL); -void mca_btl_uct_md_construct (mca_btl_uct_md_t *md) +static void mca_btl_uct_md_construct (mca_btl_uct_md_t *md) { md->uct_md = NULL; } -void mca_btl_uct_md_destruct (mca_btl_uct_md_t *md) +static void mca_btl_uct_md_destruct (mca_btl_uct_md_t *md) { if (md->uct_md) { uct_md_close (md->uct_md); diff --git a/opal/mca/btl/uct/btl_uct_tl.c b/opal/mca/btl/uct/btl_uct_tl.c index 13e51bceac..7d12a9c452 100644 --- a/opal/mca/btl/uct/btl_uct_tl.c +++ b/opal/mca/btl/uct/btl_uct_tl.c @@ -111,7 +111,6 @@ static uint64_t mca_btl_uct_cap_to_btl_atomic_flag[][2] = { static void mca_btl_uct_module_set_atomic_flags (mca_btl_uct_module_t *module, mca_btl_uct_tl_t *tl) { uint64_t cap_flags = tl->uct_iface_attr.cap.flags; - uint32_t flags = 0; module->super.btl_atomic_flags = 0; @@ -173,7 +172,7 @@ static ucs_status_t mca_btl_uct_conn_req_cb (void *arg, void *data, size_t lengt int32_t ep_flags; int rc; - BTL_VERBOSE(("got connection request for endpoint %p. length = %lu", endpoint, length)); + BTL_VERBOSE(("got connection request for endpoint %p. length = %lu", (void *) endpoint, length)); if (NULL == endpoint) { 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 * an endpoint can be used. */ if ((ep_flags & (MCA_BTL_UCT_ENDPOINT_FLAG_CONN_REM_READY | MCA_BTL_UCT_ENDPOINT_FLAG_CONN_REC)) == (MCA_BTL_UCT_ENDPOINT_FLAG_CONN_REM_READY | MCA_BTL_UCT_ENDPOINT_FLAG_CONN_REC)) { - 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); mca_btl_uct_base_frag_t *frag; /* 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 * break; } - BTL_VERBOSE(("enabling progress for tl %p context id %d", tl, context_id)); + BTL_VERBOSE(("enabling progress for tl %p context id %d", (void *) tl, context_id)); +#if HAVE_DECL_UCT_PROGRESS_THREAD_SAFE uct_iface_progress_enable (context->uct_iface, UCT_PROGRESS_THREAD_SAFE | UCT_PROGRESS_SEND | UCT_PROGRESS_RECV); +#else + uct_iface_progress_enable (context->uct_iface, UCT_PROGRESS_SEND | UCT_PROGRESS_RECV); +#endif if (context_id > 0 && tl == module->am_tl) { - BTL_VERBOSE(("installing AM handler for tl %p context id %d", tl, context_id)); + BTL_VERBOSE(("installing AM handler for tl %p context id %d", (void *) tl, context_id)); uct_iface_set_am_handler (context->uct_iface, MCA_BTL_UCT_FRAG, mca_btl_uct_am_handler, context, UCT_CB_FLAG_SYNC); } diff --git a/opal/mca/btl/uct/configure.m4 b/opal/mca/btl/uct/configure.m4 index dbeabe2f5f..23deed6c2e 100644 --- a/opal/mca/btl/uct/configure.m4 +++ b/opal/mca/btl/uct/configure.m4 @@ -33,6 +33,17 @@ AC_DEFUN([MCA_opal_btl_uct_CONFIG],[ OMPI_CHECK_UCX([btl_uct], [btl_uct_happy="yes"], [btl_uct_happy="no"]) + if test "$btl_uct_happy" = "yes" ; then + OPAL_VAR_SCOPE_PUSH([CPPFLAGS_save]) + + CPPFLAGS_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $btl_uct_CPPFLAGS" + + AC_CHECK_DECLS([UCT_PROGRESS_THREAD_SAFE], [], [], [[#include ]]) + + CPPFLAGS="$CPPFLAGS_save" + OPAL_VAR_SCOPE_POP + fi AS_IF([test "$btl_uct_happy" = "yes"], [$1