From e13e264185fd05257df6483323977651003aaf9a Mon Sep 17 00:00:00 2001 From: Valentin Petrov Date: Fri, 2 Dec 2016 17:18:30 +0200 Subject: [PATCH] Detect hcoll_context_free at config Needed for better flexibility with versioning Signed-off-by: Valentin Petrov --- config/ompi_check_libhcoll.m4 | 9 +++++++++ ompi/mca/coll/hcoll/coll_hcoll_module.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/ompi_check_libhcoll.m4 b/config/ompi_check_libhcoll.m4 index 337501170f..65e6e9de1b 100644 --- a/config/ompi_check_libhcoll.m4 +++ b/config/ompi_check_libhcoll.m4 @@ -47,6 +47,15 @@ AC_DEFUN([OMPI_CHECK_HCOLL],[ [ompi_check_hcoll_happy="yes"], [ompi_check_hcoll_happy="no"]) + AS_IF([test "$ompi_check_hcoll_happy" = "yes"], + [ + CPPFLAGS=$coll_hcoll_CPPFLAGS + LDFLAGS=$coll_hcoll_LDFLAGS + LIBS=$coll_hcoll_LIBS + AC_CHECK_FUNCS(hcoll_context_free, [], []) + ], + []) + CPPFLAGS=$CPPFLAGS_save LDFLAGS=$LDFLAGS_save LIBS=$LIBS_save], diff --git a/ompi/mca/coll/hcoll/coll_hcoll_module.c b/ompi/mca/coll/hcoll/coll_hcoll_module.c index 14c46a7ca0..787e80ce74 100644 --- a/ompi/mca/coll/hcoll/coll_hcoll_module.c +++ b/ompi/mca/coll/hcoll/coll_hcoll_module.c @@ -138,7 +138,7 @@ static void mca_coll_hcoll_module_destruct(mca_coll_hcoll_module_t *hcoll_module OBJ_RELEASE(hcoll_module->previous_reduce_scatter_module); OBJ_RELEASE(hcoll_module->previous_reduce_module); */ -#if HCOLL_API < HCOLL_VERSION(3,7) +#if !defined(HAVE_HCOLL_CONTEXT_FREE) context_destroyed = 0; hcoll_destroy_context(hcoll_module->hcoll_context, (rte_grp_handle_t)hcoll_module->comm, @@ -206,7 +206,7 @@ static int hcoll_comm_attr_del_fn(MPI_Comm comm, int keyval, void *attr_val, voi mca_coll_hcoll_module_t *hcoll_module; hcoll_module = (mca_coll_hcoll_module_t*) attr_val; -#if HCOLL_API >= HCOLL_VERSION(3,7) +#ifdef HAVE_HCOLL_CONTEXT_FREE hcoll_context_free(hcoll_module->hcoll_context, (rte_grp_handle_t)comm); #else hcoll_group_destroy_notify(hcoll_module->hcoll_context);