Skip to content

Commit

Permalink
mpiext/pcollreq: Add MPIX_Bcast_init etc.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kawashima-fj committed Jan 19, 2017
1 parent 690703e commit 8f03b88
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ompi/mpiext/pcollreq/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

SUBDIRS = c
30 changes: 30 additions & 0 deletions ompi/mpiext/pcollreq/c/Makefile.am
Original file line number Diff line number Diff line change
@@ -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
# <mpi-ext.h>) 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
168 changes: 168 additions & 0 deletions ompi/mpiext/pcollreq/c/mpiext_pcollreq.c
Original file line number Diff line number Diff line change
@@ -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);
}
33 changes: 33 additions & 0 deletions ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h
Original file line number Diff line number Diff line change
@@ -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);
21 changes: 21 additions & 0 deletions ompi/mpiext/pcollreq/configure.m4
Original file line number Diff line number Diff line change
@@ -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])
])

0 comments on commit 8f03b88

Please sign in to comment.