diff --git a/config/ompi_check_libfca.m4 b/config/ompi_check_libfca.m4 index b560aa8840..8b7e088660 100644 --- a/config/ompi_check_libfca.m4 +++ b/config/ompi_check_libfca.m4 @@ -18,7 +18,7 @@ AC_DEFUN([OMPI_CHECK_FCA],[ AC_ARG_WITH([fca], [AC_HELP_STRING([--with-fca(=DIR)], [Build fca (Voltaire Fabric Collective Accelerator) support, searching for libraries in DIR])]) - OMPI_CHECK_WITHDIR([fca], [$with_fca], [include/fca_core/fca_api.h]) + OMPI_CHECK_WITHDIR([fca], [$with_fca], [lib/libfca.so]) AS_IF([test "$with_fca" != "no"], [AS_IF([test ! -z "$with_fca" -a "$with_fca" != "yes"], @@ -30,13 +30,14 @@ AC_DEFUN([OMPI_CHECK_FCA],[ CPPFLAGS_save="$CPPFLAGS" LDFLAGS_save="$LDFLAGS" LIBS_save="$LIBS" + CPPFLAGS="$CPPFLAGS -I$ompi_check_fca_dir/include/fca -I$ompi_check_fca_dir/include/fca_core" OMPI_LOG_MSG([$1_CPPFLAGS : $$1_CPPFLAGS], 1) OMPI_LOG_MSG([$1_LDFLAGS : $$1_LDFLAGS], 1) OMPI_LOG_MSG([$1_LIBS : $$1_LIBS], 1) OMPI_CHECK_PACKAGE([$1], - [fca_core/fca_api.h], + [fca_api.h], [$ompi_check_fca_libs], [fca_get_version], [], diff --git a/ompi/mca/coll/fca/Makefile.am b/ompi/mca/coll/fca/Makefile.am index d9eb1777c4..93e9011c99 100644 --- a/ompi/mca/coll/fca/Makefile.am +++ b/ompi/mca/coll/fca/Makefile.am @@ -10,7 +10,7 @@ # # -AM_CPPFLAGS = $(coll_fca_CPPFLAGS) -DCOLL_FCA_HOME=\"$(coll_fca_HOME)\" +AM_CPPFLAGS = $(coll_fca_CPPFLAGS) -DCOLL_FCA_HOME=\"$(coll_fca_HOME)\" -I$(coll_fca_HOME)/include/fca -I$(coll_fca_HOME)/include/fca_core #dist_pkgdata_DATA = help-coll-fca.txt coll_fca_sources = \ diff --git a/ompi/mca/coll/fca/coll_fca.h b/ompi/mca/coll/fca/coll_fca.h index f207f2363f..5c5c87cfc8 100644 --- a/ompi/mca/coll/fca/coll_fca.h +++ b/ompi/mca/coll/fca/coll_fca.h @@ -10,11 +10,7 @@ #ifndef MCA_COLL_FCA_H #define MCA_COLL_FCA_H -#include -#ifdef FCA_PROF -#include -#endif - +#include #include "ompi_config.h" #include "mpi.h" @@ -37,6 +33,12 @@ #define FCA_DT_IS_CONTIGUOUS_MEMORY_LAYOUT ompi_ddt_is_contiguous_memory_layout #endif +#ifdef OMPI_PROC_FLAG_LOCAL +#define FCA_IS_LOCAL_PROCESS(n) ((n) & OMPI_PROC_FLAG_LOCAL) +#else +#define FCA_IS_LOCAL_PROCESS(n) OPAL_PROC_ON_LOCAL_NODE(n) +#endif + BEGIN_C_DECLS diff --git a/ompi/mca/coll/fca/coll_fca_module.c b/ompi/mca/coll/fca/coll_fca_module.c index 826691e18c..96a33bb532 100644 --- a/ompi/mca/coll/fca/coll_fca_module.c +++ b/ompi/mca/coll/fca/coll_fca_module.c @@ -29,7 +29,7 @@ static int have_remote_peers(ompi_group_t *group, size_t size, int *local_peers) ret = 0; for (i = 0; i < size; ++i) { proc = ompi_group_peer_lookup(group, i); - if (OPAL_PROC_ON_LOCAL_NODE(proc->proc_flags)) { + if (FCA_IS_LOCAL_PROCESS(proc->proc_flags)) { ++*local_peers; } else { ret = 1; @@ -56,8 +56,13 @@ static int __get_local_ranks(mca_coll_fca_module_t *fca_module) fca_module->num_local_procs = 0; for (rank = 0; rank < ompi_comm_size(comm); ++rank) { proc = __local_rank_lookup(comm, rank); - if (OPAL_PROC_ON_LOCAL_NODE(proc->proc_flags)) + if (FCA_IS_LOCAL_PROCESS(proc->proc_flags)) ++fca_module->num_local_procs; + + FCA_MODULE_VERBOSE(fca_module, 4, "rank %d flags 0x%x host %s", rank, + proc->proc_flags, + proc->proc_hostname); + } fca_module->local_ranks = calloc(fca_module->num_local_procs, sizeof *fca_module->local_ranks); @@ -65,7 +70,7 @@ static int __get_local_ranks(mca_coll_fca_module_t *fca_module) index = 0; for (rank = 0; rank< ompi_comm_size(comm); ++rank) { proc = __local_rank_lookup(comm, rank); - if (!OPAL_PROC_ON_LOCAL_NODE(proc->proc_flags)) + if (!FCA_IS_LOCAL_PROCESS(proc->proc_flags)) continue; if (rank == fca_module->rank) diff --git a/ompi/mca/coll/fca/coll_fca_ops.c b/ompi/mca/coll/fca/coll_fca_ops.c index 60231f4f78..6ab0b154c5 100644 --- a/ompi/mca/coll/fca/coll_fca_ops.c +++ b/ompi/mca/coll/fca/coll_fca_ops.c @@ -51,7 +51,7 @@ static mca_coll_fca_dtype_info_t* mca_coll_fca_get_dtype(ompi_datatype_t *dtype) dtype_info->mpi_dtype_extent = extent; dtype_info->fca_dtype = fca_dtype; dtype_info->fca_dtype_extent = mca_coll_fca_component.fca_ops.get_dtype_size(fca_dtype); - FCA_VERBOSE(2, "Added new dtype[%d]: %s fca id: %d, mpi sizet: %d, fca size: %d", + FCA_VERBOSE(2, "Added new dtype[%d]: %s fca id: %d, mpi size: %d, fca size: %d", id, dtype->name, dtype_info->fca_dtype, dtype_info->mpi_dtype_extent, dtype_info->fca_dtype_extent); return dtype_info; @@ -127,7 +127,7 @@ static int mca_coll_fca_fill_reduce_spec(int count, ompi_datatype_t *dtype, /* Check operation */ op_info = mca_coll_fca_get_op(op); - if (!op) { + if (!op_info) { FCA_VERBOSE(10, "Unsupported op: %s", op->o_name); return OMPI_ERROR; }