Skip to content

Commit 3a7271e

Browse files
authored
Merge pull request #5344 from hoopoepg/topic/mca-common-ucx-fixed-build
MCA/COMMON/UCX: fixed build scripts
2 parents 304cf97 + 624d596 commit 3a7271e

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

config/ompi_check_ucx.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ AC_DEFUN([OMPI_CHECK_UCX],[
108108
[AC_DEFINE([HAVE_UCP_TAG_SEND_NBR],[1],
109109
[have ucp_tag_send_nbr()])], [],
110110
[#include <ucp/api/ucp.h>])
111+
AC_CHECK_DECLS([ucp_ep_flush_nb, ucp_worker_flush_nb, ucp_request_check_status],
112+
[], [],
113+
[#include <ucp/api/ucp.h>])
111114
CPPFLAGS=$old_CPPFLAGS
112115

113116
OPAL_SUMMARY_ADD([[Transports]],[[Open UCX]],[$1],[$ompi_check_ucx_happy])])])

opal/mca/common/ucx/Makefile.am

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ endif
5050

5151
lib@OPAL_LIB_PREFIX@mca_common_ucx_la_SOURCES = \
5252
$(headers) $(sources)
53+
lib@OPAL_LIB_PREFIX@mca_common_ucx_la_CFLAGS = \
54+
$(common_ucx_CFLAGS)
55+
lib@OPAL_LIB_PREFIX@mca_common_ucx_la_CPPFLAGS = \
56+
$(common_ucx_CPPFLAGS)
5357
lib@OPAL_LIB_PREFIX@mca_common_ucx_la_LDFLAGS = \
5458
-version-info $(libmca_opal_common_ucx_so_version) \
5559
$(common_ucx_LDFLAGS)
@@ -58,6 +62,10 @@ lib@OPAL_LIB_PREFIX@mca_common_ucx_la_LIBADD = \
5862
$(OMPI_TOP_BUILDDIR)/opal/lib@OPAL_LIB_PREFIX@open-pal.la
5963
lib@OPAL_LIB_PREFIX@mca_common_ucx_noinst_la_SOURCES = \
6064
$(headers) $(sources)
65+
lib@OPAL_LIB_PREFIX@mca_common_ucx_noinst_la_CFLAGS = \
66+
$(common_ucx_CFLAGS)
67+
lib@OPAL_LIB_PREFIX@mca_common_ucx_noinst_la_CPPFLAGS = \
68+
$(common_ucx_CPPFLAGS)
6169
lib@OPAL_LIB_PREFIX@mca_common_ucx_noinst_la_LDFLAGS = \
6270
$(common_ucx_LDFLAGS)
6371
lib@OPAL_LIB_PREFIX@mca_common_ucx_noinst_la_LIBADD = \

opal/mca/common/ucx/common_ucx.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ ucs_status_t opal_common_ucx_wait_request(ucs_status_ptr_t request, ucp_worker_h
3333
{
3434
ucs_status_t status;
3535
int i;
36+
#if !HAVE_DECL_UCP_REQUEST_CHECK_STATUS
37+
ucp_tag_recv_info_t info;
38+
#endif
3639

3740
/* check for request completed or failed */
3841
if (OPAL_LIKELY(UCS_OK == request)) {
@@ -44,7 +47,13 @@ ucs_status_t opal_common_ucx_wait_request(ucs_status_ptr_t request, ucp_worker_h
4447
while (1) {
4548
/* call UCX progress */
4649
for (i = 0; i < opal_common_ucx_progress_iterations; i++) {
47-
if (UCS_INPROGRESS != (status = ucp_request_check_status(request))) {
50+
if (UCS_INPROGRESS != (status =
51+
#if HAVE_DECL_UCP_REQUEST_CHECK_STATUS
52+
ucp_request_check_status(request)
53+
#else
54+
ucp_request_test(request, &info)
55+
#endif
56+
)) {
4857
ucp_request_free(request);
4958
return status;
5059
}
@@ -59,19 +68,27 @@ ucs_status_t opal_common_ucx_wait_request(ucs_status_ptr_t request, ucp_worker_h
5968
static inline
6069
ucs_status_t opal_common_ucx_ep_flush(ucp_ep_h ep, ucp_worker_h worker)
6170
{
71+
#if HAVE_DECL_UCP_EP_FLUSH_NB
6272
ucs_status_ptr_t status;
6373

6474
status = ucp_ep_flush_nb(ep, 0, opal_common_ucx_empty_complete_cb);
6575
return opal_common_ucx_wait_request(status, worker);
76+
#else
77+
return ucp_ep_flush(ep);
78+
#endif
6679
}
6780

6881
static inline
6982
ucs_status_t opal_common_ucx_worker_flush(ucp_worker_h worker)
7083
{
84+
#if HAVE_DECL_UCP_WORKER_FLUSH_NB
7185
ucs_status_ptr_t status;
7286

7387
status = ucp_worker_flush_nb(worker, 0, opal_common_ucx_empty_complete_cb);
7488
return opal_common_ucx_wait_request(status, worker);
89+
#else
90+
return ucp_worker_flush(worker);
91+
#endif
7592
}
7693

7794
static inline

opal/mca/common/ucx/configure.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AC_DEFUN([MCA_opal_common_ucx_CONFIG],[
2323
[$2])
2424

2525

26-
# substitute in the things needed to build openib
26+
# substitute in the things needed to build common_ucx
2727
AC_SUBST([common_ucx_CFLAGS])
2828
AC_SUBST([common_ucx_CPPFLAGS])
2929
AC_SUBST([common_ucx_LDFLAGS])

0 commit comments

Comments
 (0)