1
1

* There are now two forms of ibv_create_cq, one with 3 params and one with 5.

Try to detect which form this version of Open IB uses, defaulting to the 5
  version if we can't figure it out (the new version has 5 params)
* Only add -lcm if it exists on the system - some versions of Open IB
  apparently don't need it.

This commit was SVN r7542.
Этот коммит содержится в:
Brian Barrett 2005-09-29 13:35:57 +00:00
родитель de1c8fb125
Коммит 997644af31
2 изменённых файлов: 52 добавлений и 5 удалений

Просмотреть файл

@ -38,6 +38,7 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[
AS_IF([test "$HAVE_POSIX_THREADS" != "1"],
[AC_MSG_WARN([POSIX threads not enabled. May not be able to link with openib])])
ompi_check_openib_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_openib_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_openib_$1_save_LIBS="$LIBS"
@ -65,23 +66,55 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[
[ompi_check_openib_libflag=" -L$ompi_check_openib_my_libdir/lib/infiniband"
LDFLAGS="$LDFLAGS -L $ompi_check_openib_my_libdir/lib/infiniband"])])
AC_CHECK_LIB([cm], [cm_timeout],
[ompi_check_openib_libdeps="-lcm"]
[ompi_check_openib_libdeps=""])
OMPI_CHECK_PACKAGE([$1],
[infiniband/verbs.h],
[ibverbs],
[ibv_open_device],
[-libcm],
[$ompi_check_openib_libdeps],
[$ompi_check_openib_dir],
[$ompi_check_openib_libdir],
[ompi_check_openib_happy="yes"],
[ompi_check_openib_happy="no"])
# ok, now see if ibv_create_cq takes 3 arguments or 6
CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS"
LDFLAGS="$LDPFLAGS $$1_LDFLAGS"
LIBS="$LIBS $$1_LIBS"
AS_IF([test "$ompi_check_openib_happy" = "yes"],
[AC_CACHE_CHECK(
[number of arguments to ibv_create_cq],
[ompi_cv_func_ibv_create_cq_args],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <infiniband/verbs.h> ]],
[[ibv_create_cq(NULL, 0, NULL, NULL, 0);]])],
[ompi_cv_func_ibv_create_cq_args=5],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <infiniband/verbs.h> ]],
[[ibv_create_cq(NULL, 0, NULL);]])],
[ompi_cv_func_ibv_create_cq_args=3],
[ompi_cv_func_ibv_create_cq_args="unknown"])])])
AS_IF([test "$ompi_cv_func_ibv_create_cq_args" = "unknown"],
[AC_MSG_ERROR([Can not determine number of args to ibv_create_cq. Aborting])],
[AC_DEFINE_UNQUOTED([OMPI_MCA_]m4_translit([$1], [a-z], [A-Z])[_IBV_CREATE_CQ_ARGS],
[$ompi_cv_func_ibv_create_cq_args],
[Number of arguments to ibv_create_cq])])])
CPPFLAGS="$ompi_check_openib_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_openib_$1_save_LDFLAGS"
LIBS="$ompi_check_openib_$1_save_LIBS"
AS_IF([test "$ompi_check_openib_happy" = "yes"],
[$2],
[AS_IF([test ! -z "$with_btl_openib" -a "$with_btl_openib" != "no"],
[AC_MSG_ERROR([OPENIB support requested but not found. Aborting])])
[AC_MSG_ERROR([Open IB support requested but not found. Aborting])])
$3])
$1_LDFLAGS="$$1_LDFLAGS $ompi_check_openib_libflag"
])

Просмотреть файл

@ -656,7 +656,14 @@ int mca_btl_openib_module_init(mca_btl_openib_module_t *openib_btl)
}
/* Create the low and high priority queue pairs */
openib_btl->ib_cq_low = ibv_create_cq(ctx, mca_btl_openib_component.ib_cq_size, NULL);
#if OMPI_MCA_BTL_OPENIB_IBV_CREATE_CQ_ARGS == 3
openib_btl->ib_cq_low =
ibv_create_cq(ctx, mca_btl_openib_component.ib_cq_size, NULL);
#else
openib_btl->ib_cq_low =
ibv_create_cq(ctx, mca_btl_openib_component.ib_cq_size,
NULL, NULL, 0);
#endif
if(NULL == openib_btl->ib_cq_low) {
BTL_ERROR(("error creating low priority cq for %s errno says %s\n",
@ -665,8 +672,15 @@ int mca_btl_openib_module_init(mca_btl_openib_module_t *openib_btl)
return OMPI_ERROR;
}
openib_btl->ib_cq_high = ibv_create_cq(ctx, mca_btl_openib_component.ib_cq_size, NULL);
#if OMPI_MCA_BTL_OPENIB_IBV_CREATE_CQ_ARGS == 3
openib_btl->ib_cq_high =
ibv_create_cq(ctx, mca_btl_openib_component.ib_cq_size, NULL);
#else
openib_btl->ib_cq_high =
ibv_create_cq(ctx, mca_btl_openib_component.ib_cq_size,
NULL, NULL, 0);
#endif
if(NULL == openib_btl->ib_cq_high) {
BTL_ERROR(("error creating high priority cq for %s errno says %s\n",
ibv_get_device_name(openib_btl->ib_dev),