From 8f03b88db6344f1cb976bd26f458b05c01e78281 Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Thu, 19 Jan 2017 10:28:28 +0900 Subject: [PATCH] mpiext/pcollreq: Add `MPIX_Bcast_init` etc. Until the MPI Forum decides to add the persistent collective communication request feature to the MPI Standard, these functions are supported through MPI extensions with the `MPIX_` prefix. Only C bindings are supported currently. Signed-off-by: KAWASHIMA Takahiro --- ompi/mpiext/pcollreq/Makefile.am | 10 ++ ompi/mpiext/pcollreq/c/Makefile.am | 30 ++++ ompi/mpiext/pcollreq/c/mpiext_pcollreq.c | 168 +++++++++++++++++++++ ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h | 33 ++++ ompi/mpiext/pcollreq/configure.m4 | 21 +++ 5 files changed, 262 insertions(+) create mode 100644 ompi/mpiext/pcollreq/Makefile.am create mode 100644 ompi/mpiext/pcollreq/c/Makefile.am create mode 100644 ompi/mpiext/pcollreq/c/mpiext_pcollreq.c create mode 100644 ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h create mode 100644 ompi/mpiext/pcollreq/configure.m4 diff --git a/ompi/mpiext/pcollreq/Makefile.am b/ompi/mpiext/pcollreq/Makefile.am new file mode 100644 index 00000000000..2b48a7514f2 --- /dev/null +++ b/ompi/mpiext/pcollreq/Makefile.am @@ -0,0 +1,10 @@ +# +# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +SUBDIRS = c diff --git a/ompi/mpiext/pcollreq/c/Makefile.am b/ompi/mpiext/pcollreq/c/Makefile.am new file mode 100644 index 00000000000..b778ae556fa --- /dev/null +++ b/ompi/mpiext/pcollreq/c/Makefile.am @@ -0,0 +1,30 @@ +# +# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# We must set these #defines so that the inner OMPI MPI prototype +# header files do the Right Thing. +AM_CPPFLAGS = -DOMPI_PROFILE_LAYER=0 -DOMPI_COMPILING_FORTRAN_WRAPPERS=1 + +# Convenience libtool library that will be slurped up into libmpi.la. +noinst_LTLIBRARIES = libmpiext_pcollreq_c.la + +# This is where the top-level header file (that is included in +# ) must be installed. +ompidir = $(ompiincludedir)/ompi/mpiext/pcollreq/c + +# This is the header file that is installed. +ompi_HEADERS = mpiext_pcollreq_c.h + +# Sources for the convenience libtool library. Other than the one +# header file, all source files in the extension have no file naming +# conventions. +libmpiext_pcollreq_c_la_SOURCES = \ + $(ompi_HEADERS) \ + mpiext_pcollreq.c +libmpiext_pcollreq_c_la_LDFLAGS = -module -avoid-version diff --git a/ompi/mpiext/pcollreq/c/mpiext_pcollreq.c b/ompi/mpiext/pcollreq/c/mpiext_pcollreq.c new file mode 100644 index 00000000000..60504a5637d --- /dev/null +++ b/ompi/mpiext/pcollreq/c/mpiext_pcollreq.c @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + */ + +#include "ompi_config.h" +#include "ompi/mca/coll/coll.h" +#include "ompi/mca/coll/base/coll_base_functions.h" +#include "ompi/communicator/communicator.h" + +int MPIX_Allgather_init(ALLGATHER_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_allgather_init( + ALLGATHER_BASE_ARG_NAMES, request, + comm->c_coll.coll_allgather_init_module); +} + +int MPIX_Allgatherv_init(ALLGATHERV_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_allgatherv_init( + ALLGATHERV_BASE_ARG_NAMES, request, + comm->c_coll.coll_allgatherv_init_module); +} + +int MPIX_Allreduce_init(ALLREDUCE_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_allreduce_init( + ALLREDUCE_BASE_ARG_NAMES, request, + comm->c_coll.coll_allreduce_init_module); +} + +int MPIX_Alltoall_init(ALLTOALL_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_alltoall_init( + ALLTOALL_BASE_ARG_NAMES, request, + comm->c_coll.coll_alltoall_init_module); +} + +int MPIX_Alltoallv_init(ALLTOALLV_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_alltoallv_init( + ALLTOALLV_BASE_ARG_NAMES, request, + comm->c_coll.coll_alltoallv_init_module); +} + +int MPIX_Alltoallw_init(ALLTOALLW_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_alltoallw_init( + ALLTOALLW_BASE_ARG_NAMES, request, + comm->c_coll.coll_alltoallw_init_module); +} + +int MPIX_Barrier_init(BARRIER_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_barrier_init( + BARRIER_BASE_ARG_NAMES, request, + comm->c_coll.coll_barrier_init_module); +} + +int MPIX_Bcast_init(BCAST_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_bcast_init( + BCAST_BASE_ARG_NAMES, request, + comm->c_coll.coll_bcast_init_module); +} + +int MPIX_Exscan_init(EXSCAN_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_exscan_init( + EXSCAN_BASE_ARG_NAMES, request, + comm->c_coll.coll_exscan_init_module); +} + +int MPIX_Gather_init(GATHER_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_gather_init( + GATHER_BASE_ARG_NAMES, request, + comm->c_coll.coll_gather_init_module); +} + +int MPIX_Gatherv_init(GATHERV_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_gatherv_init( + GATHERV_BASE_ARG_NAMES, request, + comm->c_coll.coll_gatherv_init_module); +} + +int MPIX_Reduce_init(REDUCE_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_reduce_init( + REDUCE_BASE_ARG_NAMES, request, + comm->c_coll.coll_reduce_init_module); +} + +int MPIX_Reduce_scatter_init(REDUCESCATTER_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_reduce_scatter_init( + REDUCESCATTER_BASE_ARG_NAMES, request, + comm->c_coll.coll_reduce_scatter_init_module); +} + +int MPIX_Reduce_scatter_block_init(REDUCESCATTERBLOCK_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_reduce_scatter_block_init( + REDUCESCATTERBLOCK_BASE_ARG_NAMES, request, + comm->c_coll.coll_reduce_scatter_block_init_module); +} + +int MPIX_Scan_init(SCAN_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_scan_init( + SCAN_BASE_ARG_NAMES, request, + comm->c_coll.coll_scan_init_module); +} + +int MPIX_Scatter_init(SCATTER_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_scatter_init( + SCATTER_BASE_ARG_NAMES, request, + comm->c_coll.coll_scatter_init_module); +} + +int MPIX_Scatterv_init(SCATTERV_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_scatterv_init( + SCATTERV_BASE_ARG_NAMES, request, + comm->c_coll.coll_scatterv_init_module); +} + +int MPIX_Neighbor_allgather_init(NEIGHBOR_ALLGATHER_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_neighbor_allgather_init( + NEIGHBOR_ALLGATHER_BASE_ARG_NAMES, request, + comm->c_coll.coll_neighbor_allgather_init_module); +} + +int MPIX_Neighbor_allgatherv_init(NEIGHBOR_ALLGATHERV_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_neighbor_allgatherv_init( + NEIGHBOR_ALLGATHERV_BASE_ARG_NAMES, request, + comm->c_coll.coll_neighbor_allgatherv_init_module); +} + +int MPIX_Neighbor_alltoall_init(NEIGHBOR_ALLTOALL_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_neighbor_alltoall_init( + NEIGHBOR_ALLTOALL_BASE_ARG_NAMES, request, + comm->c_coll.coll_neighbor_alltoall_init_module); +} + +int MPIX_Neighbor_alltoallv_init(NEIGHBOR_ALLTOALLV_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_neighbor_alltoallv_init( + NEIGHBOR_ALLTOALLV_BASE_ARG_NAMES, request, + comm->c_coll.coll_neighbor_alltoallv_init_module); +} + +int MPIX_Neighbor_alltoallw_init(NEIGHBOR_ALLTOALLW_BASE_ARGS, ompi_request_t **request) +{ + return comm->c_coll.coll_neighbor_alltoallw_init( + NEIGHBOR_ALLTOALLW_BASE_ARG_NAMES, request, + comm->c_coll.coll_neighbor_alltoallw_init_module); +} diff --git a/ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h b/ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h new file mode 100644 index 00000000000..45d3369106b --- /dev/null +++ b/ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + */ + +OMPI_DECLSPEC int MPIX_Allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Allgatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Allreduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Alltoall_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Alltoallv_init(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Alltoallw_init(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Barrier_init(MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Exscan_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Gather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Gatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Reduce_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Reduce_scatter_init(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Reduce_scatter_block_init(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Scan_init(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Scatter_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Scatterv_init(const void *sendbuf, const int sendcounts[], const int displs[], MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); + +OMPI_DECLSPEC int MPIX_Neighbor_allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Neighbor_allgatherv_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Neighbor_alltoall_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Neighbor_alltoallv_init(const void *sendbuf, const int sendcounts[], const int sdispls[], MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Neighbor_alltoallw_init(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Request *request); diff --git a/ompi/mpiext/pcollreq/configure.m4 b/ompi/mpiext/pcollreq/configure.m4 new file mode 100644 index 00000000000..6d07b9010a2 --- /dev/null +++ b/ompi/mpiext/pcollreq/configure.m4 @@ -0,0 +1,21 @@ +# -*- shell-script -*- +# +# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# OMPI_MPIEXT_pcollreq_CONFIG([action-if-found], [action-if-not-found]) +# ----------------------------------------------------------- +AC_DEFUN([OMPI_MPIEXT_pcollreq_CONFIG],[ + AC_CONFIG_FILES([ompi/mpiext/pcollreq/Makefile]) + AC_CONFIG_FILES([ompi/mpiext/pcollreq/c/Makefile]) + + AS_IF([test "$ENABLE_pcollreq" = "1" || \ + test "$ENABLE_EXT_ALL" = "1"], + [$1], + [$2]) +])