Commit eaf25042 authored by David Goodell's avatar David Goodell
Browse files

[svn-r7784] new NBC schedule mechanism, including progress, but no working collectives

This change consists of four main parts:

 1. Updating all of the MPIR_Ifoo_impl routines to assume that all
    nonblocking collective functions are set in the coll_fns field.

 2. Defining the MPID_Sched_ portion of the ADI in mpir_nbc.h.

 3. Implementing that interface in src/mpid/common/sched

 4. Modifications to ch3:nemesis and ch3:sock in order to call the
    progress engine hook for the scheduling mechanism, as well as
    correctly including the various scheduling headers in CH3 headers.

Reviewed by balaji@.
parent 79218ae3
......@@ -6364,6 +6364,7 @@ AC_OUTPUT(Makefile src/Makefile src/include/Makefile \
src/mpid/common/Makefile \
src/mpid/common/datatype/Makefile \
src/mpid/common/datatype/dataloop/Makefile \
src/mpid/common/sched/Makefile \
src/pm/Makefile \
src/pmi/Makefile \
src/pmi/${pmi_name}/Makefile \
......
......@@ -1305,6 +1305,7 @@ typedef enum MPID_Request_kind_t {
MPID_PREQUEST_SEND,
MPID_PREQUEST_RECV,
MPID_UREQUEST,
MPID_COLL_REQUEST,
MPID_LAST_REQUEST_KIND
#ifdef MPID_DEV_REQUEST_KIND_DECL
, MPID_DEV_REQUEST_KIND_DECL
......@@ -1769,48 +1770,48 @@ typedef struct MPID_Collops {
MPID_Comm *);
/* MPI-3 nonblocking collectives */
int (*Ibarrier)(MPID_Comm *comm_ptr, MPI_Request *request);
int (*Ibcast)(void *buffer, int count, MPI_Datatype datatype, MPID_Comm *comm_ptr,
MPI_Request *request);
int (*Ibarrier)(MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Ibcast)(void *buffer, int count, MPI_Datatype datatype, int root,
MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Igather)(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr,
MPI_Request *request);
MPID_Sched_t s);
int (*Igatherv)(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int *recvcounts, int *displs, MPI_Datatype recvtype, int root,
MPID_Comm *comm_ptr, MPI_Request *request);
MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Iscatter)(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr,
MPI_Request *request);
MPID_Sched_t s);
int (*Iscatterv)(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,
MPID_Comm *comm_ptr, MPI_Request *request);
MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Iallgather)(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr,
MPI_Request *request);
MPID_Sched_t s);
int (*Iallgatherv)(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int *recvcounts, int *displs, MPI_Datatype recvtype, MPID_Comm *comm_ptr,
MPI_Request *request);
MPID_Sched_t s);
int (*Ialltoall)(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr,
MPI_Request *request);
MPID_Sched_t s);
int (*Ialltoallv)(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, MPI_Request *request);
MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Ialltoallw)(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes,
void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype *recvtypes,
MPID_Comm *comm_ptr, MPI_Request *request);
MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Ireduce)(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
int root, MPID_Comm *comm_ptr, MPI_Request *request);
int root, MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Iallreduce)(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
MPID_Comm *comm_ptr, MPI_Request *request);
MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Ireduce_scatter)(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype,
MPI_Op op, MPID_Comm *comm_ptr, MPI_Request *request);
MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Ireduce_scatter_block)(void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype,
MPI_Op op, MPID_Comm *comm_ptr, MPI_Request *request);
MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Iscan)(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
MPID_Comm *comm_ptr, MPI_Request *request);
MPID_Comm *comm_ptr, MPID_Sched_t s);
int (*Iexscan)(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
MPID_Comm *comm_ptr, MPI_Request *request);
MPID_Comm *comm_ptr, MPID_Sched_t s);
} MPID_Collops;
#define MPIR_BARRIER_TAG 1
......@@ -3191,6 +3192,10 @@ int MPID_VCR_Dup(MPID_VCR orig_vcr, MPID_VCR * new_vcr);
@*/
int MPID_VCR_Get_lpid(MPID_VCR vcr, int * lpid_ptr);
/* prototypes and declarations for the MPID_Sched interface for nonblocking
* collectives */
#include "mpir_nbc.h"
/* ------------------------------------------------------------------------- */
/* Define a macro to allow us to select between statically selected functions
* and dynamically loaded ones. If USE_DYNAMIC_LIBRARIES is defined,
......
/* -*- Mode: c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef MPIR_NBC_H_INCLUDED
#define MPIR_NBC_H_INCLUDED
/* This specifies the interface that must be exposed by the ADI in order to
* support MPI-3 non-blocking collectives. MPID_Sched_ routines are all
* permitted to be inlines. They are not permitted to be macros.
*
* Most (currently all) devices will just use the default implementation that
* lives in "src/mpid/common/sched" */
/* The device must supply a typedef for MPID_Sched_t. MPID_Sched_t is a handle
* to the schedule (often a pointer under the hood), not the actual schedule.
* This makes it easy to cheaply pass the schedule between functions. Many
*
* The device must also define a constant (possibly a macro) for an invalid
* schedule: MPID_SCHED_NULL */
/* Context/tag strategy for send/recv ops:
* -------------------------------
*
* Blocking collectives were able to more or less safely separate all
* communication between different collectives by using a fixed tag per
* operation. This prevents some potentially very surprising message matching
* patterns when two different collectives are posted on the same communicator
* in rapid succession. But this strategy probably won't work for NBC because
* multiple operations of any combination of types can be outstanding at the
* same time.
*
* The MPI-3 draft standard says that all collective ops must be collectively
* posted in a consistent order w.r.t. other collective operations, including
* nonblocking collectives. This means that we can just use a counter to assign
* tag values that is incremented at each collective start. We can jump through
* some hoops to make sure that the blocking collective code is left
* undisturbed, but it's cleaner to just update them to use the new counter
* mechanism as well.
*/
int MPID_Sched_next_tag(int *next_tag);
/* the device must provide a typedef for MPID_Sched_t in mpidpre.h */
/* creates a new opaque schedule object and returns a handle to it in (*sp) */
int MPID_Sched_create(MPID_Sched_t *sp);
/* clones orig and returns a handle to the new schedule in (*cloned) */
int MPID_Sched_clone(MPID_Sched_t orig, MPID_Sched_t *cloned);
/* sets (*sp) to MPID_SCHED_NULL and gives you back a request pointer in (*req).
* The caller is giving up ownership of the opaque schedule object.
*
* comm should be the primary (user) communicator with which this collective is
* associated, even if other hidden communicators are used for a subset of the
* operations. It will be used for error handling and similar operations. */
int MPID_Sched_start(MPID_Sched_t *sp, MPID_Comm *comm, int tag, MPID_Request **req);
/* send and recv take a comm ptr to enable hierarchical collectives */
int MPID_Sched_send(void *buf, int count, MPI_Datatype datatype, int dest, MPID_Comm *comm, MPID_Sched_t s);
int MPID_Sched_recv(void *buf, int count, MPI_Datatype datatype, int src, MPID_Comm *comm, MPID_Sched_t s);
int MPID_Sched_reduce(void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Sched_t s);
/* packing/unpacking can be accomplished by passing MPI_PACKED as either intype
* or outtype */
int MPID_Sched_copy(void *inbuf, int incount, MPI_Datatype intype,
void *outbuf, int outcount, MPI_Datatype outtype, MPID_Sched_t s);
/* require that all previously added ops are complete before subsequent ops
* may begin to execute */
int MPID_Sched_barrier(MPID_Sched_t s);
/* Sched_cb_t funcitons take a comm parameter, the value of which will be the
* comm passed to Sched_start */
/* callback entries must be used judiciously, otherwise they will prevent
* caching opportunities */
typedef int (MPID_Sched_cb_t)(MPID_Comm *comm, int tag, void *state);
/* buffer management, fancy reductions, etc */
int MPID_Sched_cb(MPID_Sched_cb_t *cb_p, void *cb_state, MPID_Sched_t s);
/* TODO: develop a caching infrastructure for use by the upper level as well,
* hopefully s.t. uthash can be used somehow */
/* common callback utility functions */
int MPIR_Sched_cb_free_buf(MPID_Comm *comm, int tag, void *state);
#endif /* !defined(MPIR_NBC_H_INCLUDED) */
......@@ -11,7 +11,8 @@ mpi_sources = allreduce.c barrier.c op_create.c op_free.c \
lib${MPILIBNAME}_a_SOURCES = $(mpi_sources) \
helper_fns.c opsum.c opmax.c opmin.c opband.c opbor.c opbxor.c \
opland.c oplor.c oplxor.c opprod.c opminloc.c opmaxloc.c
opland.c oplor.c oplxor.c opprod.c opminloc.c opmaxloc.c \
nbcutil.c
INCLUDES = -I../../include -I${top_srcdir}/src/include -I${top_srcdir}/src/mpi/datatype
profilelib_${MPILIBNAME} = ${PMPILIBNAME}
......
......@@ -31,28 +31,26 @@
int MPIR_Iallgather_impl(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int tag = -1;
MPID_Request *reqp = NULL;
MPID_Sched_t s = MPID_SCHED_NULL;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Iallgather != NULL) {
mpi_errno = comm_ptr->coll_fns->Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "default version of MPIX_Iallgather not yet implemented");
MPIU_Assertp(0); /* never get here */
/* TODO implement the following functions and uncomment this code: */
#if 0
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
/* intracommunicator */
mpi_errno = MPIR_Iallgather_intra(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
/* intercommunicator */
mpi_errno = MPIR_Iallgather_inter(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
#endif
}
*request = MPI_REQUEST_NULL;
mpi_errno = MPID_Sched_next_tag(&tag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_create(&s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_Assert(comm_ptr->coll_fns != NULL);
MPIU_Assert(comm_ptr->coll_fns->Iallgather != NULL);
mpi_errno = comm_ptr->coll_fns->Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
if (reqp)
*request = reqp->handle;
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
return mpi_errno;
......
......@@ -31,28 +31,26 @@
int MPIR_Iallgatherv_impl(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int tag = -1;
MPID_Request *reqp = NULL;
MPID_Sched_t s = MPID_SCHED_NULL;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Iallgatherv != NULL) {
mpi_errno = comm_ptr->coll_fns->Iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "default version of MPIX_Iallgatherv not yet implemented");
MPIU_Assertp(0); /* never get here */
/* TODO implement the following functions and uncomment this code: */
#if 0
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
/* intracommunicator */
mpi_errno = MPIR_Iallgatherv_intra(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
/* intercommunicator */
mpi_errno = MPIR_Iallgatherv_inter(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
#endif
}
*request = MPI_REQUEST_NULL;
mpi_errno = MPID_Sched_next_tag(&tag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_create(&s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_Assert(comm_ptr->coll_fns != NULL);
MPIU_Assert(comm_ptr->coll_fns->Iallgatherv != NULL);
mpi_errno = comm_ptr->coll_fns->Iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm_ptr, s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
if (reqp)
*request = reqp->handle;
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
return mpi_errno;
......
......@@ -31,28 +31,26 @@
int MPIR_Iallreduce_impl(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int tag = -1;
MPID_Request *reqp = NULL;
MPID_Sched_t s = MPID_SCHED_NULL;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Iallreduce != NULL) {
mpi_errno = comm_ptr->coll_fns->Iallreduce(sendbuf, recvbuf, count, datatype, op, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "default version of MPIX_Iallreduce not yet implemented");
MPIU_Assertp(0); /* never get here */
/* TODO implement the following functions and uncomment this code: */
#if 0
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
/* intracommunicator */
mpi_errno = MPIR_Iallreduce_intra(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
/* intercommunicator */
mpi_errno = MPIR_Iallreduce_inter(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
#endif
}
*request = MPI_REQUEST_NULL;
mpi_errno = MPID_Sched_next_tag(&tag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_create(&s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_Assert(comm_ptr->coll_fns != NULL);
MPIU_Assert(comm_ptr->coll_fns->Iallreduce != NULL);
mpi_errno = comm_ptr->coll_fns->Iallreduce(sendbuf, recvbuf, count, datatype, op, comm_ptr, s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
if (reqp)
*request = reqp->handle;
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
return mpi_errno;
......
......@@ -31,28 +31,26 @@
int MPIR_Ialltoall_impl(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int tag = -1;
MPID_Request *reqp = NULL;
MPID_Sched_t s = MPID_SCHED_NULL;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Ialltoall != NULL) {
mpi_errno = comm_ptr->coll_fns->Ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "default version of MPIX_Ialltoall not yet implemented");
MPIU_Assertp(0); /* never get here */
/* TODO implement the following functions and uncomment this code: */
#if 0
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
/* intracommunicator */
mpi_errno = MPIR_Ialltoall_intra(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
/* intercommunicator */
mpi_errno = MPIR_Ialltoall_inter(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
#endif
}
*request = MPI_REQUEST_NULL;
mpi_errno = MPID_Sched_next_tag(&tag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_create(&s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_Assert(comm_ptr->coll_fns != NULL);
MPIU_Assert(comm_ptr->coll_fns->Ialltoall != NULL);
mpi_errno = comm_ptr->coll_fns->Ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm_ptr, s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
if (reqp)
*request = reqp->handle;
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
return mpi_errno;
......
......@@ -31,28 +31,26 @@
int MPIR_Ialltoallv_impl(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int tag = -1;
MPID_Request *reqp = NULL;
MPID_Sched_t s = MPID_SCHED_NULL;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Ialltoallv != NULL) {
mpi_errno = comm_ptr->coll_fns->Ialltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "default version of MPIX_Ialltoallv not yet implemented");
MPIU_Assertp(0); /* never get here */
/* TODO implement the following functions and uncomment this code: */
#if 0
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
/* intracommunicator */
mpi_errno = MPIR_Ialltoallv_intra(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
/* intercommunicator */
mpi_errno = MPIR_Ialltoallv_inter(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
#endif
}
*request = MPI_REQUEST_NULL;
mpi_errno = MPID_Sched_next_tag(&tag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_create(&s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_Assert(comm_ptr->coll_fns != NULL);
MPIU_Assert(comm_ptr->coll_fns->Ialltoallv != NULL);
mpi_errno = comm_ptr->coll_fns->Ialltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm_ptr, s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
if (reqp)
*request = reqp->handle;
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
return mpi_errno;
......
......@@ -31,28 +31,26 @@
int MPIR_Ialltoallw_impl(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype *recvtypes, MPID_Comm *comm_ptr, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int tag = -1;
MPID_Request *reqp = NULL;
MPID_Sched_t s = MPID_SCHED_NULL;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Ialltoallw != NULL) {
mpi_errno = comm_ptr->coll_fns->Ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "default version of MPIX_Ialltoallw not yet implemented");
MPIU_Assertp(0); /* never get here */
/* TODO implement the following functions and uncomment this code: */
#if 0
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
/* intracommunicator */
mpi_errno = MPIR_Ialltoallw_intra(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
/* intercommunicator */
mpi_errno = MPIR_Ialltoallw_inter(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
#endif
}
*request = MPI_REQUEST_NULL;
mpi_errno = MPID_Sched_next_tag(&tag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_create(&s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_Assert(comm_ptr->coll_fns != NULL);
MPIU_Assert(comm_ptr->coll_fns->Ialltoallw != NULL);
mpi_errno = comm_ptr->coll_fns->Ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr, s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
if (reqp)
*request = reqp->handle;
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
return mpi_errno;
......
......@@ -31,28 +31,26 @@
int MPIR_Ibarrier_impl(MPID_Comm *comm_ptr, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int tag = -1;
MPID_Request *reqp = NULL;
MPID_Sched_t s = MPID_SCHED_NULL;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Ibarrier != NULL) {
mpi_errno = comm_ptr->coll_fns->Ibarrier(comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "default version of MPIX_Ibarrier not yet implemented");
MPIU_Assertp(0); /* never get here */
/* TODO implement the following functions and uncomment this code: */
#if 0
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
/* intracommunicator */
mpi_errno = MPIR_Ibarrier_intra(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
/* intercommunicator */
mpi_errno = MPIR_Ibarrier_inter(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
#endif
}
*request = MPI_REQUEST_NULL;
mpi_errno = MPID_Sched_next_tag(&tag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_create(&s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_Assert(comm_ptr->coll_fns != NULL);
MPIU_Assert(comm_ptr->coll_fns->Ibarrier != NULL);
mpi_errno = comm_ptr->coll_fns->Ibarrier(comm_ptr, s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
if (reqp)
*request = reqp->handle;
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
return mpi_errno;
......
......@@ -31,28 +31,26 @@
int MPIR_Ibcast_impl(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int tag = -1;
MPID_Request *reqp = NULL;
MPID_Sched_t s = MPID_SCHED_NULL;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Ibcast != NULL) {
mpi_errno = comm_ptr->coll_fns->Ibcast(buffer, count, datatype, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "default version of MPIX_Ibcast not yet implemented");
MPIU_Assertp(0); /* never get here */
/* TODO implement the following functions and uncomment this code: */
#if 0
if (comm_ptr->comm_kind == MPID_INTRACOMM) {
/* intracommunicator */
mpi_errno = MPIR_Ibcast_intra(buffer, count, datatype, root, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
else {
/* intercommunicator */
mpi_errno = MPIR_Ibcast_inter(buffer, count, datatype, root, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
#endif
}
*request = MPI_REQUEST_NULL;
mpi_errno = MPID_Sched_next_tag(&tag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_create(&s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_Assert(comm_ptr->coll_fns != NULL);
MPIU_Assert(comm_ptr->coll_fns->Ibcast != NULL);
mpi_errno = comm_ptr->coll_fns->Ibcast(buffer, count, datatype, root, comm_ptr, s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_start(&s, comm_ptr, tag, &reqp);
if (reqp)
*request = reqp->handle;
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
return mpi_errno;
......
......@@ -31,28 +31,26 @@
int MPIR_Iexscan_impl(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPI_Request *request)
{
int mpi_errno = MPI_SUCCESS;
int tag = -1;
MPID_Request *reqp = NULL;
MPID_Sched_t s = MPID_SCHED_NULL;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Iexscan != NULL) {
mpi_errno = comm_ptr->coll_fns->Iexscan(sendbuf, recvbuf, count, datatype, op, comm_ptr, request);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);