Skip to content

Commit

Permalink
Merge pull request #33 from razor1991/topic/v2.0
Browse files Browse the repository at this point in the history
[Huawei]HMPI: Update version 2.0
  • Loading branch information
hhb1029 authored Oct 8, 2022
2 parents 59bbbee + a4c2ef3 commit fbb2fb7
Show file tree
Hide file tree
Showing 35 changed files with 4,397 additions and 3,251 deletions.
71 changes: 71 additions & 0 deletions config/ompi_check_ucg.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2022 Huawei Technologies Co., Ltd. All rights reserved.
dnl
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl

# OMPI_CHECK_UCG(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
# check if ucg support can be found. sets prefix_{CPPFLAGS,
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_UCG],[
OPAL_VAR_SCOPE_PUSH([ompi_check_ucg_dir ompi_check_ucg_libs ompi_check_ucg_happy CPPFLAGS_save LDFLAGS_save LIBS_save])

AC_ARG_WITH([ucg],
[AS_HELP_STRING([--with-ucg(=DIR)],
[Build UCG (Unified Collective Group)])])

AS_IF([test "$with_ucg" != "no"],
[ompi_check_ucg_libs=ucg
AS_IF([test ! -z "$with_ucg" && test "$with_ucg" != "yes"],
[ompi_check_ucg_dir=$with_ucg])

CPPFLAGS_save=$CPPFLAGS
LDFLAGS_save=$LDFLAGS
LIBS_save=$LIBS

OPAL_LOG_MSG([$1_CPPFLAGS : $$1_CPPFLAGS], 1)
OPAL_LOG_MSG([$1_LDFLAGS : $$1_LDFLAGS], 1)
OPAL_LOG_MSG([$1_LIBS : $$1_LIBS], 1)

OPAL_CHECK_PACKAGE([$1],
[ucg/api/ucg.h],
[$ompi_check_ucg_libs],
[ucg_cleanup],
[],
[$ompi_check_ucg_dir],
[],
[ompi_check_ucg_happy="yes"],
[ompi_check_ucg_happy="no"])

AS_IF([test "$ompi_check_ucg_happy" = "yes"],
[
CPPFLAGS=$coll_ucg_CPPFLAGS
LDFLAGS=$coll_ucg_LDFLAGS
LIBS=$coll_ucg_LIBS
],
[])

CPPFLAGS=$CPPFLAGS_save
LDFLAGS=$LDFLAGS_save
LIBS=$LIBS_save],
[ompi_check_ucg_happy=no])

AS_IF([test "$ompi_check_ucg_happy" = "yes" && test "$enable_progress_threads" = "yes"],
[AC_MSG_WARN([ucg driver does not currently support progress threads. Disabling UCG.])
ompi_check_ucg_happy="no"])

AS_IF([test "$ompi_check_ucg_happy" = "yes"],
[$2],
[AS_IF([test ! -z "$with_ucg" && test "$with_ucg" != "no"],
[AC_MSG_ERROR([UCG support requested but not found. Aborting])])
$3])

OPAL_VAR_SCOPE_POP
])
35 changes: 4 additions & 31 deletions config/ompi_check_ucx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
#
# Copyright (c) 2020-2021 Huawei Technologies Co., Ltd.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -44,7 +41,6 @@ AC_DEFUN([OMPI_CHECK_UCX],[
[ompi_check_ucx_dir=])],
[true])])
ompi_check_ucx_happy="no"
ompi_check_ucg_happy="no"
AS_IF([test -z "$ompi_check_ucx_dir"],
[OPAL_CHECK_PACKAGE([ompi_check_ucx],
[ucp/api/ucp.h],
Expand All @@ -55,15 +51,6 @@ AC_DEFUN([OMPI_CHECK_UCX],[
[],
[ompi_check_ucx_happy="yes"],
[ompi_check_ucx_happy="no"])
OPAL_CHECK_PACKAGE([ompi_check_ucg],
[ucg/api/ucg.h],
[ucg],
[ucg_collective_destroy],
[-lucp -luct -lucm -lucs],
[],
[],
[ompi_check_ucg_happy="yes"],
[ompi_check_ucg_happy="no"])
AS_IF([test "$ompi_check_ucx_happy" = yes],
[AC_MSG_CHECKING(for UCX version compatibility)
AC_REQUIRE_CPP
Expand Down Expand Up @@ -96,15 +83,6 @@ AC_DEFUN([OMPI_CHECK_UCX],[
[$ompi_check_ucx_libdir],
[ompi_check_ucx_happy="yes"],
[ompi_check_ucx_happy="no"])
OPAL_CHECK_PACKAGE([ompi_check_ucg],
[ucg/api/ucg.h],
[ucg],
[ucg_collective_destroy],
[-lucp -luct -lucm -lucs],
[$ompi_check_ucx_dir],
[$ompi_check_ucx_libdir],
[ompi_check_ucg_happy="yes"],
[ompi_check_ucg_happy="no"])

CPPFLAGS="$ompi_check_ucx_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_ucx_$1_save_LDFLAGS"
Expand Down Expand Up @@ -184,15 +162,10 @@ AC_DEFUN([OMPI_CHECK_UCX],[
OPAL_SUMMARY_ADD([[Transports]],[[Open UCX]],[$1],[$ompi_check_ucx_happy])])])

AS_IF([test "$ompi_check_ucx_happy" = "yes"],
[AS_IF([test "$ompi_check_ucg_happy" = "yes"],
[$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucg_CPPFLAGS"
$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucg_LDFLAGS"
$1_LIBS="[$]$1_LIBS $ompi_check_ucg_LIBS"
AC_DEFINE([HAVE_UCX], [1], [have ucx])],
[$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucx_CPPFLAGS"
$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucx_LDFLAGS"
$1_LIBS="[$]$1_LIBS $ompi_check_ucx_LIBS"
AC_DEFINE([HAVE_UCX], [1], [have ucx])])
[$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucx_CPPFLAGS"
$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucx_LDFLAGS"
$1_LIBS="[$]$1_LIBS $ompi_check_ucx_LIBS"
AC_DEFINE([HAVE_UCX], [1], [have ucx])
$2],
[AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "no"],
[AC_MSG_ERROR([UCX support requested but not found. Aborting])])
Expand Down
2 changes: 1 addition & 1 deletion contrib/platform/mellanox/optimized.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
# See "ompi_info --param all all" for a full listing of Open MPI MCA
# parameters available and their default values.
#rmaps_base_mapping_policy = dist:auto
rmaps_base_ranking_policy = core
#rmaps_base_ranking_policy = core
coll = ^ml
hwloc_base_binding_policy = core
btl = self
Expand Down
3 changes: 0 additions & 3 deletions ompi/datatype/ompi_datatype.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
* reserved.
* Copyright (c) 2015-2020 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2021 Huawei Technologies Co., Ltd.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -79,7 +77,6 @@ struct ompi_datatype_t {
void* args; /**< Data description for the user */
void* packed_description; /**< Packed description of the datatype */
uint64_t pml_data; /**< PML-specific information */
uint64_t coll_data; /**< coll-specific information */
/* --- cacheline 6 boundary (384 bytes) --- */
char name[MPI_MAX_OBJECT_NAME];/**< Externally visible name */
/* --- cacheline 7 boundary (448 bytes) --- */
Expand Down
3 changes: 0 additions & 3 deletions ompi/datatype/ompi_datatype_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2010-2018 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2021 Huawei Technologies Co., Ltd.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -40,7 +38,6 @@ static void __ompi_datatype_allocate( ompi_datatype_t* datatype )
datatype->name[0] = '\0';
datatype->packed_description = NULL;
datatype->pml_data = 0;
datatype->coll_data = 0;
}

static void __ompi_datatype_release(ompi_datatype_t * datatype)
Expand Down
52 changes: 52 additions & 0 deletions ompi/mca/coll/ucg/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# Copyright (c) 2022-2022 Huawei Technologies Co., Ltd.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

AM_CPPFLAGS = $(coll_ucg_CPPFLAGS) -DCOLL_UCG_HOME=\"$(coll_ucg_HOME)\" $(coll_ucg_extra_CPPFLAGS)

#dist_ompidata_DATA = help-coll-ucg.txt
coll_ucg_sources = \
coll_ucg.h \
coll_ucg_debug.h \
coll_ucg_request.h \
coll_ucg_dt.h \
coll_ucg_component.c \
coll_ucg_module.c \
coll_ucg_request.c \
coll_ucg_dt.c \
coll_ucg_allreduce.c \
coll_ucg_barrier.c \
coll_ucg_bcast.c \
coll_ucg_alltoallv.c \
coll_ucg_scatterv.c \
coll_ucg_gatherv.c \
coll_ucg_allgatherv.c

# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).

if MCA_BUILD_ompi_coll_ucg_DSO
component_noinst =
component_install = mca_coll_ucg.la
else
component_noinst = libmca_coll_ucg.la
component_install =
endif

mcacomponentdir = $(ompilibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_coll_ucg_la_SOURCES = $(coll_ucg_sources)
mca_coll_ucg_la_LIBADD = $(coll_ucg_LIBS)
mca_coll_ucg_la_LDFLAGS = -module -avoid-version $(coll_ucg_LDFLAGS)

noinst_LTLIBRARIES = $(component_noinst)
libmca_coll_ucg_la_SOURCES = $(coll_ucg_sources)
libmca_coll_ucg_la_LIBADD = $(coll_ucg_LIBS)
libmca_coll_ucg_la_LDFLAGS = -module -avoid-version $(coll_ucg_LDFLAGS)
Loading

0 comments on commit fbb2fb7

Please sign in to comment.