From 360a76f44093b9e8d1e2bd6a8efab4c0c021accc Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Tue, 12 Dec 2017 10:43:09 +0900 Subject: [PATCH 01/17] coll/libnbc: revamp ibcast and use NBC_Schedule_request() Signed-off-by: Gilles Gouaillardet --- ompi/mca/coll/libnbc/nbc_ibarrier.c | 80 ++++++++++------------------- 1 file changed, 26 insertions(+), 54 deletions(-) diff --git a/ompi/mca/coll/libnbc/nbc_ibarrier.c b/ompi/mca/coll/libnbc/nbc_ibarrier.c index 8e0b0a6bd6..686fc93e79 100644 --- a/ompi/mca/coll/libnbc/nbc_ibarrier.c +++ b/ompi/mca/coll/libnbc/nbc_ibarrier.c @@ -26,17 +26,11 @@ int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t * { int rank, p, maxround, res, recvpeer, sendpeer; NBC_Schedule *schedule; - NBC_Handle *handle; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; rank = ompi_comm_rank (comm); p = ompi_comm_size (comm); - res = NBC_Init_handle(comm, &handle, libnbc_module); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - #ifdef NBC_CACHE_SCHEDULE /* there only one argument set per communicator -> hang it directly at * the tree-position, NBC_Dict_size[...] is 0 for not initialized and @@ -47,13 +41,9 @@ int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t * #endif schedule = OBJ_NEW(NBC_Schedule); if (OPAL_UNLIKELY(NULL == schedule)) { - NBC_Return_handle (handle); return OMPI_ERR_OUT_OF_RESOURCE; } - /* ensure the schedule is released with the handle on error */ - handle->schedule = schedule; - maxround = (int)ceil((log((double)p)/LOG2)-1); for (int round = 0 ; round <= maxround ; ++round) { @@ -64,52 +54,47 @@ int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t * /* send msg to sendpeer */ res = NBC_Sched_send (NULL, false, 0, MPI_BYTE, sendpeer, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } /* recv msg from recvpeer */ res = NBC_Sched_recv (NULL, false, 0, MPI_BYTE, recvpeer, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } /* end communication round */ if (round < maxround) { res = NBC_Sched_barrier (schedule); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } } } res = NBC_Sched_commit (schedule); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } #ifdef NBC_CACHE_SCHEDULE /* add it */ libnbc_module->NBC_Dict[NBC_BARRIER] = (hb_tree *) schedule; libnbc_module->NBC_Dict_size[NBC_BARRIER] = 1; - } else { - /* we found it */ - handle->schedule = schedule = (NBC_Schedule *) libnbc_module->NBC_Dict[NBC_BARRIER]; } OBJ_RETAIN(schedule); #endif - res = NBC_Start (handle, schedule); + res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } - *request = (ompi_request_t *) handle; - return OMPI_SUCCESS; } @@ -118,32 +103,22 @@ int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_reque { int rank, res, rsize; NBC_Schedule *schedule; - NBC_Handle *handle; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; rank = ompi_comm_rank (comm); rsize = ompi_comm_remote_size (comm); - res = NBC_Init_handle(comm, &handle, libnbc_module); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - schedule = OBJ_NEW(NBC_Schedule); if (OPAL_UNLIKELY(NULL == schedule)) { - NBC_Return_handle (handle); return OMPI_ERR_OUT_OF_RESOURCE; } - /* ensure the schedule is released with the handle on error */ - handle->schedule = schedule; - if (0 == rank) { for (int peer = 1 ; peer < rsize ; ++peer) { res = NBC_Sched_recv (NULL, false, 0, MPI_BYTE, peer, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } } } @@ -151,47 +126,44 @@ int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_reque /* synchronize with the remote root */ res = NBC_Sched_recv (NULL, false, 0, MPI_BYTE, 0, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } res = NBC_Sched_send (NULL, false, 0, MPI_BYTE, 0, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } if (0 == rank) { /* wait for the remote root */ res = NBC_Sched_barrier (schedule); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } /* inform remote peers that all local peers have entered the barrier */ for (int peer = 1; peer < rsize ; ++peer) { res = NBC_Sched_send (NULL, false, 0, MPI_BYTE, peer, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } } } res = NBC_Sched_commit (schedule); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } - res = NBC_Start (handle, schedule); + res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return OMPI_ERR_OUT_OF_RESOURCE; + OBJ_RELEASE(schedule); + return res; } - - *request = (ompi_request_t *) handle; - return OMPI_SUCCESS; } From fe0bb6c31081ccc9673a9887a4b921c10b1295e4 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Tue, 12 Dec 2017 10:51:27 +0900 Subject: [PATCH 02/17] coll/libnbc: misc revamp - merge NBC_Init_handle() into NBC_Schedule_request() - set schedule in NBC_Schedule_request instead of NBC_Start() - update NBC_Start() prototype Signed-off-by: Gilles Gouaillardet --- ompi/mca/coll/libnbc/nbc.c | 116 +++++++++++++--------------- ompi/mca/coll/libnbc/nbc_internal.h | 3 +- 2 files changed, 53 insertions(+), 66 deletions(-) diff --git a/ompi/mca/coll/libnbc/nbc.c b/ompi/mca/coll/libnbc/nbc.c index 28f022e5c9..8ab54b7a57 100644 --- a/ompi/mca/coll/libnbc/nbc.c +++ b/ompi/mca/coll/libnbc/nbc.c @@ -581,60 +581,6 @@ static inline int NBC_Start_round(NBC_Handle *handle) { return OMPI_SUCCESS; } -int NBC_Init_handle(struct ompi_communicator_t *comm, ompi_coll_libnbc_request_t **request, ompi_coll_libnbc_module_t *comminfo) -{ - int tmp_tag; - bool need_register = false; - ompi_coll_libnbc_request_t *handle; - - OMPI_COLL_LIBNBC_REQUEST_ALLOC(comm, handle); - if (NULL == handle) return OMPI_ERR_OUT_OF_RESOURCE; - *request = handle; - - handle->tmpbuf = NULL; - handle->req_count = 0; - handle->req_array = NULL; - handle->comm = comm; - handle->schedule = NULL; - handle->row_offset = 0; - - /******************** Do the tag and shadow comm administration ... ***************/ - - OPAL_THREAD_LOCK(&comminfo->mutex); - tmp_tag = comminfo->tag--; - if (tmp_tag == MCA_COLL_BASE_TAG_NONBLOCKING_END) { - tmp_tag = comminfo->tag = MCA_COLL_BASE_TAG_NONBLOCKING_BASE; - NBC_DEBUG(2,"resetting tags ...\n"); - } - - if (true != comminfo->comm_registered) { - comminfo->comm_registered = true; - need_register = true; - } - OPAL_THREAD_UNLOCK(&comminfo->mutex); - - handle->tag = tmp_tag; - - /* register progress */ - if (need_register) { - int32_t tmp = - OPAL_THREAD_ADD_FETCH32(&mca_coll_libnbc_component.active_comms, 1); - if (tmp == 1) { - opal_progress_register(ompi_coll_libnbc_progress); - } - } - - handle->comm=comm; - /*printf("got comminfo: %lu tag: %i\n", comminfo, comminfo->tag);*/ - - /******************** end of tag and shadow comm administration ... ***************/ - handle->comminfo = comminfo; - - NBC_DEBUG(3, "got tag %i\n", handle->tag); - - return OMPI_SUCCESS; -} - void NBC_Return_handle(ompi_coll_libnbc_request_t *request) { NBC_Free (request); OMPI_COLL_LIBNBC_REQUEST_RETURN(request); @@ -692,11 +638,9 @@ int NBC_Init_comm(MPI_Comm comm, NBC_Comminfo *comminfo) { return OMPI_SUCCESS; } -int NBC_Start(NBC_Handle *handle, NBC_Schedule *schedule) { +int NBC_Start(NBC_Handle *handle) { int res; - handle->schedule = schedule; - /* kick off first round */ res = NBC_Start_round(handle); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -711,14 +655,58 @@ int NBC_Start(NBC_Handle *handle, NBC_Schedule *schedule) { int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, ompi_coll_libnbc_module_t *module, ompi_request_t **request, void *tmpbuf) { int res; - NBC_Handle *handle; - res = NBC_Init_handle (comm, &handle, module); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - handle->tmpbuf = tmpbuf; + int tmp_tag; + bool need_register = false; + ompi_coll_libnbc_request_t *handle; - res = NBC_Start (handle, schedule); + OMPI_COLL_LIBNBC_REQUEST_ALLOC(comm, handle); + if (NULL == handle) return OMPI_ERR_OUT_OF_RESOURCE; + + handle->tmpbuf = NULL; + handle->req_count = 0; + handle->req_array = NULL; + handle->comm = comm; + handle->schedule = NULL; + handle->row_offset = 0; + + /******************** Do the tag and shadow comm administration ... ***************/ + + OPAL_THREAD_LOCK(&module->mutex); + tmp_tag = module->tag--; + if (tmp_tag == MCA_COLL_BASE_TAG_NONBLOCKING_END) { + tmp_tag = module->tag = MCA_COLL_BASE_TAG_NONBLOCKING_BASE; + NBC_DEBUG(2,"resetting tags ...\n"); + } + + if (true != module->comm_registered) { + module->comm_registered = true; + need_register = true; + } + OPAL_THREAD_UNLOCK(&module->mutex); + + handle->tag = tmp_tag; + + /* register progress */ + if (need_register) { + int32_t tmp = + OPAL_THREAD_ADD_FETCH32(&mca_coll_libnbc_component.active_comms, 1); + if (tmp == 1) { + opal_progress_register(ompi_coll_libnbc_progress); + } + } + + handle->comm=comm; + /*printf("got module: %lu tag: %i\n", module, module->tag);*/ + + /******************** end of tag and shadow comm administration ... ***************/ + handle->comminfo = module; + + NBC_DEBUG(3, "got tag %i\n", handle->tag); + + handle->tmpbuf = tmpbuf; + handle->schedule = schedule; + + res = NBC_Start (handle); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { NBC_Return_handle (handle); return res; diff --git a/ompi/mca/coll/libnbc/nbc_internal.h b/ompi/mca/coll/libnbc/nbc_internal.h index f43c5e905b..8680a1b983 100644 --- a/ompi/mca/coll/libnbc/nbc_internal.h +++ b/ompi/mca/coll/libnbc/nbc_internal.h @@ -259,8 +259,7 @@ void NBC_SchedCache_args_delete_key_dummy(void *k); #endif -int NBC_Start(NBC_Handle *handle, NBC_Schedule *schedule); -int NBC_Init_handle(struct ompi_communicator_t *comm, ompi_coll_libnbc_request_t **request, ompi_coll_libnbc_module_t *module); +int NBC_Start(NBC_Handle *handle); int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, ompi_coll_libnbc_module_t *module, ompi_request_t **request, void *tmpbuf); void NBC_Return_handle(ompi_coll_libnbc_request_t *request); static inline int NBC_Type_intrinsic(MPI_Datatype type); From c753e9baff865a5c9c53b3a50e8e41d6c1b39f09 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Tue, 12 Dec 2017 14:42:21 +0900 Subject: [PATCH 03/17] coll/libnbc: code refactoring prepare the upcoming persistent collectives by pre-factoring some code Signed-off-by: Gilles Gouaillardet fixup 808c3c62cd9475edd91ecde9d2d53b12e28b2c04 --- ompi/mca/coll/libnbc/nbc.c | 13 +- ompi/mca/coll/libnbc/nbc_iallgather.c | 52 +++++- ompi/mca/coll/libnbc/nbc_iallgatherv.c | 50 ++++- ompi/mca/coll/libnbc/nbc_iallreduce.c | 47 ++++- ompi/mca/coll/libnbc/nbc_ialltoall.c | 50 ++++- ompi/mca/coll/libnbc/nbc_ialltoallv.c | 58 +++++- ompi/mca/coll/libnbc/nbc_ialltoallw.c | 58 +++++- ompi/mca/coll/libnbc/nbc_ibarrier.c | 42 ++++- ompi/mca/coll/libnbc/nbc_ibcast.c | 48 ++++- ompi/mca/coll/libnbc/nbc_iexscan.c | 24 ++- ompi/mca/coll/libnbc/nbc_igather.c | 56 +++++- ompi/mca/coll/libnbc/nbc_igatherv.c | 56 +++++- .../mca/coll/libnbc/nbc_ineighbor_allgather.c | 175 +++++++++++++++++- .../coll/libnbc/nbc_ineighbor_allgatherv.c | 26 ++- ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c | 23 ++- .../mca/coll/libnbc/nbc_ineighbor_alltoallv.c | 26 ++- .../mca/coll/libnbc/nbc_ineighbor_alltoallw.c | 26 ++- ompi/mca/coll/libnbc/nbc_ireduce.c | 46 ++++- ompi/mca/coll/libnbc/nbc_ireduce_scatter.c | 45 ++++- .../coll/libnbc/nbc_ireduce_scatter_block.c | 46 ++++- ompi/mca/coll/libnbc/nbc_iscan.c | 23 ++- ompi/mca/coll/libnbc/nbc_iscatter.c | 52 +++++- ompi/mca/coll/libnbc/nbc_iscatterv.c | 52 +++++- 23 files changed, 962 insertions(+), 132 deletions(-) diff --git a/ompi/mca/coll/libnbc/nbc.c b/ompi/mca/coll/libnbc/nbc.c index 8ab54b7a57..662247976e 100644 --- a/ompi/mca/coll/libnbc/nbc.c +++ b/ompi/mca/coll/libnbc/nbc.c @@ -641,6 +641,10 @@ int NBC_Init_comm(MPI_Comm comm, NBC_Comminfo *comminfo) { int NBC_Start(NBC_Handle *handle) { int res; + /* bozo case */ + if ((ompi_request_t *)handle == &ompi_request_empty) { + return OMPI_SUCCESS; + } /* kick off first round */ res = NBC_Start_round(handle); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -654,7 +658,6 @@ int NBC_Start(NBC_Handle *handle) { } int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, ompi_coll_libnbc_module_t *module, ompi_request_t **request, void *tmpbuf) { - int res; int tmp_tag; bool need_register = false; ompi_coll_libnbc_request_t *handle; @@ -705,14 +708,8 @@ int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, ompi handle->tmpbuf = tmpbuf; handle->schedule = schedule; - - res = NBC_Start (handle); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return res; - } - *request = (ompi_request_t *) handle; + return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_iallgather.c b/ompi/mca/coll/libnbc/nbc_iallgather.c index dd20b7a40f..0b2b721698 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgather.c +++ b/ompi/mca/coll/libnbc/nbc_iallgather.c @@ -43,9 +43,9 @@ int NBC_Allgather_args_compare(NBC_Allgather_args *a, NBC_Allgather_args *b, voi * the algorithm uses p-1 rounds * each node sends the packet it received last round (or has in round 0) to it's right neighbor (modulo p) * each node receives from it's left (modulo p) neighbor */ -int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; MPI_Aint rcvext; @@ -163,9 +163,29 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype return OMPI_SUCCESS; } -int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) +{ + int res = nbc_iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle (*(ompi_coll_libnbc_request_t **)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, rsize; MPI_Aint rcvext; @@ -219,3 +239,23 @@ int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Da return OMPI_SUCCESS; } + +int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallgather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle (*(ompi_coll_libnbc_request_t **)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + diff --git a/ompi/mca/coll/libnbc/nbc_iallgatherv.c b/ompi/mca/coll/libnbc/nbc_iallgatherv.c index ac711c6e87..9a93227650 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_iallgatherv.c @@ -33,9 +33,9 @@ * second round: * each node sends to node (rank+2)%p sendcount elements * each node receives from node (rank-2)%p recvcounts[(rank+2)%p] elements */ -int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res, speer, rpeer; MPI_Aint rcvext; @@ -108,9 +108,28 @@ int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatyp return OMPI_SUCCESS; } -int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, rsize; MPI_Aint rcvext; @@ -167,3 +186,22 @@ int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_D return OMPI_SUCCESS; } + +int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallgatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iallreduce.c b/ompi/mca/coll/libnbc/nbc_iallreduce.c index 1a1e17039c..ccf8e9b929 100644 --- a/ompi/mca/coll/libnbc/nbc_iallreduce.c +++ b/ompi/mca/coll/libnbc/nbc_iallreduce.c @@ -52,9 +52,9 @@ int NBC_Allreduce_args_compare(NBC_Allreduce_args *a, NBC_Allreduce_args *b, voi } #endif -int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; ptrdiff_t ext, lb; @@ -190,9 +190,27 @@ int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, M return OMPI_SUCCESS; } -int ompi_coll_libnbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallreduce(sendbuf, recvbuf, count, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, res, rsize; size_t size; @@ -254,6 +272,23 @@ int ompi_coll_libnbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int co return OMPI_SUCCESS; } +int ompi_coll_libnbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallreduce_inter(sendbuf, recvbuf, count, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} /* binomial allreduce (binomial tree up and binomial bcast down) * working principle: diff --git a/ompi/mca/coll/libnbc/nbc_ialltoall.c b/ompi/mca/coll/libnbc/nbc_ialltoall.c index 77432194aa..00e600bf70 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoall.c @@ -53,9 +53,9 @@ int NBC_Alltoall_args_compare(NBC_Alltoall_args *a, NBC_Alltoall_args *b, void * #endif /* simple linear MPI_Ialltoall the (simple) algorithm just sends to all nodes */ -int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res, datasize; size_t a2asize, sndsize; @@ -274,9 +274,28 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype return OMPI_SUCCESS; } -int ompi_coll_libnbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, rsize; MPI_Aint sndext, rcvext; @@ -339,6 +358,25 @@ int ompi_coll_libnbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Da return OMPI_SUCCESS; } +int ompi_coll_libnbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoall_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + static inline int a2a_sched_pairwise(int rank, int p, MPI_Aint sndext, MPI_Aint rcvext, NBC_Schedule* schedule, const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallv.c b/ompi/mca/coll/libnbc/nbc_ialltoallv.c index 61f9d1a419..31d39265d5 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallv.c @@ -40,10 +40,10 @@ static inline int a2av_sched_inplace(int rank, int p, NBC_Schedule *schedule, * would not be sufficient ... we simply do not cache it */ /* simple linear Alltoallv */ -int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int *sdispls, - MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int *sdispls, + MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; MPI_Aint sndext, rcvext; @@ -137,11 +137,32 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons return OMPI_SUCCESS; } +int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int *sdispls, + MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoallv(sendbuf, sendcounts, sdispls, sendtype, + recvbuf, recvcounts, rdispls, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + /* simple linear Alltoallv */ -int ompi_coll_libnbc_ialltoallv_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, - MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_ialltoallv_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, + MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, rsize; MPI_Aint sndext, rcvext; @@ -204,6 +225,27 @@ int ompi_coll_libnbc_ialltoallv_inter (const void* sendbuf, const int *sendcount return OMPI_SUCCESS; } +int ompi_coll_libnbc_ialltoallv_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, + MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoallv_inter(sendbuf, sendcounts, sdispls, sendtype, + recvbuf, recvcounts, rdispls, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + __opal_attribute_unused__ static inline int a2av_sched_linear(int rank, int p, NBC_Schedule *schedule, const void *sendbuf, const int *sendcounts, const int *sdispls, diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallw.c b/ompi/mca/coll/libnbc/nbc_ialltoallw.c index 164a250eaf..9ad2441d77 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallw.c @@ -40,10 +40,10 @@ static inline int a2aw_sched_inplace(int rank, int p, NBC_Schedule *schedule, * would not be sufficient ... we simply do not cache it */ /* simple linear Alltoallw */ -int ompi_coll_libnbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int *sdispls, - struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, - struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int *sdispls, + struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, + struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; NBC_Schedule *schedule; @@ -123,11 +123,32 @@ int ompi_coll_libnbc_ialltoallw(const void* sendbuf, const int *sendcounts, cons return OMPI_SUCCESS; } +int ompi_coll_libnbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int *sdispls, + struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, + struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, + recvbuf, recvcounts, rdispls, recvtypes, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + /* simple linear Alltoallw */ -int ompi_coll_libnbc_ialltoallw_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, - struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, - struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_ialltoallw_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, + struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, + struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, rsize; NBC_Schedule *schedule; @@ -177,6 +198,27 @@ int ompi_coll_libnbc_ialltoallw_inter (const void* sendbuf, const int *sendcount return OMPI_SUCCESS; } +int ompi_coll_libnbc_ialltoallw_inter(const void* sendbuf, const int *sendcounts, const int *sdispls, + struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, + struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoallw_inter(sendbuf, sendcounts, sdispls, sendtypes, + recvbuf, recvcounts, rdispls, recvtypes, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + static inline int a2aw_sched_linear(int rank, int p, NBC_Schedule *schedule, const void *sendbuf, const int *sendcounts, const int *sdispls, struct ompi_datatype_t * const * sendtypes, diff --git a/ompi/mca/coll/libnbc/nbc_ibarrier.c b/ompi/mca/coll/libnbc/nbc_ibarrier.c index 686fc93e79..5d8d9ad096 100644 --- a/ompi/mca/coll/libnbc/nbc_ibarrier.c +++ b/ompi/mca/coll/libnbc/nbc_ibarrier.c @@ -21,8 +21,8 @@ #include "nbc_internal.h" /* Dissemination implementation of MPI_Ibarrier */ -int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, maxround, res, recvpeer, sendpeer; NBC_Schedule *schedule; @@ -98,8 +98,25 @@ int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t * return OMPI_SUCCESS; } -int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ibarrier(comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, res, rsize; NBC_Schedule *schedule; @@ -167,3 +184,20 @@ int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_reque } return OMPI_SUCCESS; } + +int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ibarrier_inter(comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ibcast.c b/ompi/mca/coll/libnbc/nbc_ibcast.c index 932341847d..ecc158ac40 100644 --- a/ompi/mca/coll/libnbc/nbc_ibcast.c +++ b/ompi/mca/coll/libnbc/nbc_ibcast.c @@ -44,9 +44,9 @@ int NBC_Bcast_args_compare(NBC_Bcast_args *a, NBC_Bcast_args *b, void *param) { } #endif -int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) +static int nbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res, segsize; size_t size; @@ -171,6 +171,24 @@ int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int return OMPI_SUCCESS; } +int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) +{ + int res = nbc_ibcast(buffer, count, datatype, root, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + /* better binomial bcast * working principle: * - each node gets a virtual rank vrank @@ -323,9 +341,9 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch return OMPI_SUCCESS; } -int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res; NBC_Schedule *schedule; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -374,3 +392,21 @@ int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype return OMPI_SUCCESS; } + +int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ibcast_inter(buffer, count, datatype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iexscan.c b/ompi/mca/coll/libnbc/nbc_iexscan.c index a9fb0fba14..3b1dc050b9 100644 --- a/ompi/mca/coll/libnbc/nbc_iexscan.c +++ b/ompi/mca/coll/libnbc/nbc_iexscan.c @@ -45,9 +45,9 @@ int NBC_Scan_args_compare(NBC_Scan_args *a, NBC_Scan_args *b, void *param) { * 3. all but rank p-1 do sends to it's right neigbor and exits * */ -int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; ptrdiff_t gap, span; NBC_Schedule *schedule; @@ -191,3 +191,21 @@ int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_ return OMPI_SUCCESS; } + +int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iexscan(sendbuf, recvbuf, count, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_igather.c b/ompi/mca/coll/libnbc/nbc_igather.c index bafb58517c..ae9061056d 100644 --- a/ompi/mca/coll/libnbc/nbc_igather.c +++ b/ompi/mca/coll/libnbc/nbc_igather.c @@ -43,10 +43,10 @@ int NBC_Gather_args_compare(NBC_Gather_args *a, NBC_Gather_args *b, void *param) } #endif -int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, - int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -169,10 +169,30 @@ int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype se return OMPI_SUCCESS; } -int ompi_coll_libnbc_igather_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, - int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_igather_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, rsize; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -228,3 +248,23 @@ int ompi_coll_libnbc_igather_inter (const void* sendbuf, int sendcount, MPI_Data return OMPI_SUCCESS; } + +int ompi_coll_libnbc_igather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_igather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_igatherv.c b/ompi/mca/coll/libnbc/nbc_igatherv.c index a15f800482..cb5625c055 100644 --- a/ompi/mca/coll/libnbc/nbc_igatherv.c +++ b/ompi/mca/coll/libnbc/nbc_igatherv.c @@ -28,10 +28,10 @@ * would not be sufficient ... we simply do not cache it */ -int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, - int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -104,10 +104,30 @@ int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype s return OMPI_SUCCESS; } -int ompi_coll_libnbc_igatherv_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, - int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_igatherv_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, rsize; MPI_Aint rcvext; NBC_Schedule *schedule; @@ -163,3 +183,23 @@ int ompi_coll_libnbc_igatherv_inter (const void* sendbuf, int sendcount, MPI_Dat return OMPI_SUCCESS; } + +int ompi_coll_libnbc_igatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_igatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c index 77fbf3978f..fce26db1ee 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c @@ -43,9 +43,9 @@ int NBC_Ineighbor_allgather_args_compare(NBC_Ineighbor_allgather_args *a, NBC_In #endif -int ompi_coll_libnbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, - int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, + ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -160,3 +160,172 @@ int ompi_coll_libnbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datat return OMPI_SUCCESS; } + +int ompi_coll_libnbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, + ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_allgather(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +/* better binomial bcast + * working principle: + * - each node gets a virtual rank vrank + * - the 'root' node get vrank 0 + * - node 0 gets the vrank of the 'root' + * - all other ranks stay identical (they do not matter) + * + * Algorithm: + * - each node with vrank > 2^r and vrank < 2^r+1 receives from node + * vrank - 2^r (vrank=1 receives from 0, vrank 0 receives never) + * - each node sends each round r to node vrank + 2^r + * - a node stops to send if 2^r > commsize + */ +#define RANK2VRANK(rank, vrank, root) \ +{ \ + vrank = rank; \ + if (rank == 0) vrank = root; \ + if (rank == root) vrank = 0; \ +} +#define VRANK2RANK(rank, vrank, root) \ +{ \ + rank = vrank; \ + if (vrank == 0) rank = root; \ + if (vrank == root) rank = 0; \ +} +static inline int bcast_sched_binomial(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count, MPI_Datatype datatype) { + int maxr, vrank, peer, res; + + maxr = (int)ceil((log((double)p)/LOG2)); + + RANK2VRANK(rank, vrank, root); + + /* receive from the right hosts */ + if (vrank != 0) { + for (int r = 0 ; r < maxr ; ++r) { + if ((vrank >= (1 << r)) && (vrank < (1 << (r + 1)))) { + VRANK2RANK(peer, vrank - (1 << r), root); + res = NBC_Sched_recv (buffer, false, count, datatype, peer, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + } + } + + res = NBC_Sched_barrier (schedule); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + } + + /* now send to the right hosts */ + for (int r = 0 ; r < maxr ; ++r) { + if (((vrank + (1 << r) < p) && (vrank < (1 << r))) || (vrank == 0)) { + VRANK2RANK(peer, vrank + (1 << r), root); + res = NBC_Sched_send (buffer, false, count, datatype, peer, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + } + } + + return OMPI_SUCCESS; +} + +/* simple linear MPI_Ibcast */ +static inline int bcast_sched_linear(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count, MPI_Datatype datatype) { + int res; + + /* send to all others */ + if(rank == root) { + for (int peer = 0 ; peer < p ; ++peer) { + if (peer != root) { + /* send msg to peer */ + res = NBC_Sched_send (buffer, false, count, datatype, peer, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + } + } + } else { + /* recv msg from root */ + res = NBC_Sched_recv (buffer, false, count, datatype, root, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + } + + return OMPI_SUCCESS; +} + +/* simple chained MPI_Ibcast */ +static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count, MPI_Datatype datatype, int fragsize, size_t size) { + int res, vrank, rpeer, speer, numfrag, fragcount, thiscount; + MPI_Aint ext; + char *buf; + + RANK2VRANK(rank, vrank, root); + VRANK2RANK(rpeer, vrank-1, root); + VRANK2RANK(speer, vrank+1, root); + res = ompi_datatype_type_extent(datatype, &ext); + if (MPI_SUCCESS != res) { + NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res); + return res; + } + + if (count == 0) { + return OMPI_SUCCESS; + } + + numfrag = count * size/fragsize; + if ((count * size) % fragsize != 0) { + numfrag++; + } + + fragcount = count/numfrag; + + for (int fragnum = 0 ; fragnum < numfrag ; ++fragnum) { + buf = (char *) buffer + fragnum * fragcount * ext; + thiscount = fragcount; + if (fragnum == numfrag-1) { + /* last fragment may not be full */ + thiscount = count - fragcount * fragnum; + } + + /* root does not receive */ + if (vrank != 0) { + res = NBC_Sched_recv (buf, false, thiscount, datatype, rpeer, schedule, true); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + } + + /* last rank does not send */ + if (vrank != p-1) { + res = NBC_Sched_send (buf, false, thiscount, datatype, speer, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + /* this barrier here seems awaward but isn't!!!! */ + if (vrank == 0) { + res = NBC_Sched_barrier (schedule); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + } + } + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c index d963fcc423..3725c5d0c6 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c @@ -43,10 +43,10 @@ int NBC_Ineighbor_allgatherv_args_compare(NBC_Ineighbor_allgatherv_args *a, NBC_ #endif -int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, - const int *rcounts, const int *displs, MPI_Datatype rtype, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + const int *rcounts, const int *displs, MPI_Datatype rtype, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -162,3 +162,21 @@ int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Data return OMPI_SUCCESS; } + +int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + const int *rcounts, const int *displs, MPI_Datatype rtype, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_allgatherv(sbuf, scount, stype, rbuf, rcounts, displs, rtype, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c index d9ae492ee2..575d4cf316 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c @@ -40,9 +40,9 @@ int NBC_Ineighbor_alltoall_args_compare(NBC_Ineighbor_alltoall_args *a, NBC_Inei } #endif -int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, - int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, + ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint sndext, rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -164,3 +164,20 @@ int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Dataty return OMPI_SUCCESS; } + +int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, + ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_alltoall(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c index 4caf50e010..a791eceab6 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c @@ -43,10 +43,10 @@ int NBC_Ineighbor_alltoallv_args_compare(NBC_Ineighbor_alltoallv_args *a, NBC_In #endif -int ompi_coll_libnbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, - void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, + void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint sndext, rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -169,3 +169,21 @@ int ompi_coll_libnbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, c return OMPI_SUCCESS; } + +int ompi_coll_libnbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, + void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_alltoallv(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c index 10033010c6..580dfaef3e 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c @@ -42,10 +42,10 @@ int NBC_Ineighbor_alltoallw_args_compare(NBC_Ineighbor_alltoallw_args *a, NBC_In } #endif -int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, - void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, + void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, indegree, outdegree, *srcs, *dsts; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; NBC_Schedule *schedule; @@ -154,3 +154,21 @@ int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, c return OMPI_SUCCESS; } + +int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, + void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_alltoallw(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ireduce.c b/ompi/mca/coll/libnbc/nbc_ireduce.c index b35801aeb2..cc02c85460 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce.c @@ -52,9 +52,9 @@ int NBC_Reduce_args_compare(NBC_Reduce_args *a, NBC_Reduce_args *b, void *param) #endif /* the non-blocking reduce */ -int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res, segsize; size_t size; MPI_Aint ext; @@ -203,9 +203,26 @@ int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_ return OMPI_SUCCESS; } -int ompi_coll_libnbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, res, rsize; NBC_Schedule *schedule; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -251,6 +268,23 @@ int ompi_coll_libnbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count return OMPI_SUCCESS; } +int ompi_coll_libnbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + /* binomial reduce * if op is not commutative, reduce on rank 0, and then send the result to root rank diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c index 49edfeb7d3..ccfd8db9ea 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c @@ -41,9 +41,9 @@ * */ -int ompi_coll_libnbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, - MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int peer, rank, maxr, p, res, count; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -203,9 +203,25 @@ int ompi_coll_libnbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const i return OMPI_SUCCESS; } -int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, - MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +int ompi_coll_libnbc_ireduce_scatter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} +static int nbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, res, count, lsize, rsize; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -327,3 +343,20 @@ int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, return OMPI_SUCCESS; } + +int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_scatter_inter(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c index 5c1cedf7c2..b6f3dd1d0a 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c @@ -39,9 +39,9 @@ * */ -int ompi_coll_libnbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, - MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int peer, rank, maxr, p, res, count; MPI_Aint ext; ptrdiff_t gap, span; @@ -205,9 +205,26 @@ int ompi_coll_libnbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, i return OMPI_SUCCESS; } -int ompi_coll_libnbc_ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, int rcount, struct ompi_datatype_t *dtype, - struct ompi_op_t *op, struct ompi_communicator_t *comm, - ompi_request_t **request, struct mca_coll_base_module_2_2_0_t *module) { +int ompi_coll_libnbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, int rcount, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, + ompi_request_t **request, struct mca_coll_base_module_2_2_0_t *module) { int rank, res, count, lsize, rsize; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -325,3 +342,20 @@ int ompi_coll_libnbc_ireduce_scatter_block_inter(const void *sendbuf, void *recv return OMPI_SUCCESS; } + +int ompi_coll_libnbc_ireduce_scatter_block_inter(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iscan.c b/ompi/mca/coll/libnbc/nbc_iscan.c index 87333251a0..9b016f6d86 100644 --- a/ompi/mca/coll/libnbc/nbc_iscan.c +++ b/ompi/mca/coll/libnbc/nbc_iscan.c @@ -45,9 +45,9 @@ int NBC_Scan_args_compare(NBC_Scan_args *a, NBC_Scan_args *b, void *param) { * 3. all but rank p-1 do sends to it's right neighbor and exits * */ -int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; ptrdiff_t gap, span; NBC_Schedule *schedule; @@ -168,3 +168,20 @@ int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Da return OMPI_SUCCESS; } + +int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscan(sendbuf, recvbuf, count, datatype, op, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iscatter.c b/ompi/mca/coll/libnbc/nbc_iscatter.c index 48b0917cdc..eb40ee49f9 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatter.c +++ b/ompi/mca/coll/libnbc/nbc_iscatter.c @@ -44,10 +44,10 @@ int NBC_Scatter_args_compare(NBC_Scatter_args *a, NBC_Scatter_args *b, void *par #endif /* simple linear MPI_Iscatter */ -int ompi_coll_libnbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; MPI_Aint sndext = 0; NBC_Schedule *schedule; @@ -166,10 +166,28 @@ int ompi_coll_libnbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype return OMPI_SUCCESS; } -int ompi_coll_libnbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +int ompi_coll_libnbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, rsize; MPI_Aint sndext; NBC_Schedule *schedule; @@ -225,3 +243,21 @@ int ompi_coll_libnbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Dat return OMPI_SUCCESS; } + +int ompi_coll_libnbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscatter_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iscatterv.c b/ompi/mca/coll/libnbc/nbc_iscatterv.c index b16ef085c1..1b5a6a2519 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatterv.c +++ b/ompi/mca/coll/libnbc/nbc_iscatterv.c @@ -27,10 +27,10 @@ * would not be sufficient ... we simply do not cache it */ /* simple linear MPI_Iscatterv */ -int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +static int nbc_iscatterv(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; MPI_Aint sndext; NBC_Schedule *schedule; @@ -101,10 +101,28 @@ int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const return OMPI_SUCCESS; } -int ompi_coll_libnbc_iscatterv_inter (const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { +int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +static int nbc_iscatterv_inter (const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { int res, rsize; MPI_Aint sndext; NBC_Schedule *schedule; @@ -159,3 +177,21 @@ int ompi_coll_libnbc_iscatterv_inter (const void* sendbuf, const int *sendcounts return OMPI_SUCCESS; } + +int ompi_coll_libnbc_iscatterv_inter(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscatterv_inter(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_LIKELY(OMPI_SUCCESS != res)) { + return res; + } + res = NBC_Start(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} From a9fdea51aa0a05da957e3a7d79aeef303c4a5afa Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Mon, 16 Jan 2017 17:24:42 +0900 Subject: [PATCH 04/17] coll: Add persistent collective communication request feature Signed-off-by: KAWASHIMA Takahiro --- ompi/mca/coll/base/coll_base_comm_select.c | 28 +++ ompi/mca/coll/base/coll_base_comm_unselect.c | 25 +++ ompi/mca/coll/base/coll_base_functions.h | 24 +++ ompi/mca/coll/coll.h | 169 ++++++++++++++++++- ompi/mpi/c/start.c | 2 + ompi/mpi/c/startall.c | 4 +- 6 files changed, 249 insertions(+), 3 deletions(-) diff --git a/ompi/mca/coll/base/coll_base_comm_select.c b/ompi/mca/coll/base/coll_base_comm_select.c index 8e35b11c44..42454258b9 100644 --- a/ompi/mca/coll/base/coll_base_comm_select.c +++ b/ompi/mca/coll/base/coll_base_comm_select.c @@ -20,6 +20,7 @@ * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -190,6 +191,24 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm) COPY(avail->ac_module, comm, iscatter); COPY(avail->ac_module, comm, iscatterv); + COPY(avail->ac_module, comm, allgather_init); + COPY(avail->ac_module, comm, allgatherv_init); + COPY(avail->ac_module, comm, allreduce_init); + COPY(avail->ac_module, comm, alltoall_init); + COPY(avail->ac_module, comm, alltoallv_init); + COPY(avail->ac_module, comm, alltoallw_init); + COPY(avail->ac_module, comm, barrier_init); + COPY(avail->ac_module, comm, bcast_init); + COPY(avail->ac_module, comm, exscan_init); + COPY(avail->ac_module, comm, gather_init); + COPY(avail->ac_module, comm, gatherv_init); + COPY(avail->ac_module, comm, reduce_init); + COPY(avail->ac_module, comm, reduce_scatter_block_init); + COPY(avail->ac_module, comm, reduce_scatter_init); + COPY(avail->ac_module, comm, scan_init); + COPY(avail->ac_module, comm, scatter_init); + COPY(avail->ac_module, comm, scatterv_init); + /* We can not reliably check if this comm has a topology * at this time. The flags are set *after* coll_select */ COPY(avail->ac_module, comm, neighbor_allgather); @@ -204,6 +223,12 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm) COPY(avail->ac_module, comm, ineighbor_alltoallv); COPY(avail->ac_module, comm, ineighbor_alltoallw); + COPY(avail->ac_module, comm, neighbor_allgather_init); + COPY(avail->ac_module, comm, neighbor_allgatherv_init); + COPY(avail->ac_module, comm, neighbor_alltoall_init); + COPY(avail->ac_module, comm, neighbor_alltoallv_init); + COPY(avail->ac_module, comm, neighbor_alltoallw_init); + COPY(avail->ac_module, comm, reduce_local); } /* release the original module reference and the list item */ @@ -250,6 +275,9 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm) CHECK_NULL(which_func, comm, iscatter) || CHECK_NULL(which_func, comm, iscatterv) || CHECK_NULL(which_func, comm, reduce_local) ) { + /* TODO -- Once the persistent collective communication request + * function is implemented then check if persistent collectives have + * been set. */ /* TODO -- Once the topology flags are set before coll_select then * check if neighborhood collectives have been set. */ diff --git a/ompi/mca/coll/base/coll_base_comm_unselect.c b/ompi/mca/coll/base/coll_base_comm_unselect.c index 665110407b..fea0a53ec7 100644 --- a/ompi/mca/coll/base/coll_base_comm_unselect.c +++ b/ompi/mca/coll/base/coll_base_comm_unselect.c @@ -15,6 +15,7 @@ * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -85,6 +86,24 @@ int mca_coll_base_comm_unselect(ompi_communicator_t * comm) CLOSE(comm, iscatter); CLOSE(comm, iscatterv); + CLOSE(comm, allgather_init); + CLOSE(comm, allgatherv_init); + CLOSE(comm, allreduce_init); + CLOSE(comm, alltoall_init); + CLOSE(comm, alltoallv_init); + CLOSE(comm, alltoallw_init); + CLOSE(comm, barrier_init); + CLOSE(comm, bcast_init); + CLOSE(comm, exscan_init); + CLOSE(comm, gather_init); + CLOSE(comm, gatherv_init); + CLOSE(comm, reduce_init); + CLOSE(comm, reduce_scatter_block_init); + CLOSE(comm, reduce_scatter_init); + CLOSE(comm, scan_init); + CLOSE(comm, scatter_init); + CLOSE(comm, scatterv_init); + CLOSE(comm, neighbor_allgather); CLOSE(comm, neighbor_allgatherv); CLOSE(comm, neighbor_alltoall); @@ -97,6 +116,12 @@ int mca_coll_base_comm_unselect(ompi_communicator_t * comm) CLOSE(comm, ineighbor_alltoallv); CLOSE(comm, ineighbor_alltoallw); + CLOSE(comm, neighbor_allgather_init); + CLOSE(comm, neighbor_allgatherv_init); + CLOSE(comm, neighbor_alltoall_init); + CLOSE(comm, neighbor_alltoallv_init); + CLOSE(comm, neighbor_alltoallw_init); + CLOSE(comm, reduce_local); free(comm->c_coll); diff --git a/ompi/mca/coll/base/coll_base_functions.h b/ompi/mca/coll/base/coll_base_functions.h index 00efecf705..de4de235ab 100644 --- a/ompi/mca/coll/base/coll_base_functions.h +++ b/ompi/mca/coll/base/coll_base_functions.h @@ -33,6 +33,7 @@ #include "ompi/mca/coll/base/base.h" #include "ompi/mca/mca.h" #include "ompi/mca/coll/coll.h" +#include "ompi/info/info.h" #include "ompi/request/request.h" /* need to include our own topo prototypes so we can malloc data on the comm correctly */ @@ -135,6 +136,29 @@ typedef enum COLLTYPE { #define INEIGHBOR_ALLTOALLV_ARGS NEIGHBOR_ALLTOALLV_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module #define INEIGHBOR_ALLTOALLW_ARGS NEIGHBOR_ALLTOALLW_BASE_ARGS, ompi_request_t **request, mca_coll_base_module_t *module +#define ALLGATHER_INIT_ARGS ALLGATHER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define ALLGATHERV_INIT_ARGS ALLGATHERV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define ALLREDUCE_INIT_ARGS ALLREDUCE_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define ALLTOALL_INIT_ARGS ALLTOALL_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define ALLTOALLV_INIT_ARGS ALLTOALLV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define ALLTOALLW_INIT_ARGS ALLTOALLW_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define BARRIER_INIT_ARGS BARRIER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define BCAST_INIT_ARGS BCAST_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define EXSCAN_INIT_ARGS EXSCAN_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define GATHER_INIT_ARGS GATHER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define GATHERV_INIT_ARGS GATHERV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define REDUCE_INIT_ARGS REDUCE_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define REDUCESCATTER_INIT_ARGS REDUCESCATTER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define REDUCESCATTERBLOCK_INIT_ARGS REDUCESCATTERBLOCK_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define SCAN_INIT_ARGS SCAN_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define SCATTER_INIT_ARGS SCATTER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define SCATTERV_INIT_ARGS SCATTERV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define NEIGHBOR_ALLGATHER_INIT_ARGS NEIGHBOR_ALLGATHER_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define NEIGHBOR_ALLGATHERV_INIT_ARGS NEIGHBOR_ALLGATHERV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define NEIGHBOR_ALLTOALL_INIT_ARGS NEIGHBOR_ALLTOALL_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define NEIGHBOR_ALLTOALLV_INIT_ARGS NEIGHBOR_ALLTOALLV_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module +#define NEIGHBOR_ALLTOALLW_INIT_ARGS NEIGHBOR_ALLTOALLW_BASE_ARGS, ompi_info_t *info, ompi_request_t **request, mca_coll_base_module_t *module + #define ALLGATHER_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm #define ALLGATHERV_BASE_ARG_NAMES sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm #define ALLREDUCE_BASE_ARG_NAMES sendbuf, recvbuf, count, datatype, op, comm diff --git a/ompi/mca/coll/coll.h b/ompi/mca/coll/coll.h index 5e640e5f98..d8b47bcd31 100644 --- a/ompi/mca/coll/coll.h +++ b/ompi/mca/coll/coll.h @@ -18,6 +18,7 @@ * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -195,7 +196,7 @@ typedef int (*mca_coll_base_module_disable_1_2_0_fn_t)(struct mca_coll_base_module_2_2_0_t* module, struct ompi_communicator_t *comm); - +/* blocking collectives */ typedef int (*mca_coll_base_module_allgather_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, @@ -334,6 +335,84 @@ typedef int (*mca_coll_base_module_iscatterv_fn_t) int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); +/* persistent collectives */ +typedef int (*mca_coll_base_module_allgather_init_fn_t) + (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, + void *rbuf, int rcount, struct ompi_datatype_t *rdtype, + struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_allgatherv_init_fn_t) + (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, + void * rbuf, const int *rcounts, const int *disps, struct ompi_datatype_t *rdtype, + struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_allreduce_init_fn_t) + (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, + ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_alltoall_init_fn_t) + (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, + void* rbuf, int rcount, struct ompi_datatype_t *rdtype, + struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_alltoallv_init_fn_t) + (const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t *sdtype, + void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t *rdtype, + struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_alltoallw_init_fn_t) + (const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, + void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, + struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_barrier_init_fn_t) + (struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_bcast_init_fn_t) + (void *buff, int count, struct ompi_datatype_t *datatype, int root, + struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_exscan_init_fn_t) + (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_gather_init_fn_t) + (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, + void *rbuf, int rcount, struct ompi_datatype_t *rdtype, + int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_gatherv_init_fn_t) + (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, + void *rbuf, const int *rcounts, const int *disps, struct ompi_datatype_t *rdtype, + int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_reduce_init_fn_t) + (const void *sbuf, void* rbuf, int count, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_reduce_scatter_init_fn_t) + (const void *sbuf, void *rbuf, const int *rcounts, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_reduce_scatter_block_init_fn_t) + (const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_scan_init_fn_t) + (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_scatter_init_fn_t) + (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, + void *rbuf, int rcount, struct ompi_datatype_t *rdtype, + int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_scatterv_init_fn_t) + (const void *sbuf, const int *scounts, const int *disps, struct ompi_datatype_t *sdtype, + void* rbuf, int rcount, struct ompi_datatype_t *rdtype, + int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); + /* * The signature of the neighborhood alltoallw differs from alltoallw */ @@ -346,6 +425,11 @@ typedef int (*mca_coll_base_module_ineighbor_alltoallw_fn_t) void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rdtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); +typedef int (*mca_coll_base_module_neighbor_alltoallw_init_fn_t) + (const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *sdtypes, + void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rdtypes, + struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); /* * reduce_local @@ -426,6 +510,7 @@ struct mca_coll_base_module_2_2_0_t { mca_coll_base_module_enable_1_1_0_fn_t coll_module_enable; /* Collective function pointers */ + /* blocking functions */ mca_coll_base_module_allgather_fn_t coll_allgather; mca_coll_base_module_allgatherv_fn_t coll_allgatherv; @@ -444,6 +529,7 @@ struct mca_coll_base_module_2_2_0_t { mca_coll_base_module_scan_fn_t coll_scan; mca_coll_base_module_scatter_fn_t coll_scatter; mca_coll_base_module_scatterv_fn_t coll_scatterv; + /* nonblocking functions */ mca_coll_base_module_iallgather_fn_t coll_iallgather; mca_coll_base_module_iallgatherv_fn_t coll_iallgatherv; @@ -463,6 +549,25 @@ struct mca_coll_base_module_2_2_0_t { mca_coll_base_module_iscatter_fn_t coll_iscatter; mca_coll_base_module_iscatterv_fn_t coll_iscatterv; + /* persistent functions */ + mca_coll_base_module_allgather_init_fn_t coll_allgather_init; + mca_coll_base_module_allgatherv_init_fn_t coll_allgatherv_init; + mca_coll_base_module_allreduce_init_fn_t coll_allreduce_init; + mca_coll_base_module_alltoall_init_fn_t coll_alltoall_init; + mca_coll_base_module_alltoallv_init_fn_t coll_alltoallv_init; + mca_coll_base_module_alltoallw_init_fn_t coll_alltoallw_init; + mca_coll_base_module_barrier_init_fn_t coll_barrier_init; + mca_coll_base_module_bcast_init_fn_t coll_bcast_init; + mca_coll_base_module_exscan_init_fn_t coll_exscan_init; + mca_coll_base_module_gather_init_fn_t coll_gather_init; + mca_coll_base_module_gatherv_init_fn_t coll_gatherv_init; + mca_coll_base_module_reduce_init_fn_t coll_reduce_init; + mca_coll_base_module_reduce_scatter_init_fn_t coll_reduce_scatter_init; + mca_coll_base_module_reduce_scatter_block_init_fn_t coll_reduce_scatter_block_init; + mca_coll_base_module_scan_init_fn_t coll_scan_init; + mca_coll_base_module_scatter_init_fn_t coll_scatter_init; + mca_coll_base_module_scatterv_init_fn_t coll_scatterv_init; + /* neighborhood functions */ mca_coll_base_module_allgather_fn_t coll_neighbor_allgather; mca_coll_base_module_allgatherv_fn_t coll_neighbor_allgatherv; @@ -470,12 +575,20 @@ struct mca_coll_base_module_2_2_0_t { mca_coll_base_module_alltoallv_fn_t coll_neighbor_alltoallv; mca_coll_base_module_neighbor_alltoallw_fn_t coll_neighbor_alltoallw; + /* nonblocking neighborhood functions */ mca_coll_base_module_iallgather_fn_t coll_ineighbor_allgather; mca_coll_base_module_iallgatherv_fn_t coll_ineighbor_allgatherv; mca_coll_base_module_ialltoall_fn_t coll_ineighbor_alltoall; mca_coll_base_module_ialltoallv_fn_t coll_ineighbor_alltoallv; mca_coll_base_module_ineighbor_alltoallw_fn_t coll_ineighbor_alltoallw; + /* persistent neighborhood functions */ + mca_coll_base_module_allgather_init_fn_t coll_neighbor_allgather_init; + mca_coll_base_module_allgatherv_init_fn_t coll_neighbor_allgatherv_init; + mca_coll_base_module_alltoall_init_fn_t coll_neighbor_alltoall_init; + mca_coll_base_module_alltoallv_init_fn_t coll_neighbor_alltoallv_init; + mca_coll_base_module_neighbor_alltoallw_init_fn_t coll_neighbor_alltoallw_init; + /** Fault tolerance event trigger function */ mca_coll_base_module_ft_event_fn_t ft_event; @@ -507,6 +620,8 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_coll_base_module_t); * component. */ struct mca_coll_base_comm_coll_t { + + /* blocking collectives */ mca_coll_base_module_allgather_fn_t coll_allgather; mca_coll_base_module_2_2_0_t *coll_allgather_module; mca_coll_base_module_allgatherv_fn_t coll_allgatherv; @@ -541,6 +656,7 @@ struct mca_coll_base_comm_coll_t { mca_coll_base_module_2_2_0_t *coll_scatter_module; mca_coll_base_module_scatterv_fn_t coll_scatterv; mca_coll_base_module_2_2_0_t *coll_scatterv_module; + /* nonblocking collectives */ mca_coll_base_module_iallgather_fn_t coll_iallgather; mca_coll_base_module_2_2_0_t *coll_iallgather_module; @@ -577,7 +693,43 @@ struct mca_coll_base_comm_coll_t { mca_coll_base_module_iscatterv_fn_t coll_iscatterv; mca_coll_base_module_2_2_0_t *coll_iscatterv_module; - /* neighborhood collectives */ + /* persistent collectives */ + mca_coll_base_module_allgather_init_fn_t coll_allgather_init; + mca_coll_base_module_2_2_0_t *coll_allgather_init_module; + mca_coll_base_module_allgatherv_init_fn_t coll_allgatherv_init; + mca_coll_base_module_2_2_0_t *coll_allgatherv_init_module; + mca_coll_base_module_allreduce_init_fn_t coll_allreduce_init; + mca_coll_base_module_2_2_0_t *coll_allreduce_init_module; + mca_coll_base_module_alltoall_init_fn_t coll_alltoall_init; + mca_coll_base_module_2_2_0_t *coll_alltoall_init_module; + mca_coll_base_module_alltoallv_init_fn_t coll_alltoallv_init; + mca_coll_base_module_2_2_0_t *coll_alltoallv_init_module; + mca_coll_base_module_alltoallw_init_fn_t coll_alltoallw_init; + mca_coll_base_module_2_2_0_t *coll_alltoallw_init_module; + mca_coll_base_module_barrier_init_fn_t coll_barrier_init; + mca_coll_base_module_2_2_0_t *coll_barrier_init_module; + mca_coll_base_module_bcast_init_fn_t coll_bcast_init; + mca_coll_base_module_2_2_0_t *coll_bcast_init_module; + mca_coll_base_module_exscan_init_fn_t coll_exscan_init; + mca_coll_base_module_2_2_0_t *coll_exscan_init_module; + mca_coll_base_module_gather_init_fn_t coll_gather_init; + mca_coll_base_module_2_2_0_t *coll_gather_init_module; + mca_coll_base_module_gatherv_init_fn_t coll_gatherv_init; + mca_coll_base_module_2_2_0_t *coll_gatherv_init_module; + mca_coll_base_module_reduce_init_fn_t coll_reduce_init; + mca_coll_base_module_2_2_0_t *coll_reduce_init_module; + mca_coll_base_module_reduce_scatter_init_fn_t coll_reduce_scatter_init; + mca_coll_base_module_2_2_0_t *coll_reduce_scatter_init_module; + mca_coll_base_module_reduce_scatter_block_init_fn_t coll_reduce_scatter_block_init; + mca_coll_base_module_2_2_0_t *coll_reduce_scatter_block_init_module; + mca_coll_base_module_scan_init_fn_t coll_scan_init; + mca_coll_base_module_2_2_0_t *coll_scan_init_module; + mca_coll_base_module_scatter_init_fn_t coll_scatter_init; + mca_coll_base_module_2_2_0_t *coll_scatter_init_module; + mca_coll_base_module_scatterv_init_fn_t coll_scatterv_init; + mca_coll_base_module_2_2_0_t *coll_scatterv_init_module; + + /* blocking neighborhood collectives */ mca_coll_base_module_allgather_fn_t coll_neighbor_allgather; mca_coll_base_module_2_2_0_t *coll_neighbor_allgather_module; mca_coll_base_module_allgatherv_fn_t coll_neighbor_allgatherv; @@ -589,6 +741,7 @@ struct mca_coll_base_comm_coll_t { mca_coll_base_module_neighbor_alltoallw_fn_t coll_neighbor_alltoallw; mca_coll_base_module_2_2_0_t *coll_neighbor_alltoallw_module; + /* nonblocking neighborhood collectives */ mca_coll_base_module_iallgather_fn_t coll_ineighbor_allgather; mca_coll_base_module_2_2_0_t *coll_ineighbor_allgather_module; mca_coll_base_module_iallgatherv_fn_t coll_ineighbor_allgatherv; @@ -600,6 +753,18 @@ struct mca_coll_base_comm_coll_t { mca_coll_base_module_ineighbor_alltoallw_fn_t coll_ineighbor_alltoallw; mca_coll_base_module_2_2_0_t *coll_ineighbor_alltoallw_module; + /* persistent neighborhood collectives */ + mca_coll_base_module_allgather_init_fn_t coll_neighbor_allgather_init; + mca_coll_base_module_2_2_0_t *coll_neighbor_allgather_init_module; + mca_coll_base_module_allgatherv_init_fn_t coll_neighbor_allgatherv_init; + mca_coll_base_module_2_2_0_t *coll_neighbor_allgatherv_init_module; + mca_coll_base_module_alltoall_init_fn_t coll_neighbor_alltoall_init; + mca_coll_base_module_2_2_0_t *coll_neighbor_alltoall_init_module; + mca_coll_base_module_alltoallv_init_fn_t coll_neighbor_alltoallv_init; + mca_coll_base_module_2_2_0_t *coll_neighbor_alltoallv_init_module; + mca_coll_base_module_neighbor_alltoallw_init_fn_t coll_neighbor_alltoallw_init; + mca_coll_base_module_2_2_0_t *coll_neighbor_alltoallw_init_module; + mca_coll_base_module_reduce_local_fn_t coll_reduce_local; mca_coll_base_module_2_2_0_t *coll_reduce_local_module; }; diff --git a/ompi/mpi/c/start.c b/ompi/mpi/c/start.c index 3f1b3658e3..0e5478ffc6 100644 --- a/ompi/mpi/c/start.c +++ b/ompi/mpi/c/start.c @@ -12,6 +12,7 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -66,6 +67,7 @@ int MPI_Start(MPI_Request *request) switch((*request)->req_type) { case OMPI_REQUEST_PML: + case OMPI_REQUEST_COLL: OPAL_CR_ENTER_LIBRARY(); ret = (*request)->req_start(1, request); diff --git a/ompi/mpi/c/startall.c b/ompi/mpi/c/startall.c index 14452f68de..733257d3b4 100644 --- a/ompi/mpi/c/startall.c +++ b/ompi/mpi/c/startall.c @@ -15,6 +15,7 @@ * reserved. * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -64,7 +65,8 @@ int MPI_Startall(int count, MPI_Request requests[]) } else { for (i = 0; i < count; ++i) { if (NULL == requests[i] || - (OMPI_REQUEST_PML != requests[i]->req_type && + (OMPI_REQUEST_PML != requests[i]->req_type && + OMPI_REQUEST_COLL != requests[i]->req_type && OMPI_REQUEST_NOOP != requests[i]->req_type)) { rc = MPI_ERR_REQUEST; break; From a9609b6bf8eeafa0828117978867bfdb04007bd4 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Tue, 12 Dec 2017 16:28:04 +0900 Subject: [PATCH 05/17] coll/libnbc: add persistent collectives implementation Signed-off-by: Gilles Gouaillardet --- ompi/mca/coll/libnbc/coll_libnbc.h | 132 +++++++++++++++++- ompi/mca/coll/libnbc/coll_libnbc_component.c | 57 +++++++- ompi/mca/coll/libnbc/nbc.c | 78 ++++++++++- ompi/mca/coll/libnbc/nbc_iallgather.c | 37 ++++- ompi/mca/coll/libnbc/nbc_iallgatherv.c | 36 +++++ ompi/mca/coll/libnbc/nbc_iallreduce.c | 37 +++++ ompi/mca/coll/libnbc/nbc_ialltoall.c | 36 +++++ ompi/mca/coll/libnbc/nbc_ialltoallv.c | 40 ++++++ ompi/mca/coll/libnbc/nbc_ialltoallw.c | 38 +++++ ompi/mca/coll/libnbc/nbc_ibarrier.c | 34 +++++ ompi/mca/coll/libnbc/nbc_ibcast.c | 36 +++++ ompi/mca/coll/libnbc/nbc_iexscan.c | 18 +++ ompi/mca/coll/libnbc/nbc_igather.c | 38 +++++ ompi/mca/coll/libnbc/nbc_igatherv.c | 38 +++++ .../mca/coll/libnbc/nbc_ineighbor_allgather.c | 18 +++ .../coll/libnbc/nbc_ineighbor_allgatherv.c | 19 +++ ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c | 18 +++ .../mca/coll/libnbc/nbc_ineighbor_alltoallv.c | 19 +++ .../mca/coll/libnbc/nbc_ineighbor_alltoallw.c | 19 +++ ompi/mca/coll/libnbc/nbc_internal.h | 1 + ompi/mca/coll/libnbc/nbc_ireduce.c | 36 +++++ ompi/mca/coll/libnbc/nbc_ireduce_scatter.c | 36 +++++ .../coll/libnbc/nbc_ireduce_scatter_block.c | 36 +++++ ompi/mca/coll/libnbc/nbc_iscan.c | 18 +++ ompi/mca/coll/libnbc/nbc_iscatter.c | 38 +++++ ompi/mca/coll/libnbc/nbc_iscatterv.c | 38 +++++ 26 files changed, 943 insertions(+), 8 deletions(-) diff --git a/ompi/mca/coll/libnbc/coll_libnbc.h b/ompi/mca/coll/libnbc/coll_libnbc.h index 94f1d03836..5e8a7df5a2 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc.h +++ b/ompi/mca/coll/libnbc/coll_libnbc.h @@ -13,7 +13,7 @@ * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ @@ -139,7 +139,7 @@ typedef ompi_coll_libnbc_request_t NBC_Handle; OMPI_REQUEST_INIT(&req->super, false); \ req->super.req_mpi_object.comm = comm; \ req->super.req_complete = false; \ - req->super.req_state = OMPI_REQUEST_ACTIVE; \ + req->super.req_state = OMPI_REQUEST_INACTIVE; \ } while (0) #define OMPI_COLL_LIBNBC_REQUEST_RETURN(req) \ @@ -284,6 +284,134 @@ int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, c struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_allreduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_alltoall_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_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, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_alltoallw_init(const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, + void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t **request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_barrier_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_exscan_init(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t **request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_reduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_reduce_scatter_block_init(const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t **request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_scan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_scatter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_scatterv_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); + +int ompi_coll_libnbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_allgatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_allreduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_alltoall_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_alltoallv_inter_init(const void* sendbuf, const int *sendcounts, const int *sdispls, + MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_alltoallw_inter_init(const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, + void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t **request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_barrier_inter_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_bcast_inter_init(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_gather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_gatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_reduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_reduce_scatter_inter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_reduce_scatter_block_inter_init(const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, + MPI_Info info, ompi_request_t **request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_scatter_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_scatterv_inter_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); + +int ompi_coll_libnbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, + MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_neighbor_allgatherv_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + const int *rcounts, const int *displs, MPI_Datatype rtype, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_neighbor_alltoall_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, + ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_neighbor_alltoallv_init(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, + void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); +int ompi_coll_libnbc_neighbor_alltoallw_init(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, + void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module); + +int ompi_coll_libnbc_start(size_t count, ompi_request_t ** request); + END_C_DECLS diff --git a/ompi/mca/coll/libnbc/coll_libnbc_component.c b/ompi/mca/coll/libnbc/coll_libnbc_component.c index a94ca934e0..8e01deb9ae 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc_component.c +++ b/ompi/mca/coll/libnbc/coll_libnbc_component.c @@ -13,9 +13,12 @@ * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2016 Research Organization for Information Science + * Copyright (c) 2016-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. + * Copyright (c) 2017 Ian Bradley Morgan and Anthony Skjellum. All + * rights reserved. + * $COPYRIGHT$ * * Additional copyrights may follow @@ -207,6 +210,24 @@ libnbc_comm_query(struct ompi_communicator_t *comm, module->super.coll_iscan = NULL; module->super.coll_iscatter = ompi_coll_libnbc_iscatter_inter; module->super.coll_iscatterv = ompi_coll_libnbc_iscatterv_inter; + + module->super.coll_allgather_init = ompi_coll_libnbc_allgather_inter_init; + module->super.coll_allgatherv_init = ompi_coll_libnbc_allgatherv_inter_init; + module->super.coll_allreduce_init = ompi_coll_libnbc_allreduce_inter_init; + module->super.coll_alltoall_init = ompi_coll_libnbc_alltoall_inter_init; + module->super.coll_alltoallv_init = ompi_coll_libnbc_alltoallv_inter_init; + module->super.coll_alltoallw_init = ompi_coll_libnbc_alltoallw_inter_init; + module->super.coll_barrier_init = ompi_coll_libnbc_barrier_inter_init; + module->super.coll_bcast_init = ompi_coll_libnbc_bcast_inter_init; + module->super.coll_exscan_init = NULL; + module->super.coll_gather_init = ompi_coll_libnbc_gather_inter_init; + module->super.coll_gatherv_init = ompi_coll_libnbc_gatherv_inter_init; + module->super.coll_reduce_init = ompi_coll_libnbc_reduce_inter_init; + module->super.coll_reduce_scatter_init = ompi_coll_libnbc_reduce_scatter_inter_init; + module->super.coll_reduce_scatter_block_init = ompi_coll_libnbc_reduce_scatter_block_inter_init; + module->super.coll_scan_init = NULL; + module->super.coll_scatter_init = ompi_coll_libnbc_scatter_inter_init; + module->super.coll_scatterv_init = ompi_coll_libnbc_scatterv_inter_init; } else { module->super.coll_iallgather = ompi_coll_libnbc_iallgather; module->super.coll_iallgatherv = ompi_coll_libnbc_iallgatherv; @@ -231,6 +252,30 @@ libnbc_comm_query(struct ompi_communicator_t *comm, module->super.coll_ineighbor_alltoall = ompi_coll_libnbc_ineighbor_alltoall; module->super.coll_ineighbor_alltoallv = ompi_coll_libnbc_ineighbor_alltoallv; module->super.coll_ineighbor_alltoallw = ompi_coll_libnbc_ineighbor_alltoallw; + + module->super.coll_allgather_init = ompi_coll_libnbc_allgather_init; + module->super.coll_allgatherv_init = ompi_coll_libnbc_allgatherv_init; + module->super.coll_allreduce_init = ompi_coll_libnbc_allreduce_init; + module->super.coll_alltoall_init = ompi_coll_libnbc_alltoall_init; + module->super.coll_alltoallv_init = ompi_coll_libnbc_alltoallv_init; + module->super.coll_alltoallw_init = ompi_coll_libnbc_alltoallw_init; + module->super.coll_barrier_init = ompi_coll_libnbc_barrier_init; + module->super.coll_bcast_init = ompi_coll_libnbc_bcast_init; + module->super.coll_exscan_init = ompi_coll_libnbc_exscan_init; + module->super.coll_gather_init = ompi_coll_libnbc_gather_init; + module->super.coll_gatherv_init = ompi_coll_libnbc_gatherv_init; + module->super.coll_reduce_init = ompi_coll_libnbc_reduce_init; + module->super.coll_reduce_scatter_init = ompi_coll_libnbc_reduce_scatter_init; + module->super.coll_reduce_scatter_block_init = ompi_coll_libnbc_reduce_scatter_block_init; + module->super.coll_scan_init = ompi_coll_libnbc_scan_init; + module->super.coll_scatter_init = ompi_coll_libnbc_scatter_init; + module->super.coll_scatterv_init = ompi_coll_libnbc_scatterv_init; + + module->super.coll_neighbor_allgather_init = ompi_coll_libnbc_neighbor_allgather_init; + module->super.coll_neighbor_allgatherv_init = ompi_coll_libnbc_neighbor_allgatherv_init; + module->super.coll_neighbor_alltoall_init = ompi_coll_libnbc_neighbor_alltoall_init; + module->super.coll_neighbor_alltoallv_init = ompi_coll_libnbc_neighbor_alltoallv_init; + module->super.coll_neighbor_alltoallw_init = ompi_coll_libnbc_neighbor_alltoallw_init; } module->super.ft_event = NULL; @@ -291,7 +336,9 @@ ompi_coll_libnbc_progress(void) else { request->super.req_status.MPI_ERROR = res; } - ompi_request_complete(&request->super, true); + if(!request->super.req_persistent || !REQUEST_COMPLETE(&request->super)) { + ompi_request_complete(&request->super, true); + } } OPAL_THREAD_LOCK(&mca_coll_libnbc_component.lock); } @@ -350,9 +397,11 @@ request_free(struct ompi_request_t **ompi_req) return MPI_ERR_REQUEST; } - OMPI_COLL_LIBNBC_REQUEST_RETURN(request); + if (!request->super.req_persistent) { + OMPI_COLL_LIBNBC_REQUEST_RETURN(request); - *ompi_req = MPI_REQUEST_NULL; + *ompi_req = MPI_REQUEST_NULL; + } return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc.c b/ompi/mca/coll/libnbc/nbc.c index 662247976e..fca82a94f5 100644 --- a/ompi/mca/coll/libnbc/nbc.c +++ b/ompi/mca/coll/libnbc/nbc.c @@ -17,6 +17,8 @@ * * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. + * Copyright (c) 2017 Ian Bradley Morgan and Anthony Skjellum. All + * rights reserved. * */ #include "nbc_internal.h" @@ -383,7 +385,9 @@ int NBC_Progress(NBC_Handle *handle) { /* this was the last round - we're done */ NBC_DEBUG(5, "NBC_Progress last round finished - we're done\n"); - NBC_Free(handle); + if (!handle->super.req_persistent) { + NBC_Free(handle); + } return NBC_OK; } @@ -650,6 +654,7 @@ int NBC_Start(NBC_Handle *handle) { if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } + handle->super.req_state = OMPI_REQUEST_ACTIVE; OPAL_THREAD_LOCK(&mca_coll_libnbc_component.lock); opal_list_append(&mca_coll_libnbc_component.active_requests, &(handle->super.super.super)); OPAL_THREAD_UNLOCK(&mca_coll_libnbc_component.lock); @@ -725,3 +730,74 @@ void NBC_SchedCache_args_delete(void *entry) { free(entry); } #endif + +int NBC_Persist(NBC_Handle *handle) { + + handle->super.req_complete = REQUEST_PENDING; + handle->super.req_start = ompi_coll_libnbc_start; + handle->super.req_persistent = true; + + return OMPI_SUCCESS; +} + +static int NBC_Start_internal(NBC_Handle *handle) { + + /* kick off first round */ + int res = NBC_Start_round(handle); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + /* + * FIXME - The request may already be complete/inactive now + * if so, it should not be added to the active list + * Must add param to provide the status of request, + * because the user could have already freed it and + * it could already be in use by another operation! + */ + + OPAL_THREAD_LOCK(&mca_coll_libnbc_component.lock); + opal_list_append(&mca_coll_libnbc_component.active_requests, &(handle->super.super.super)); + OPAL_THREAD_UNLOCK(&mca_coll_libnbc_component.lock); + + return OMPI_SUCCESS; + +} + +int ompi_coll_libnbc_start(size_t count, ompi_request_t ** request) { + + NBC_DEBUG(5, " ** ompi_coll_libnbc_start **\n"); + + /* FIXME */ + assert (1 == count); + + NBC_Handle *handle; + NBC_Schedule *schedule; + + int res; + + handle = (NBC_Handle *) *request; + + NBC_DEBUG(5, "--------------------------------\n"); + NBC_DEBUG(5, "schedule %p size %u\n", &schedule, sizeof(schedule)); + NBC_DEBUG(5, "handle %p size %u\n", &handle, sizeof(handle)); + NBC_DEBUG(5, "data %p size %u\n", &schedule->data, sizeof(schedule->data)); + NBC_DEBUG(5, "req_array %p size %u\n", &handle->req_array, sizeof(handle->req_array)); + NBC_DEBUG(5, "row_offset=%u address=%p size=%u\n", handle->row_offset, &handle->row_offset, sizeof(handle->row_offset)); + NBC_DEBUG(5, "req_count=%u address=%p size=%u\n", handle->req_count, &handle->req_count, sizeof(handle->req_count)); + NBC_DEBUG(5, "tmpbuf address=%p size=%u\n", handle->tmpbuf, sizeof(handle->tmpbuf)); + NBC_DEBUG(5, "--------------------------------\n"); + + handle->super.req_state = OMPI_REQUEST_ACTIVE; + res = NBC_Start_internal(handle); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_DEBUG(5, " ** bad result from NBC_Start_internal **\n"); + NBC_Return_handle (handle); + return res; + } + + NBC_DEBUG(5, " ** LEAVING ompi_coll_libnbc_start **\n"); + + return OMPI_SUCCESS; + +} diff --git a/ompi/mca/coll/libnbc/nbc_iallgather.c b/ompi/mca/coll/libnbc/nbc_iallgather.c index 0b2b721698..befb13ae21 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgather.c +++ b/ompi/mca/coll/libnbc/nbc_iallgather.c @@ -258,4 +258,39 @@ int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Da return OMPI_SUCCESS; } - + +int ompi_coll_libnbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallgather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iallgatherv.c b/ompi/mca/coll/libnbc/nbc_iallgatherv.c index 9a93227650..a3ee348319 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_iallgatherv.c @@ -205,3 +205,39 @@ int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_D return OMPI_SUCCESS; } + +int ompi_coll_libnbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_allgatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallgatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iallreduce.c b/ompi/mca/coll/libnbc/nbc_iallreduce.c index ccf8e9b929..db62b32f55 100644 --- a/ompi/mca/coll/libnbc/nbc_iallreduce.c +++ b/ompi/mca/coll/libnbc/nbc_iallreduce.c @@ -725,3 +725,40 @@ static inline int allred_sched_linear(int rank, int rsize, const void *sendbuf, return OMPI_SUCCESS; } + +int ompi_coll_libnbc_allreduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallreduce(sendbuf, recvbuf, count, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_allreduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iallreduce_inter(sendbuf, recvbuf, count, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + diff --git a/ompi/mca/coll/libnbc/nbc_ialltoall.c b/ompi/mca/coll/libnbc/nbc_ialltoall.c index 00e600bf70..d473a8f26c 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoall.c @@ -582,3 +582,39 @@ static inline int a2a_sched_inplace(int rank, int p, NBC_Schedule* schedule, voi return OMPI_SUCCESS; } + +int ompi_coll_libnbc_alltoall_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_alltoall_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoall_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallv.c b/ompi/mca/coll/libnbc/nbc_ialltoallv.c index 31d39265d5..f7703be2c2 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallv.c @@ -384,3 +384,43 @@ static inline int a2av_sched_inplace(int rank, int p, NBC_Schedule *schedule, return OMPI_SUCCESS; } + +int ompi_coll_libnbc_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, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_alltoallv_inter_init(const void* sendbuf, const int *sendcounts, const int *sdispls, + MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoallv_inter(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, + comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallw.c b/ompi/mca/coll/libnbc/nbc_ialltoallw.c index 9ad2441d77..bb85a9a9a1 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallw.c @@ -358,3 +358,41 @@ static inline int a2aw_sched_inplace(int rank, int p, NBC_Schedule *schedule, return OMPI_SUCCESS; } + +int ompi_coll_libnbc_alltoallw_init(const void* sendbuf, const int *sendcounts, const int *sdispls, + struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, + struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_alltoallw_inter_init(const void* sendbuf, const int *sendcounts, const int *sdispls, + struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, + struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ialltoallw_inter(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ibarrier.c b/ompi/mca/coll/libnbc/nbc_ibarrier.c index 5d8d9ad096..c146c1140c 100644 --- a/ompi/mca/coll/libnbc/nbc_ibarrier.c +++ b/ompi/mca/coll/libnbc/nbc_ibarrier.c @@ -201,3 +201,37 @@ int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_reque return OMPI_SUCCESS; } + +int ompi_coll_libnbc_barrier_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ibarrier(comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_barrier_inter_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ibarrier_inter(comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ibcast.c b/ompi/mca/coll/libnbc/nbc_ibcast.c index ecc158ac40..df3f6e3407 100644 --- a/ompi/mca/coll/libnbc/nbc_ibcast.c +++ b/ompi/mca/coll/libnbc/nbc_ibcast.c @@ -410,3 +410,39 @@ int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype return OMPI_SUCCESS; } + +int ompi_coll_libnbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ibcast(buffer, count, datatype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_bcast_inter_init(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ibcast_inter(buffer, count, datatype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iexscan.c b/ompi/mca/coll/libnbc/nbc_iexscan.c index 3b1dc050b9..fd23346e50 100644 --- a/ompi/mca/coll/libnbc/nbc_iexscan.c +++ b/ompi/mca/coll/libnbc/nbc_iexscan.c @@ -209,3 +209,21 @@ int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_ return OMPI_SUCCESS; } + +int ompi_coll_libnbc_exscan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iexscan(sendbuf, recvbuf, count, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_igather.c b/ompi/mca/coll/libnbc/nbc_igather.c index ae9061056d..108f14ecee 100644 --- a/ompi/mca/coll/libnbc/nbc_igather.c +++ b/ompi/mca/coll/libnbc/nbc_igather.c @@ -268,3 +268,41 @@ int ompi_coll_libnbc_igather_inter(const void* sendbuf, int sendcount, MPI_Datat return OMPI_SUCCESS; } + +int ompi_coll_libnbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_gather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_igather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_igatherv.c b/ompi/mca/coll/libnbc/nbc_igatherv.c index cb5625c055..eb908cf3b3 100644 --- a/ompi/mca/coll/libnbc/nbc_igatherv.c +++ b/ompi/mca/coll/libnbc/nbc_igatherv.c @@ -203,3 +203,41 @@ int ompi_coll_libnbc_igatherv_inter(const void* sendbuf, int sendcount, MPI_Data return OMPI_SUCCESS; } + +int ompi_coll_libnbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_gatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_igatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c index fce26db1ee..cf6db001c9 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c @@ -329,3 +329,21 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch return OMPI_SUCCESS; } + +int ompi_coll_libnbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, + MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_allgather(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c index 3725c5d0c6..1d9817e038 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c @@ -180,3 +180,22 @@ int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Data return OMPI_SUCCESS; } + +int ompi_coll_libnbc_neighbor_allgatherv_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + const int *rcounts, const int *displs, MPI_Datatype rtype, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_allgatherv(sbuf, scount, stype, rbuf, rcounts, displs, rtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c index 575d4cf316..4a8962fa33 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c @@ -181,3 +181,21 @@ int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Dataty return OMPI_SUCCESS; } + +int ompi_coll_libnbc_neighbor_alltoall_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, + ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_alltoall(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c index a791eceab6..d2b6dc21aa 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c @@ -187,3 +187,22 @@ int ompi_coll_libnbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, c return OMPI_SUCCESS; } + +int ompi_coll_libnbc_neighbor_alltoallv_init(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, + void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_alltoallv(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c index 580dfaef3e..67cf5bc785 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c @@ -172,3 +172,22 @@ int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, c return OMPI_SUCCESS; } + +int ompi_coll_libnbc_neighbor_alltoallw_init(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, + void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ineighbor_alltoallw(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_internal.h b/ompi/mca/coll/libnbc/nbc_internal.h index 8680a1b983..5eac0f7d34 100644 --- a/ompi/mca/coll/libnbc/nbc_internal.h +++ b/ompi/mca/coll/libnbc/nbc_internal.h @@ -260,6 +260,7 @@ void NBC_SchedCache_args_delete_key_dummy(void *k); int NBC_Start(NBC_Handle *handle); +int NBC_Persist(NBC_Handle *handle); int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, ompi_coll_libnbc_module_t *module, ompi_request_t **request, void *tmpbuf); void NBC_Return_handle(ompi_coll_libnbc_request_t *request); static inline int NBC_Type_intrinsic(MPI_Datatype type); diff --git a/ompi/mca/coll/libnbc/nbc_ireduce.c b/ompi/mca/coll/libnbc/nbc_ireduce.c index cc02c85460..f4a161ac21 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce.c @@ -550,3 +550,39 @@ static inline int red_sched_linear (int rank, int rsize, int root, const void *s return OMPI_SUCCESS; } + +int ompi_coll_libnbc_reduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_reduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c index ccfd8db9ea..589beda2e0 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c @@ -360,3 +360,39 @@ int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, return OMPI_SUCCESS; } + +int ompi_coll_libnbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_reduce_scatter_inter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_scatter_inter(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c index b6f3dd1d0a..1702123ab8 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c @@ -359,3 +359,39 @@ int ompi_coll_libnbc_ireduce_scatter_block_inter(const void* sendbuf, void* recv return OMPI_SUCCESS; } + +int ompi_coll_libnbc_reduce_scatter_block_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_reduce_scatter_block_inter_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_ireduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iscan.c b/ompi/mca/coll/libnbc/nbc_iscan.c index 9b016f6d86..144a338a51 100644 --- a/ompi/mca/coll/libnbc/nbc_iscan.c +++ b/ompi/mca/coll/libnbc/nbc_iscan.c @@ -185,3 +185,21 @@ int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Da return OMPI_SUCCESS; } + +int ompi_coll_libnbc_scan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscan(sendbuf, recvbuf, count, datatype, op, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iscatter.c b/ompi/mca/coll/libnbc/nbc_iscatter.c index eb40ee49f9..895860008c 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatter.c +++ b/ompi/mca/coll/libnbc/nbc_iscatter.c @@ -261,3 +261,41 @@ int ompi_coll_libnbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Dat return OMPI_SUCCESS; } + +int ompi_coll_libnbc_scatter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_scatter_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscatter_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} diff --git a/ompi/mca/coll/libnbc/nbc_iscatterv.c b/ompi/mca/coll/libnbc/nbc_iscatterv.c index 1b5a6a2519..cf6ccfed0c 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatterv.c +++ b/ompi/mca/coll/libnbc/nbc_iscatterv.c @@ -195,3 +195,41 @@ int ompi_coll_libnbc_iscatterv_inter(const void* sendbuf, const int *sendcounts, return OMPI_SUCCESS; } + +int ompi_coll_libnbc_scatterv_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} + +int ompi_coll_libnbc_scatterv_inter_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module) { + int res = nbc_iscatterv_inter(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + + res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); + *request = &ompi_request_null.request; + return res; + } + + return OMPI_SUCCESS; +} From e69e99575ed8b1dde0fbecb0599e266ae991f34d Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Thu, 19 Jan 2017 09:57:00 +0900 Subject: [PATCH 06/17] coll: Enable func check in `mca_coll_base_comm_select` Now libnbc COLL supports persistent collectives and all `*_init` functions of the COLL interface are available. So let's enable the check of availability of those functions on a communicator creation. Signed-off-by: KAWASHIMA Takahiro --- ompi/mca/coll/base/coll_base_comm_select.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/ompi/mca/coll/base/coll_base_comm_select.c b/ompi/mca/coll/base/coll_base_comm_select.c index 42454258b9..1d0d9da232 100644 --- a/ompi/mca/coll/base/coll_base_comm_select.c +++ b/ompi/mca/coll/base/coll_base_comm_select.c @@ -274,10 +274,24 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm) ((OMPI_COMM_IS_INTRA(comm)) && CHECK_NULL(which_func, comm, iscan)) || CHECK_NULL(which_func, comm, iscatter) || CHECK_NULL(which_func, comm, iscatterv) || + CHECK_NULL(which_func, comm, allgather_init) || + CHECK_NULL(which_func, comm, allgatherv_init) || + CHECK_NULL(which_func, comm, allreduce_init) || + CHECK_NULL(which_func, comm, alltoall_init) || + CHECK_NULL(which_func, comm, alltoallv_init) || + CHECK_NULL(which_func, comm, alltoallw_init) || + CHECK_NULL(which_func, comm, barrier_init) || + CHECK_NULL(which_func, comm, bcast_init) || + ((OMPI_COMM_IS_INTRA(comm)) && CHECK_NULL(which_func, comm, exscan_init)) || + CHECK_NULL(which_func, comm, gather_init) || + CHECK_NULL(which_func, comm, gatherv_init) || + CHECK_NULL(which_func, comm, reduce_init) || + CHECK_NULL(which_func, comm, reduce_scatter_block_init) || + CHECK_NULL(which_func, comm, reduce_scatter_init) || + ((OMPI_COMM_IS_INTRA(comm)) && CHECK_NULL(which_func, comm, scan_init)) || + CHECK_NULL(which_func, comm, scatter_init) || + CHECK_NULL(which_func, comm, scatterv_init) || CHECK_NULL(which_func, comm, reduce_local) ) { - /* TODO -- Once the persistent collective communication request - * function is implemented then check if persistent collectives have - * been set. */ /* TODO -- Once the topology flags are set before coll_select then * check if neighborhood collectives have been set. */ From 545e9af896cfc0781dacacdd918e66d0c61dc4cc Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Thu, 19 Jan 2017 10:28:28 +0900 Subject: [PATCH 07/17] 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 --- .gitignore | 2 + ompi/mpiext/pcollreq/Makefile.am | 10 + ompi/mpiext/pcollreq/README.txt | 13 ++ .../mpiext/pcollreq/c/MPIX_Allgather_init.3in | 1 + .../pcollreq/c/MPIX_Allgatherv_init.3in | 1 + .../mpiext/pcollreq/c/MPIX_Allreduce_init.3in | 1 + ompi/mpiext/pcollreq/c/MPIX_Alltoall_init.3in | 1 + .../mpiext/pcollreq/c/MPIX_Alltoallv_init.3in | 1 + .../mpiext/pcollreq/c/MPIX_Alltoallw_init.3in | 1 + ompi/mpiext/pcollreq/c/MPIX_Barrier_init.3in | 157 ++++++++++++++++ ompi/mpiext/pcollreq/c/MPIX_Bcast_init.3in | 1 + ompi/mpiext/pcollreq/c/MPIX_Exscan_init.3in | 1 + ompi/mpiext/pcollreq/c/MPIX_Gather_init.3in | 1 + ompi/mpiext/pcollreq/c/MPIX_Gatherv_init.3in | 1 + .../c/MPIX_Neighbor_allgather_init.3in | 1 + .../c/MPIX_Neighbor_allgatherv_init.3in | 1 + .../c/MPIX_Neighbor_alltoall_init.3in | 1 + .../c/MPIX_Neighbor_alltoallv_init.3in | 1 + .../c/MPIX_Neighbor_alltoallw_init.3in | 1 + ompi/mpiext/pcollreq/c/MPIX_Reduce_init.3in | 1 + .../c/MPIX_Reduce_scatter_block_init.3in | 1 + .../pcollreq/c/MPIX_Reduce_scatter_init.3in | 1 + ompi/mpiext/pcollreq/c/MPIX_Scan_init.3in | 1 + ompi/mpiext/pcollreq/c/MPIX_Scatter_init.3in | 1 + ompi/mpiext/pcollreq/c/MPIX_Scatterv_init.3in | 1 + ompi/mpiext/pcollreq/c/Makefile.am | 63 +++++++ ompi/mpiext/pcollreq/c/mpiext_pcollreq.c | 174 ++++++++++++++++++ ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h | 33 ++++ ompi/mpiext/pcollreq/configure.m4 | 21 +++ 29 files changed, 494 insertions(+) create mode 100644 ompi/mpiext/pcollreq/Makefile.am create mode 100644 ompi/mpiext/pcollreq/README.txt create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Allgather_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Allgatherv_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Allreduce_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Alltoall_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Alltoallv_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Alltoallw_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Barrier_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Bcast_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Exscan_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Gather_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Gatherv_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Neighbor_allgather_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Neighbor_allgatherv_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoall_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoallv_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoallw_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Reduce_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Reduce_scatter_block_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Reduce_scatter_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Scan_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Scatter_init.3in create mode 100644 ompi/mpiext/pcollreq/c/MPIX_Scatterv_init.3in 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/.gitignore b/.gitignore index f4d61df197..2dd0d653be 100644 --- a/.gitignore +++ b/.gitignore @@ -246,6 +246,8 @@ ompi/mpiext/example/tests/progress_usempif08 ompi/mpiext/cuda/c/MPIX_Query_cuda_support.3 ompi/mpiext/cuda/c/mpiext_cuda_c.h +ompi/mpiext/pcollreq/c/MPIX_*.3 + ompi/tools/mpisync/mpisync ompi/tools/mpisync/mpirun_prof ompi/tools/mpisync/ompi_timing_post diff --git a/ompi/mpiext/pcollreq/Makefile.am b/ompi/mpiext/pcollreq/Makefile.am new file mode 100644 index 0000000000..2b48a7514f --- /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/README.txt b/ompi/mpiext/pcollreq/README.txt new file mode 100644 index 0000000000..0b30de9fe8 --- /dev/null +++ b/ompi/mpiext/pcollreq/README.txt @@ -0,0 +1,13 @@ +Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + +$COPYRIGHT$ + +This extension provides the feature of persistent collective communication +operations and persistent neighborhood collective communication operations, +which is proposed in the MPI Forum as of June 2018. + +See MPIX_Barrier_init(3) for more details. + +The code will be moved to the ompi/mpi directory and the MPIX_ prefix will +be switch to the MPI_ prefix once the MPI Standard which includes this +feature is published. diff --git a/ompi/mpiext/pcollreq/c/MPIX_Allgather_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Allgather_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Allgather_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Allgatherv_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Allgatherv_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Allgatherv_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Allreduce_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Allreduce_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Allreduce_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Alltoall_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Alltoall_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Alltoall_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Alltoallv_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Alltoallv_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Alltoallv_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Alltoallw_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Alltoallw_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Alltoallw_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Barrier_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Barrier_init.3in new file mode 100644 index 0000000000..5977e6e004 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Barrier_init.3in @@ -0,0 +1,157 @@ +.\" -*- nroff -*- +.\" Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. +.\" $COPYRIGHT$ +.TH MPIX_Barrier_init 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +.SH NAME +\fBMPIX_Allgather_init, MPIX_Allgatherv_init, MPIX_Allreduce_init, MPIX_Alltoall_init, MPIX_Alltoallv_init, MPIX_Alltoallw_init, MPIX_Barrier_init, MPIX_Bcast_init, MPIX_Exscan_init, MPIX_Gather_init, MPIX_Gatherv_init, MPIX_Reduce_init, MPIX_Reduce_scatter_init, MPIX_Reduce_scatter_block_init, MPIX_Scan_init, MPIX_Scatter_init, MPIX_Scatterv_init, MPIX_Neighbor_allgather_init, MPIX_Neighbor_allgatherv_init, MPIX_Neighbor_alltoall_init, MPIX_Neighbor_alltoallv_init, MPIX_Neighbor_alltoallw_init\fP \- Builds a handle for a collective communication or neighborhood collective communication + +.SH SYNTAX +.ft R +.SH C Syntax +.nf +#include +#include +int MPIX_Allgather_init(const void *\fIsendbuf\fP, int \fIsendcount\fP, + MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, int \fIrecvcount\fP, + MPI_Datatype \fIrecvtype\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Allgatherv_init(const void *\fIsendbuf\fP, int \fIsendcount\fP, + MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, const int \fIrecvcounts\fP[], + const int \fIdispls\fP[], MPI_Datatype \fIrecvtype\fP, MPI_Comm \fIcomm\fP, + MPI_Info \fIinfo\fP, MPI_Request *\fIrequest\fP) + +int MPIX_Allreduce_init(const void *\fIsendbuf\fP, void *\fIrecvbuf\fP, int \fIcount\fP, + MPI_Datatype \fIdatatype\fP, MPI_Op \fIop\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Alltoall_init(const void *\fIsendbuf\fP, int \fIsendcount\fP, + MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, int \fIrecvcount\fP, + MPI_Datatype \fIrecvtype\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Alltoallv_init(const void *\fIsendbuf\fP, const int \fIsendcounts\fP[], + const int \fIsdispls\fP[], MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, + const int \fIrecvcounts\fP[], const int \fIrdispls\fP[], MPI_Datatype \fIrecvtype\fP, + MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, MPI_Request *\fIrequest\fP) + +int MPIX_Alltoallw_init(const void *\fIsendbuf\fP, const int \fIsendcounts\fP[], + const int \fIsdispls\fP[], const MPI_Datatype \fIsendtypes\fP[], void *\fIrecvbuf\fP, + const int \fIrecvcounts\fP[], const int \fIrdispls\fP[], + const MPI_Datatype \fIrecvtypes\fP[], MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Barrier_init(MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Bcast_init(void *\fIbuffer\fP, int \fIcount\fP, MPI_Datatype \fIdatatype\fP, + int \fIroot\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, MPI_Request *\fIrequest\fP) + +int MPIX_Exscan_init(const void *\fIsendbuf\fP, void *\fIrecvbuf\fP, int \fIcount\fP, + MPI_Datatype \fIdatatype\fP, MPI_Op \fIop\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Gather_init(const void *\fIsendbuf\fP, int \fIsendcount\fP, + MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, int \fIrecvcount\fP, + MPI_Datatype \fIrecvtype\fP, int \fIroot\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Gatherv_init(const void *\fIsendbuf\fP, int \fIsendcount\fP, + MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, const int \fIrecvcounts\fP[], + const int \fIdispls\fP[], MPI_Datatype \fIrecvtype\fP, int \fIroot\fP, MPI_Comm \fIcomm\fP, + MPI_Info \fIinfo\fP, MPI_Request *\fIrequest\fP) + +int MPIX_Reduce_init(const void *\fIsendbuf\fP, void *\fIrecvbuf\fP, int \fIcount\fP, + MPI_Datatype \fIdatatype\fP, MPI_Op \fIop\fP, int \fIroot\fP, MPI_Comm \fIcomm\fP, + MPI_Info \fIinfo\fP, MPI_Request *\fIrequest\fP) + +int MPIX_Reduce_scatter_init(const void *\fIsendbuf\fP, void *\fIrecvbuf\fP, + const int \fIrecvcounts\fP[], MPI_Datatype \fIdatatype\fP, MPI_Op \fIop\fP, + MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, MPI_Request *\fIrequest\fP) + +int MPIX_Reduce_scatter_block_init(const void *\fIsendbuf\fP, void *\fIrecvbuf\fP, + int \fIrecvcount\fP, MPI_Datatype \fIdatatype\fP, MPI_Op \fIop\fP, MPI_Comm \fIcomm\fP, + MPI_Info \fIinfo\fP, MPI_Request *\fIrequest\fP) + +int MPIX_Scan_init(const void *\fIsendbuf\fP, void *\fIrecvbuf\fP, int \fIcount\fP, + MPI_Datatype \fIdatatype\fP, MPI_Op \fIop\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Scatter_init(const void *\fIsendbuf\fP, int \fIsendcount\fP, + MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, int \fIrecvcount\fP, + MPI_Datatype \fIrecvtype\fP, int \fIroot\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Scatterv_init(const void *\fIsendbuf\fP, const int \fIsendcounts\fP[], + const int \fIdispls\fP[], MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, + int \fIrecvcount\fP, MPI_Datatype \fIrecvtype\fP, int \fIroot\fP, MPI_Comm \fIcomm\fP, + MPI_Info \fIinfo\fP, MPI_Request *\fIrequest\fP) + +int MPIX_Neighbor_allgather_init(const void *\fIsendbuf\fP, int \fIsendcount\fP, + MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, int \fIrecvcount\fP, + MPI_Datatype \fIrecvtype\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Neighbor_allgatherv_init(const void *\fIsendbuf\fP, int \fIsendcount\fP, + MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, const int \fIrecvcounts\fP[], + const int \fIdispls\fP[], MPI_Datatype \fIrecvtype\fP, MPI_Comm \fIcomm\fP, + MPI_Info \fIinfo\fP, MPI_Request *\fIrequest\fP) + +int MPIX_Neighbor_alltoall_init(const void *\fIsendbuf\fP, int \fIsendcount\fP, + MPI_Datatype \fIsendtype\fP, void *\fIrecvbuf\fP, int \fIrecvcount\fP, + MPI_Datatype \fIrecvtype\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Neighbor_alltoallv_init(const void *\fIsendbuf\fP, + const int \fIsendcounts\fP[], const int \fIsdispls\fP[], MPI_Datatype \fIsendtype\fP, + void *\fIrecvbuf\fP, const int \fIrecvcounts\fP[], const int \fIrdispls\fP[], + MPI_Datatype \fIrecvtype\fP, MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +int MPIX_Neighbor_alltoallw_init(const void *\fIsendbuf\fP, + const int \fIsendcounts\fP[], const MPI_Aint \fIsdispls\fP[], + const MPI_Datatype \fIsendtypes\fP[], void *\fIrecvbuf\fP, + const int \fIrecvcounts\fP[], const MPI_Aint \fIrdispls\fP[], + const MPI_Datatype \fIrecvtypes\fP[], MPI_Comm \fIcomm\fP, MPI_Info \fIinfo\fP, + MPI_Request *\fIrequest\fP) + +.fi + +.SH DESCRIPTION +.ft R +Creates a persistent communication request for a collective operation or neighborhood collective operation. + +As of June 2018, the feature of persistent collective communication operations and persistent collective neighborhood communication operations is proposed in the MPI Forum. +.nf + + https://github.com/mpi-forum/mpi-issues/issues/25 +.fi + +Open MPI implements its draft version shown in the following URL. +.nf + + https://github.com/mpi-forum/mpi-issues/files/2078076/mpi32-report-ticket25-austin-vote-june2018.pdf +.fi + +Because it is still in a draft stage, the interface may change in the standard. Therefore the prefix \fIMPIX_\fP is used instead of \fIMPI_\fP for these request creation functions. To start, complete, and free the created request, usual MPI functions (\fIMPI_Start\fP etc.) can be used. Only C bindings are available currently. + +Future versions of Open MPI will switch to the \fIMPI_\fP prefix and will not require the header file \fImpi-ext.h\fP once the MPI Standard which includes this feature is published. + +.SH EXAMPLE +.nf + + MPI_Request req; + MPIX_Barrier_init(MPI_COMM_WORLD, MPI_INFO_NULL, &req); + MPI_Start(&req); + MPI_Wait(&req, MPI_STATUS_IGNORE); + MPI_Request_free(&req); +.fi + +.SH SEE ALSO +.ft R +.sp +MPI_Start +.br +MPI_Startall +.br +MPI_Request_free diff --git a/ompi/mpiext/pcollreq/c/MPIX_Bcast_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Bcast_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Bcast_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Exscan_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Exscan_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Exscan_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Gather_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Gather_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Gather_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Gatherv_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Gatherv_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Gatherv_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Neighbor_allgather_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_allgather_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_allgather_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Neighbor_allgatherv_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_allgatherv_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_allgatherv_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoall_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoall_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoall_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoallv_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoallv_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoallv_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoallw_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoallw_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Neighbor_alltoallw_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Reduce_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Reduce_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Reduce_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Reduce_scatter_block_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Reduce_scatter_block_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Reduce_scatter_block_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Reduce_scatter_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Reduce_scatter_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Reduce_scatter_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Scan_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Scan_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Scan_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Scatter_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Scatter_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Scatter_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/MPIX_Scatterv_init.3in b/ompi/mpiext/pcollreq/c/MPIX_Scatterv_init.3in new file mode 100644 index 0000000000..a9a04748c9 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/MPIX_Scatterv_init.3in @@ -0,0 +1 @@ +.so man3/MPIX_Barrier_init.3 diff --git a/ompi/mpiext/pcollreq/c/Makefile.am b/ompi/mpiext/pcollreq/c/Makefile.am new file mode 100644 index 0000000000..fa38759c8c --- /dev/null +++ b/ompi/mpiext/pcollreq/c/Makefile.am @@ -0,0 +1,63 @@ +# +# 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 + +include $(top_srcdir)/Makefile.ompi-rules + +# 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 + +# Man page installation +nodist_man_MANS = \ + MPIX_Allgather_init.3 \ + MPIX_Allgatherv_init.3 \ + MPIX_Allreduce_init.3 \ + MPIX_Alltoall_init.3 \ + MPIX_Alltoallv_init.3 \ + MPIX_Alltoallw_init.3 \ + MPIX_Barrier_init.3 \ + MPIX_Bcast_init.3 \ + MPIX_Exscan_init.3 \ + MPIX_Gather_init.3 \ + MPIX_Gatherv_init.3 \ + MPIX_Reduce_init.3 \ + MPIX_Reduce_scatter_block_init.3 \ + MPIX_Reduce_scatter_init.3 \ + MPIX_Scan_init.3 \ + MPIX_Scatter_init.3 \ + MPIX_Scatterv_init.3 \ + MPIX_Neighbor_allgather_init.3 \ + MPIX_Neighbor_allgatherv_init.3 \ + MPIX_Neighbor_alltoall_init.3 \ + MPIX_Neighbor_alltoallv_init.3 \ + MPIX_Neighbor_alltoallw_init.3 + +# Man page sources +EXTRA_DIST = $(nodist_man_MANS:.3=.3in) + +distclean-local: + rm -f $(nodist_man_MANS) diff --git a/ompi/mpiext/pcollreq/c/mpiext_pcollreq.c b/ompi/mpiext/pcollreq/c/mpiext_pcollreq.c new file mode 100644 index 0000000000..87a56a25a7 --- /dev/null +++ b/ompi/mpiext/pcollreq/c/mpiext_pcollreq.c @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). 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" + +#include "mpiext_pcollreq_c.h" + +#define INFO_REQ_ARGS ompi_info_t *info, ompi_request_t **request + +int MPIX_Allgather_init(ALLGATHER_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_allgather_init( + ALLGATHER_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_allgather_init_module); +} + +int MPIX_Allgatherv_init(ALLGATHERV_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_allgatherv_init( + ALLGATHERV_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_allgatherv_init_module); +} + +int MPIX_Allreduce_init(ALLREDUCE_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_allreduce_init( + ALLREDUCE_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_allreduce_init_module); +} + +int MPIX_Alltoall_init(ALLTOALL_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_alltoall_init( + ALLTOALL_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_alltoall_init_module); +} + +int MPIX_Alltoallv_init(ALLTOALLV_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_alltoallv_init( + ALLTOALLV_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_alltoallv_init_module); +} + +int MPIX_Alltoallw_init(ALLTOALLW_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_alltoallw_init( + ALLTOALLW_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_alltoallw_init_module); +} + +int MPIX_Barrier_init(BARRIER_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_barrier_init( + BARRIER_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_barrier_init_module); +} + +int MPIX_Bcast_init(BCAST_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_bcast_init( + BCAST_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_bcast_init_module); +} + +int MPIX_Exscan_init(EXSCAN_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_exscan_init( + EXSCAN_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_exscan_init_module); +} + +int MPIX_Gather_init(GATHER_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_gather_init( + GATHER_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_gather_init_module); +} + +int MPIX_Gatherv_init(GATHERV_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_gatherv_init( + GATHERV_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_gatherv_init_module); +} + +int MPIX_Reduce_init(REDUCE_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_reduce_init( + REDUCE_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_reduce_init_module); +} + +int MPIX_Reduce_scatter_init(REDUCESCATTER_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_reduce_scatter_init( + REDUCESCATTER_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_reduce_scatter_init_module); +} + +int MPIX_Reduce_scatter_block_init(REDUCESCATTERBLOCK_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_reduce_scatter_block_init( + REDUCESCATTERBLOCK_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_reduce_scatter_block_init_module); +} + +int MPIX_Scan_init(SCAN_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_scan_init( + SCAN_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_scan_init_module); +} + +int MPIX_Scatter_init(SCATTER_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_scatter_init( + SCATTER_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_scatter_init_module); +} + +int MPIX_Scatterv_init(SCATTERV_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_scatterv_init( + SCATTERV_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_scatterv_init_module); +} + +int MPIX_Neighbor_allgather_init(NEIGHBOR_ALLGATHER_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_neighbor_allgather_init( + NEIGHBOR_ALLGATHER_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_neighbor_allgather_init_module); +} + +int MPIX_Neighbor_allgatherv_init(NEIGHBOR_ALLGATHERV_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_neighbor_allgatherv_init( + NEIGHBOR_ALLGATHERV_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_neighbor_allgatherv_init_module); +} + +int MPIX_Neighbor_alltoall_init(NEIGHBOR_ALLTOALL_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_neighbor_alltoall_init( + NEIGHBOR_ALLTOALL_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_neighbor_alltoall_init_module); +} + +int MPIX_Neighbor_alltoallv_init(NEIGHBOR_ALLTOALLV_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_neighbor_alltoallv_init( + NEIGHBOR_ALLTOALLV_BASE_ARG_NAMES, info, request, + comm->c_coll->coll_neighbor_alltoallv_init_module); +} + +int MPIX_Neighbor_alltoallw_init(NEIGHBOR_ALLTOALLW_BASE_ARGS, INFO_REQ_ARGS) +{ + return comm->c_coll->coll_neighbor_alltoallw_init( + NEIGHBOR_ALLTOALLW_BASE_ARG_NAMES, info, 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 0000000000..7f8944010f --- /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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Barrier_init(MPI_Comm comm, MPI_Info info, MPI_Request *request); +OMPI_DECLSPEC int MPIX_Bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, 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_Info info, MPI_Request *request); diff --git a/ompi/mpiext/pcollreq/configure.m4 b/ompi/mpiext/pcollreq/configure.m4 new file mode 100644 index 0000000000..6d07b9010a --- /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]) +]) From 9a63dacf1c6cd7ab5e012d6686331ebe5ad01cf6 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 13 Dec 2017 16:32:21 +0900 Subject: [PATCH 08/17] mpi: check MPI_Start[all] is invoked on persistent requests and errors otherwise. Signed-off-by: Gilles Gouaillardet --- ompi/mpi/c/start.c | 5 ++++- ompi/mpi/c/startall.c | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ompi/mpi/c/start.c b/ompi/mpi/c/start.c index 0e5478ffc6..fa80a42926 100644 --- a/ompi/mpi/c/start.c +++ b/ompi/mpi/c/start.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ @@ -68,6 +68,9 @@ int MPI_Start(MPI_Request *request) switch((*request)->req_type) { case OMPI_REQUEST_PML: case OMPI_REQUEST_COLL: + if ( MPI_PARAM_CHECK && !(*request)->req_persistent) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST, FUNC_NAME); + } OPAL_CR_ENTER_LIBRARY(); ret = (*request)->req_start(1, request); diff --git a/ompi/mpi/c/startall.c b/ompi/mpi/c/startall.c index 733257d3b4..d87a753c3c 100644 --- a/ompi/mpi/c/startall.c +++ b/ompi/mpi/c/startall.c @@ -13,9 +13,9 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014-2015 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2017-2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -65,6 +65,7 @@ int MPI_Startall(int count, MPI_Request requests[]) } else { for (i = 0; i < count; ++i) { if (NULL == requests[i] || + ! requests[i]->req_persistent || (OMPI_REQUEST_PML != requests[i]->req_type && OMPI_REQUEST_COLL != requests[i]->req_type && OMPI_REQUEST_NOOP != requests[i]->req_type)) { From e72f510daf167d9db9c36876fc342f1009ac13f8 Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 20 Feb 2018 09:52:25 +0900 Subject: [PATCH 09/17] ompi/request: Add `ompi_request_persistent_noop_create` Signed-off-by: KAWASHIMA Takahiro --- ompi/mpi/c/bsend_init.c | 13 +++---------- ompi/mpi/c/recv_init.c | 13 +++---------- ompi/mpi/c/rsend_init.c | 13 +++---------- ompi/mpi/c/send_init.c | 13 +++---------- ompi/mpi/c/ssend_init.c | 13 +++---------- ompi/request/request.c | 26 +++++++++++++++++++++++++- ompi/request/request.h | 12 ++++++------ 7 files changed, 46 insertions(+), 57 deletions(-) diff --git a/ompi/mpi/c/bsend_init.c b/ompi/mpi/c/bsend_init.c index 6b699e5e53..7499cfba1c 100644 --- a/ompi/mpi/c/bsend_init.c +++ b/ompi/mpi/c/bsend_init.c @@ -15,6 +15,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -74,16 +75,8 @@ int MPI_Bsend_init(const void *buf, int count, MPI_Datatype type, } if (MPI_PROC_NULL == dest) { - *request = OBJ_NEW(ompi_request_t); - /* Other fields were initialized by the constructor for - ompi_request_t */ - (*request)->req_type = OMPI_REQUEST_NOOP; - (*request)->req_status = ompi_request_empty.req_status; - (*request)->req_complete = REQUEST_COMPLETED; - (*request)->req_state = OMPI_REQUEST_INACTIVE; - (*request)->req_persistent = true; - (*request)->req_free = ompi_request_persistent_proc_null_free; - return MPI_SUCCESS; + rc = ompi_request_persistent_noop_create(request); + OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } OPAL_CR_ENTER_LIBRARY(); diff --git a/ompi/mpi/c/recv_init.c b/ompi/mpi/c/recv_init.c index f635f30545..109d4e7bac 100644 --- a/ompi/mpi/c/recv_init.c +++ b/ompi/mpi/c/recv_init.c @@ -12,6 +12,7 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -70,16 +71,8 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source, } if (MPI_PROC_NULL == source) { - *request = OBJ_NEW(ompi_request_t); - /* Other fields were initialized by the constructor for - ompi_request_t */ - (*request)->req_type = OMPI_REQUEST_NOOP; - (*request)->req_status = ompi_request_empty.req_status; - (*request)->req_complete = REQUEST_COMPLETED; - (*request)->req_state = OMPI_REQUEST_INACTIVE; - (*request)->req_persistent = true; - (*request)->req_free = ompi_request_persistent_proc_null_free; - return MPI_SUCCESS; + rc = ompi_request_persistent_noop_create(request); + OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } OPAL_CR_ENTER_LIBRARY(); diff --git a/ompi/mpi/c/rsend_init.c b/ompi/mpi/c/rsend_init.c index 0d5e6a2a48..351995d2af 100644 --- a/ompi/mpi/c/rsend_init.c +++ b/ompi/mpi/c/rsend_init.c @@ -15,6 +15,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -75,16 +76,8 @@ int MPI_Rsend_init(const void *buf, int count, MPI_Datatype type, } if (MPI_PROC_NULL == dest) { - *request = OBJ_NEW(ompi_request_t); - /* Other fields were initialized by the constructor for - ompi_request_t */ - (*request)->req_type = OMPI_REQUEST_NOOP; - (*request)->req_status = ompi_request_empty.req_status; - (*request)->req_complete = REQUEST_COMPLETED; - (*request)->req_state = OMPI_REQUEST_INACTIVE; - (*request)->req_persistent = true; - (*request)->req_free = ompi_request_persistent_proc_null_free; - return MPI_SUCCESS; + rc = ompi_request_persistent_noop_create(request); + OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } OPAL_CR_ENTER_LIBRARY(); diff --git a/ompi/mpi/c/send_init.c b/ompi/mpi/c/send_init.c index e9a38ea32d..703a6e7cb4 100644 --- a/ompi/mpi/c/send_init.c +++ b/ompi/mpi/c/send_init.c @@ -15,6 +15,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -75,16 +76,8 @@ int MPI_Send_init(const void *buf, int count, MPI_Datatype type, } if (MPI_PROC_NULL == dest) { - *request = OBJ_NEW(ompi_request_t); - /* Other fields were initialized by the constructor for - ompi_request_t */ - (*request)->req_type = OMPI_REQUEST_NOOP; - (*request)->req_status = ompi_request_empty.req_status; - (*request)->req_complete = REQUEST_COMPLETED; - (*request)->req_state = OMPI_REQUEST_INACTIVE; - (*request)->req_persistent = true; - (*request)->req_free = ompi_request_persistent_proc_null_free; - return MPI_SUCCESS; + rc = ompi_request_persistent_noop_create(request); + OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } OPAL_CR_ENTER_LIBRARY(); diff --git a/ompi/mpi/c/ssend_init.c b/ompi/mpi/c/ssend_init.c index 32486e34ef..15ab4ae1a6 100644 --- a/ompi/mpi/c/ssend_init.c +++ b/ompi/mpi/c/ssend_init.c @@ -15,6 +15,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -75,16 +76,8 @@ int MPI_Ssend_init(const void *buf, int count, MPI_Datatype type, } if (MPI_PROC_NULL == dest) { - *request = OBJ_NEW(ompi_request_t); - /* Other fields were initialized by the constructor for - ompi_request_t */ - (*request)->req_type = OMPI_REQUEST_NOOP; - (*request)->req_status = ompi_request_empty.req_status; - (*request)->req_complete = REQUEST_COMPLETED; - (*request)->req_state = OMPI_REQUEST_INACTIVE; - (*request)->req_persistent = true; - (*request)->req_free = ompi_request_persistent_proc_null_free; - return MPI_SUCCESS; + rc = ompi_request_persistent_noop_create(request); + OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } OPAL_CR_ENTER_LIBRARY(); diff --git a/ompi/request/request.c b/ompi/request/request.c index 6c37008473..a8ddb68ad3 100644 --- a/ompi/request/request.c +++ b/ompi/request/request.c @@ -17,6 +17,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -86,7 +87,7 @@ static int ompi_request_empty_free(ompi_request_t** request) return OMPI_SUCCESS; } -int ompi_request_persistent_proc_null_free(ompi_request_t** request) +static int ompi_request_persistent_noop_free(ompi_request_t** request) { OMPI_REQUEST_FINI(*request); (*request)->req_state = OMPI_REQUEST_INVALID; @@ -185,3 +186,26 @@ int ompi_request_finalize(void) OBJ_DESTRUCT( &ompi_request_f_to_c_table ); return OMPI_SUCCESS; } + + +int ompi_request_persistent_noop_create(ompi_request_t** request) +{ + ompi_request_t *req; + + req = OBJ_NEW(ompi_request_t); + if (NULL == req) { + return OMPI_ERR_OUT_OF_RESOURCE; + } + + /* Other fields were initialized by the constructor for + ompi_request_t */ + req->req_type = OMPI_REQUEST_NOOP; + req->req_status = ompi_request_empty.req_status; + req->req_complete = REQUEST_COMPLETED; + req->req_state = OMPI_REQUEST_INACTIVE; + req->req_persistent = true; + req->req_free = ompi_request_persistent_noop_free; + + *request = req; + return OMPI_SUCCESS; +} diff --git a/ompi/request/request.h b/ompi/request/request.h index 5a1c02c4b6..6460fbe4fa 100644 --- a/ompi/request/request.h +++ b/ompi/request/request.h @@ -15,6 +15,7 @@ * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -348,17 +349,16 @@ OMPI_DECLSPEC extern ompi_request_fns_t ompi_request_functions; */ int ompi_request_init(void); -/** - * Free a persistent request to a MPI_PROC_NULL peer (there's no - * freelist to put it back to, so we have to actually OBJ_RELEASE it). - */ -OMPI_DECLSPEC int ompi_request_persistent_proc_null_free(ompi_request_t **request); - /** * Shut down the MPI_Request subsystem; invoked during MPI_FINALIZE. */ int ompi_request_finalize(void); +/** + * Create a persistent request that does nothing (e.g., to MPI_PROC_NULL). + */ +int ompi_request_persistent_noop_create(ompi_request_t **request); + /** * Cancel a pending request. */ From 8e5690bf5c138366211552ddc2162c57df1afe2f Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 20 Feb 2018 09:52:25 +0900 Subject: [PATCH 10/17] coll/libnbc: Correct persistent request handling Signed-off-by: KAWASHIMA Takahiro --- ompi/mca/coll/libnbc/coll_libnbc.h | 7 ++- ompi/mca/coll/libnbc/coll_libnbc_component.c | 14 +++--- ompi/mca/coll/libnbc/nbc.c | 48 ++++++++++++++----- ompi/mca/coll/libnbc/nbc_iallgather.c | 36 +++++--------- ompi/mca/coll/libnbc/nbc_iallgatherv.c | 33 +++++-------- ompi/mca/coll/libnbc/nbc_iallreduce.c | 38 ++++++--------- ompi/mca/coll/libnbc/nbc_ialltoall.c | 33 +++++-------- ompi/mca/coll/libnbc/nbc_ialltoallv.c | 34 ++++--------- ompi/mca/coll/libnbc/nbc_ialltoallw.c | 36 +++++--------- ompi/mca/coll/libnbc/nbc_ibarrier.c | 31 ++++-------- ompi/mca/coll/libnbc/nbc_ibcast.c | 38 ++++++--------- ompi/mca/coll/libnbc/nbc_iexscan.c | 18 +++---- ompi/mca/coll/libnbc/nbc_igather.c | 33 +++++-------- ompi/mca/coll/libnbc/nbc_igatherv.c | 33 +++++-------- .../mca/coll/libnbc/nbc_ineighbor_allgather.c | 19 ++++---- .../coll/libnbc/nbc_ineighbor_allgatherv.c | 18 +++---- ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c | 19 ++++---- .../mca/coll/libnbc/nbc_ineighbor_alltoallv.c | 18 +++---- .../mca/coll/libnbc/nbc_ineighbor_alltoallw.c | 18 +++---- ompi/mca/coll/libnbc/nbc_internal.h | 18 ++++++- ompi/mca/coll/libnbc/nbc_ireduce.c | 38 ++++++--------- ompi/mca/coll/libnbc/nbc_ireduce_scatter.c | 38 ++++++--------- .../coll/libnbc/nbc_ireduce_scatter_block.c | 37 ++++++-------- ompi/mca/coll/libnbc/nbc_iscan.c | 18 +++---- ompi/mca/coll/libnbc/nbc_iscatter.c | 35 +++++--------- ompi/mca/coll/libnbc/nbc_iscatterv.c | 35 +++++--------- 26 files changed, 296 insertions(+), 447 deletions(-) diff --git a/ompi/mca/coll/libnbc/coll_libnbc.h b/ompi/mca/coll/libnbc/coll_libnbc.h index 5e8a7df5a2..6680b17b57 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc.h +++ b/ompi/mca/coll/libnbc/coll_libnbc.h @@ -16,6 +16,7 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -131,15 +132,13 @@ OBJ_CLASS_DECLARATION(ompi_coll_libnbc_request_t); typedef ompi_coll_libnbc_request_t NBC_Handle; -#define OMPI_COLL_LIBNBC_REQUEST_ALLOC(comm, req) \ +#define OMPI_COLL_LIBNBC_REQUEST_ALLOC(comm, persistent, req) \ do { \ opal_free_list_item_t *item; \ item = opal_free_list_wait (&mca_coll_libnbc_component.requests); \ req = (ompi_coll_libnbc_request_t*) item; \ - OMPI_REQUEST_INIT(&req->super, false); \ + OMPI_REQUEST_INIT(&req->super, persistent); \ req->super.req_mpi_object.comm = comm; \ - req->super.req_complete = false; \ - req->super.req_state = OMPI_REQUEST_INACTIVE; \ } while (0) #define OMPI_COLL_LIBNBC_REQUEST_RETURN(req) \ diff --git a/ompi/mca/coll/libnbc/coll_libnbc_component.c b/ompi/mca/coll/libnbc/coll_libnbc_component.c index 8e01deb9ae..7782e5cfdc 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc_component.c +++ b/ompi/mca/coll/libnbc/coll_libnbc_component.c @@ -18,7 +18,7 @@ * Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2017 Ian Bradley Morgan and Anthony Skjellum. All * rights reserved. - + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -336,6 +336,10 @@ ompi_coll_libnbc_progress(void) else { request->super.req_status.MPI_ERROR = res; } + if(request->super.req_persistent) { + /* reset for the next communication */ + request->row_offset = 0; + } if(!request->super.req_persistent || !REQUEST_COMPLETE(&request->super)) { ompi_request_complete(&request->super, true); } @@ -397,11 +401,8 @@ request_free(struct ompi_request_t **ompi_req) return MPI_ERR_REQUEST; } - if (!request->super.req_persistent) { - OMPI_COLL_LIBNBC_REQUEST_RETURN(request); - - *ompi_req = MPI_REQUEST_NULL; - } + OMPI_COLL_LIBNBC_REQUEST_RETURN(request); + *ompi_req = MPI_REQUEST_NULL; return OMPI_SUCCESS; } @@ -412,6 +413,7 @@ request_construct(ompi_coll_libnbc_request_t *request) { request->super.req_type = OMPI_REQUEST_COLL; request->super.req_status._cancelled = 0; + request->super.req_start = ompi_coll_libnbc_start; request->super.req_free = request_free; request->super.req_cancel = request_cancel; } diff --git a/ompi/mca/coll/libnbc/nbc.c b/ompi/mca/coll/libnbc/nbc.c index fca82a94f5..1e91518a63 100644 --- a/ompi/mca/coll/libnbc/nbc.c +++ b/ompi/mca/coll/libnbc/nbc.c @@ -19,7 +19,10 @@ * Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2017 Ian Bradley Morgan and Anthony Skjellum. All * rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * $COPYRIGHT$ * + * Additional copyrights may follow */ #include "nbc_internal.h" #include "ompi/mca/coll/base/coll_tags.h" @@ -649,12 +652,14 @@ int NBC_Start(NBC_Handle *handle) { if ((ompi_request_t *)handle == &ompi_request_empty) { return OMPI_SUCCESS; } + /* kick off first round */ + handle->super.req_state = OMPI_REQUEST_ACTIVE; res = NBC_Start_round(handle); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - handle->super.req_state = OMPI_REQUEST_ACTIVE; + OPAL_THREAD_LOCK(&mca_coll_libnbc_component.lock); opal_list_append(&mca_coll_libnbc_component.active_requests, &(handle->super.super.super)); OPAL_THREAD_UNLOCK(&mca_coll_libnbc_component.lock); @@ -662,12 +667,37 @@ int NBC_Start(NBC_Handle *handle) { return OMPI_SUCCESS; } -int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, ompi_coll_libnbc_module_t *module, ompi_request_t **request, void *tmpbuf) { - int tmp_tag; +int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, + ompi_coll_libnbc_module_t *module, bool persistent, + ompi_request_t **request, void *tmpbuf) { + int ret, tmp_tag; bool need_register = false; ompi_coll_libnbc_request_t *handle; - OMPI_COLL_LIBNBC_REQUEST_ALLOC(comm, handle); + /* no operation (e.g. one process barrier)? */ + if (((int *)schedule->data)[0] == 0 && schedule->data[sizeof(int)] == 0) { + ret = nbc_get_noop_request(persistent, request); + if (OMPI_SUCCESS != ret) { + return OMPI_ERR_OUT_OF_RESOURCE; + } + + /* update the module->tag here because other processes may have operations + * and they may update the module->tag */ + OPAL_THREAD_LOCK(&module->mutex); + tmp_tag = module->tag--; + if (tmp_tag == MCA_COLL_BASE_TAG_NONBLOCKING_END) { + tmp_tag = module->tag = MCA_COLL_BASE_TAG_NONBLOCKING_BASE; + NBC_DEBUG(2,"resetting tags ...\n"); + } + OPAL_THREAD_UNLOCK(&module->mutex); + + OBJ_RELEASE(schedule); + free(tmpbuf); + + return OMPI_SUCCESS; + } + + OMPI_COLL_LIBNBC_REQUEST_ALLOC(comm, persistent, handle); if (NULL == handle) return OMPI_ERR_OUT_OF_RESOURCE; handle->tmpbuf = NULL; @@ -731,15 +761,6 @@ void NBC_SchedCache_args_delete(void *entry) { } #endif -int NBC_Persist(NBC_Handle *handle) { - - handle->super.req_complete = REQUEST_PENDING; - handle->super.req_start = ompi_coll_libnbc_start; - handle->super.req_persistent = true; - - return OMPI_SUCCESS; -} - static int NBC_Start_internal(NBC_Handle *handle) { /* kick off first round */ @@ -788,6 +809,7 @@ int ompi_coll_libnbc_start(size_t count, ompi_request_t ** request) { NBC_DEBUG(5, "tmpbuf address=%p size=%u\n", handle->tmpbuf, sizeof(handle->tmpbuf)); NBC_DEBUG(5, "--------------------------------\n"); + handle->super.req_complete = REQUEST_PENDING; handle->super.req_state = OMPI_REQUEST_ACTIVE; res = NBC_Start_internal(handle); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_iallgather.c b/ompi/mca/coll/libnbc/nbc_iallgather.c index befb13ae21..999f12d316 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgather.c +++ b/ompi/mca/coll/libnbc/nbc_iallgather.c @@ -10,6 +10,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,7 +46,7 @@ int NBC_Allgather_args_compare(NBC_Allgather_args *a, NBC_Allgather_args *b, voi * each node receives from it's left (modulo p) neighbor */ static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint rcvext; @@ -78,8 +79,7 @@ static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendt } } if (1 == p) { - *request = &ompi_request_empty; - return OMPI_SUCCESS; + return nbc_get_noop_request(persistent, request); } #ifdef NBC_CACHE_SCHEDULE @@ -154,7 +154,7 @@ static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendt } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -168,7 +168,7 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -185,7 +185,7 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype static int nbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext; @@ -231,7 +231,7 @@ static int nbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -244,7 +244,7 @@ int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Da MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_iallgather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -262,35 +262,23 @@ int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Da int ompi_coll_libnbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module); + int res = nbc_iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } int ompi_coll_libnbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module); + int res = nbc_iallgather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_iallgatherv.c b/ompi/mca/coll/libnbc/nbc_iallgatherv.c index a3ee348319..42f7bc4a18 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_iallgatherv.c @@ -14,6 +14,7 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,7 +36,7 @@ * each node receives from node (rank-2)%p recvcounts[(rank+2)%p] elements */ static int nbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res, speer, rpeer; MPI_Aint rcvext; @@ -99,7 +100,7 @@ static int nbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype send return res; } - res = NBC_Schedule_request (schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request (schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -112,7 +113,7 @@ int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatyp MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -129,7 +130,7 @@ int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatyp static int nbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext; @@ -178,7 +179,7 @@ static int nbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatyp return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -191,7 +192,7 @@ int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_D MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_iallgatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -209,35 +210,23 @@ int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_D int ompi_coll_libnbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request, module); + int res = nbc_iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } int ompi_coll_libnbc_allgatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request, module); + int res = nbc_iallgatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_iallreduce.c b/ompi/mca/coll/libnbc/nbc_iallreduce.c index db62b32f55..1f4fe5d71e 100644 --- a/ompi/mca/coll/libnbc/nbc_iallreduce.c +++ b/ompi/mca/coll/libnbc/nbc_iallreduce.c @@ -10,6 +10,7 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -54,7 +55,7 @@ int NBC_Allreduce_args_compare(NBC_Allreduce_args *a, NBC_Allreduce_args *b, voi static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; ptrdiff_t ext, lb; @@ -94,8 +95,7 @@ static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Dat return res; } } - *request = &ompi_request_empty; - return OMPI_SUCCESS; + return nbc_get_noop_request(persistent, request); } span = opal_datatype_span(&datatype->super, count, &gap); @@ -180,7 +180,7 @@ static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Dat } #endif - res = NBC_Schedule_request (schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request (schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -193,7 +193,8 @@ static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Dat int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallreduce(sendbuf, recvbuf, count, datatype, op, comm, request, module); + int res = nbc_iallreduce(sendbuf, recvbuf, count, datatype, op, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -210,7 +211,7 @@ int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, M static int nbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, rsize; size_t size; @@ -262,7 +263,7 @@ static int nbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, M return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -275,7 +276,8 @@ static int nbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, M int ompi_coll_libnbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallreduce_inter(sendbuf, recvbuf, count, datatype, op, comm, request, module); + int res = nbc_iallreduce_inter(sendbuf, recvbuf, count, datatype, op, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -729,36 +731,24 @@ static inline int allred_sched_linear(int rank, int rsize, const void *sendbuf, int ompi_coll_libnbc_allreduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallreduce(sendbuf, recvbuf, count, datatype, op, comm, request, module); + int res = nbc_iallreduce(sendbuf, recvbuf, count, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } int ompi_coll_libnbc_allreduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallreduce_inter(sendbuf, recvbuf, count, datatype, op, comm, request, module); + int res = nbc_iallreduce_inter(sendbuf, recvbuf, count, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ialltoall.c b/ompi/mca/coll/libnbc/nbc_ialltoall.c index d473a8f26c..120bf223ee 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoall.c @@ -11,6 +11,7 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -55,7 +56,7 @@ int NBC_Alltoall_args_compare(NBC_Alltoall_args *a, NBC_Alltoall_args *b, void * /* simple linear MPI_Ialltoall the (simple) algorithm just sends to all nodes */ static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res, datasize; size_t a2asize, sndsize; @@ -264,7 +265,7 @@ static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendty } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -278,7 +279,7 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -295,7 +296,7 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype static int nbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext, rcvext; @@ -349,7 +350,7 @@ static int nbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Datatype return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -362,7 +363,7 @@ int ompi_coll_libnbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Da MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_ialltoall_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -586,35 +587,23 @@ static inline int a2a_sched_inplace(int rank, int p, NBC_Schedule* schedule, voi int ompi_coll_libnbc_alltoall_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module); + int res = nbc_ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } int ompi_coll_libnbc_alltoall_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoall_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module); + int res = nbc_ialltoall_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallv.c b/ompi/mca/coll/libnbc/nbc_ialltoallv.c index f7703be2c2..a27a8a9982 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallv.c @@ -10,6 +10,7 @@ * Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -43,7 +44,7 @@ static inline int a2av_sched_inplace(int rank, int p, NBC_Schedule *schedule, static int nbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint sndext, rcvext; @@ -74,8 +75,7 @@ static int nbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int } span = opal_datatype_span(&recvtype->super, count, &gap); if (OPAL_UNLIKELY(0 == span)) { - *request = &ompi_request_empty; - return MPI_SUCCESS; + return nbc_get_noop_request(persistent, request); } tmpbuf = malloc(span); if (OPAL_UNLIKELY(NULL == tmpbuf)) { @@ -127,7 +127,7 @@ static int nbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -143,7 +143,7 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_ialltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -162,7 +162,7 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons static int nbc_ialltoallv_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext, rcvext; @@ -216,7 +216,7 @@ static int nbc_ialltoallv_inter (const void* sendbuf, const int *sendcounts, con return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -231,7 +231,7 @@ int ompi_coll_libnbc_ialltoallv_inter (const void* sendbuf, const int *sendcount struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_ialltoallv_inter(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -390,18 +390,11 @@ int ompi_coll_libnbc_alltoallv_init(const void* sendbuf, const int *sendcounts, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_ialltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, - comm, request, module); + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } @@ -410,17 +403,10 @@ int ompi_coll_libnbc_alltoallv_inter_init(const void* sendbuf, const int *sendco MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_ialltoallv_inter(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, - comm, request, module); + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallw.c b/ompi/mca/coll/libnbc/nbc_ialltoallw.c index bb85a9a9a1..6ce70e9495 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallw.c @@ -10,6 +10,7 @@ * Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -43,7 +44,7 @@ static inline int a2aw_sched_inplace(int rank, int p, NBC_Schedule *schedule, static int nbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int *sdispls, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; NBC_Schedule *schedule; @@ -67,8 +68,7 @@ static int nbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int } } if (OPAL_UNLIKELY(0 == span)) { - *request = &ompi_request_empty; - return OMPI_SUCCESS; + return nbc_get_noop_request(persistent, request); } tmpbuf = malloc(span); if (OPAL_UNLIKELY(NULL == tmpbuf)) { @@ -113,7 +113,7 @@ static int nbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -129,7 +129,7 @@ int ompi_coll_libnbc_ialltoallw(const void* sendbuf, const int *sendcounts, cons struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -148,7 +148,7 @@ int ompi_coll_libnbc_ialltoallw(const void* sendbuf, const int *sendcounts, cons static int nbc_ialltoallw_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; NBC_Schedule *schedule; @@ -189,7 +189,7 @@ static int nbc_ialltoallw_inter (const void* sendbuf, const int *sendcounts, con return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -204,7 +204,7 @@ int ompi_coll_libnbc_ialltoallw_inter(const void* sendbuf, const int *sendcounts struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_ialltoallw_inter(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -363,18 +363,12 @@ int ompi_coll_libnbc_alltoallw_init(const void* sendbuf, const int *sendcounts, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, request, module); + int res = nbc_ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } @@ -382,17 +376,11 @@ int ompi_coll_libnbc_alltoallw_inter_init(const void* sendbuf, const int *sendco struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallw_inter(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, request, module); + int res = nbc_ialltoallw_inter(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ibarrier.c b/ompi/mca/coll/libnbc/nbc_ibarrier.c index c146c1140c..b3291b0ba5 100644 --- a/ompi/mca/coll/libnbc/nbc_ibarrier.c +++ b/ompi/mca/coll/libnbc/nbc_ibarrier.c @@ -11,6 +11,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Mellanox Technologies. All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -22,7 +23,7 @@ /* Dissemination implementation of MPI_Ibarrier */ static int nbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, maxround, res, recvpeer, sendpeer; NBC_Schedule *schedule; @@ -89,7 +90,7 @@ static int nbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** requ OBJ_RETAIN(schedule); #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -100,7 +101,7 @@ static int nbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** requ int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibarrier(comm, request, module); + int res = nbc_ibarrier(comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -116,7 +117,7 @@ int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t * } static int nbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, rsize; NBC_Schedule *schedule; @@ -177,7 +178,7 @@ static int nbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t * return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -187,7 +188,7 @@ static int nbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t * int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibarrier_inter(comm, request, module); + int res = nbc_ibarrier_inter(comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -204,34 +205,20 @@ int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_reque int ompi_coll_libnbc_barrier_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibarrier(comm, request, module); + int res = nbc_ibarrier(comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } int ompi_coll_libnbc_barrier_inter_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibarrier_inter(comm, request, module); + int res = nbc_ibarrier_inter(comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ibcast.c b/ompi/mca/coll/libnbc/nbc_ibcast.c index df3f6e3407..f8795192c3 100644 --- a/ompi/mca/coll/libnbc/nbc_ibcast.c +++ b/ompi/mca/coll/libnbc/nbc_ibcast.c @@ -10,6 +10,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -46,7 +47,7 @@ int NBC_Bcast_args_compare(NBC_Bcast_args *a, NBC_Bcast_args *b, void *param) { static int nbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res, segsize; size_t size; @@ -61,8 +62,7 @@ static int nbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root, p = ompi_comm_size (comm); if (1 == p) { - *request = &ompi_request_empty; - return OMPI_SUCCESS; + return nbc_get_noop_request(persistent, request); } res = ompi_datatype_type_size(datatype, &size); @@ -162,7 +162,7 @@ static int nbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root, } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -175,7 +175,8 @@ int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibcast(buffer, count, datatype, root, comm, request, module); + int res = nbc_ibcast(buffer, count, datatype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -343,7 +344,7 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch static int nbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res; NBC_Schedule *schedule; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -384,7 +385,7 @@ static int nbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -396,7 +397,8 @@ static int nbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibcast_inter(buffer, count, datatype, root, comm, request, module); + int res = nbc_ibcast_inter(buffer, count, datatype, root, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -414,35 +416,23 @@ int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype int ompi_coll_libnbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibcast(buffer, count, datatype, root, comm, request, module); + int res = nbc_ibcast(buffer, count, datatype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } int ompi_coll_libnbc_bcast_inter_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibcast_inter(buffer, count, datatype, root, comm, request, module); + int res = nbc_ibcast_inter(buffer, count, datatype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_iexscan.c b/ompi/mca/coll/libnbc/nbc_iexscan.c index fd23346e50..6313f8a161 100644 --- a/ompi/mca/coll/libnbc/nbc_iexscan.c +++ b/ompi/mca/coll/libnbc/nbc_iexscan.c @@ -10,6 +10,7 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -47,7 +48,7 @@ int NBC_Scan_args_compare(NBC_Scan_args *a, NBC_Scan_args *b, void *param) { */ static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; ptrdiff_t gap, span; NBC_Schedule *schedule; @@ -182,7 +183,7 @@ static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Dataty } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -195,7 +196,8 @@ static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Dataty int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iexscan(sendbuf, recvbuf, count, datatype, op, comm, request, module); + int res = nbc_iexscan(sendbuf, recvbuf, count, datatype, op, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -213,17 +215,11 @@ int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_ int ompi_coll_libnbc_exscan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iexscan(sendbuf, recvbuf, count, datatype, op, comm, request, module); + int res = nbc_iexscan(sendbuf, recvbuf, count, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_igather.c b/ompi/mca/coll/libnbc/nbc_igather.c index 108f14ecee..13802e0b8b 100644 --- a/ompi/mca/coll/libnbc/nbc_igather.c +++ b/ompi/mca/coll/libnbc/nbc_igather.c @@ -13,6 +13,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -46,7 +47,7 @@ int NBC_Gather_args_compare(NBC_Gather_args *a, NBC_Gather_args *b, void *param) static int nbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -160,7 +161,7 @@ static int nbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -174,7 +175,7 @@ int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype se struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -192,7 +193,7 @@ int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype se static int nbc_igather_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -240,7 +241,7 @@ static int nbc_igather_inter (const void* sendbuf, int sendcount, MPI_Datatype s return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -254,7 +255,7 @@ int ompi_coll_libnbc_igather_inter(const void* sendbuf, int sendcount, MPI_Datat struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_igather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -273,18 +274,12 @@ int ompi_coll_libnbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatyp int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } @@ -292,17 +287,11 @@ int ompi_coll_libnbc_gather_inter_init(const void* sendbuf, int sendcount, MPI_D int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_igather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_igatherv.c b/ompi/mca/coll/libnbc/nbc_igatherv.c index eb908cf3b3..bc3880ab9f 100644 --- a/ompi/mca/coll/libnbc/nbc_igatherv.c +++ b/ompi/mca/coll/libnbc/nbc_igatherv.c @@ -14,6 +14,7 @@ * reserved. * Copyright (c) 2015 Mellanox Technologies. All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,7 +32,7 @@ static int nbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -95,7 +96,7 @@ static int nbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtyp return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -109,7 +110,7 @@ int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype s int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -127,7 +128,7 @@ int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype s static int nbc_igatherv_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext; NBC_Schedule *schedule; @@ -175,7 +176,7 @@ static int nbc_igatherv_inter (const void* sendbuf, int sendcount, MPI_Datatype return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -189,7 +190,7 @@ int ompi_coll_libnbc_igatherv_inter(const void* sendbuf, int sendcount, MPI_Data int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { int res = nbc_igatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, - comm, request, module); + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -208,18 +209,12 @@ int ompi_coll_libnbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Dataty void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request, module); + int res = nbc_igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } @@ -227,17 +222,11 @@ int ompi_coll_libnbc_gatherv_inter_init(const void* sendbuf, int sendcount, MPI_ void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request, module); + int res = nbc_igatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c index cf6db001c9..1875229d21 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c @@ -10,6 +10,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,7 +46,8 @@ int NBC_Ineighbor_allgather_args_compare(NBC_Ineighbor_allgather_args *a, NBC_In static int nbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -152,7 +154,7 @@ static int nbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype st } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -164,7 +166,8 @@ static int nbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype st int ompi_coll_libnbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_allgather(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module); + int res = nbc_ineighbor_allgather(sbuf, scount, stype, rbuf, rcount, rtype, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -333,17 +336,11 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch int ompi_coll_libnbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_allgather(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module); + int res = nbc_ineighbor_allgather(sbuf, scount, stype, rbuf, rcount, rtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c index 1d9817e038..f974d4522a 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c @@ -10,6 +10,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -46,7 +47,7 @@ int NBC_Ineighbor_allgatherv_args_compare(NBC_Ineighbor_allgatherv_args *a, NBC_ static int nbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -154,7 +155,7 @@ static int nbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Datatype s } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -167,7 +168,8 @@ int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Data const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_allgatherv(sbuf, scount, stype, rbuf, rcounts, displs, rtype, comm, request, module); + int res = nbc_ineighbor_allgatherv(sbuf, scount, stype, rbuf, rcounts, displs, rtype, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -185,17 +187,11 @@ int ompi_coll_libnbc_neighbor_allgatherv_init(const void *sbuf, int scount, MPI_ const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_allgatherv(sbuf, scount, stype, rbuf, rcounts, displs, rtype, comm, request, module); + int res = nbc_ineighbor_allgatherv(sbuf, scount, stype, rbuf, rcounts, displs, rtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c index 4a8962fa33..7172233982 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c @@ -10,6 +10,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -42,7 +43,8 @@ int NBC_Ineighbor_alltoall_args_compare(NBC_Ineighbor_alltoall_args *a, NBC_Inei static int nbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint sndext, rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -156,7 +158,7 @@ static int nbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype sty } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -168,7 +170,8 @@ static int nbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype sty int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoall(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module); + int res = nbc_ineighbor_alltoall(sbuf, scount, stype, rbuf, rcount, rtype, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -185,17 +188,11 @@ int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Dataty int ompi_coll_libnbc_neighbor_alltoall_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoall(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module); + int res = nbc_ineighbor_alltoall(sbuf, scount, stype, rbuf, rcount, rtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c index d2b6dc21aa..1dbb43779b 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c @@ -10,6 +10,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -46,7 +47,7 @@ int NBC_Ineighbor_alltoallv_args_compare(NBC_Ineighbor_alltoallv_args *a, NBC_In static int nbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint sndext, rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -161,7 +162,7 @@ static int nbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, const i } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -174,7 +175,8 @@ int ompi_coll_libnbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, c void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoallv(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, comm, request, module); + int res = nbc_ineighbor_alltoallv(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -192,17 +194,11 @@ int ompi_coll_libnbc_neighbor_alltoallv_init(const void *sbuf, const int *scount void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoallv(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, comm, request, module); + int res = nbc_ineighbor_alltoallv(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c index 67cf5bc785..b8ea53652f 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c @@ -10,6 +10,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,7 +46,7 @@ int NBC_Ineighbor_alltoallw_args_compare(NBC_Ineighbor_alltoallw_args *a, NBC_In static int nbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; NBC_Schedule *schedule; @@ -146,7 +147,7 @@ static int nbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, const M } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -159,7 +160,8 @@ int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, c void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoallw(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, comm, request, module); + int res = nbc_ineighbor_alltoallw(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -177,17 +179,11 @@ int ompi_coll_libnbc_neighbor_alltoallw_init(const void *sbuf, const int *scount void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoallw(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, comm, request, module); + int res = nbc_ineighbor_alltoallw(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_internal.h b/ompi/mca/coll/libnbc/nbc_internal.h index 5eac0f7d34..dc085f0293 100644 --- a/ompi/mca/coll/libnbc/nbc_internal.h +++ b/ompi/mca/coll/libnbc/nbc_internal.h @@ -14,7 +14,10 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. + * $COPYRIGHT$ * + * Additional copyrights may follow */ #ifndef __NBC_INTERNAL_H__ #define __NBC_INTERNAL_H__ @@ -260,8 +263,9 @@ void NBC_SchedCache_args_delete_key_dummy(void *k); int NBC_Start(NBC_Handle *handle); -int NBC_Persist(NBC_Handle *handle); -int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, ompi_coll_libnbc_module_t *module, ompi_request_t **request, void *tmpbuf); +int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, + ompi_coll_libnbc_module_t *module, bool persistent, + ompi_request_t **request, void *tmpbuf); void NBC_Return_handle(ompi_coll_libnbc_request_t *request); static inline int NBC_Type_intrinsic(MPI_Datatype type); int NBC_Create_fortran_handle(int *fhandle, NBC_Handle **handle); @@ -365,6 +369,16 @@ static inline void nbc_schedule_inc_round (NBC_Schedule *schedule) { memcpy (lastround, &last_round_num, sizeof (last_round_num)); } +/* returns a no-operation request (e.g. for one process barrier) */ +static inline int nbc_get_noop_request(bool persistent, ompi_request_t **request) { + if (persistent) { + return ompi_request_persistent_noop_create(request); + } else { + *request = &ompi_request_empty; + return OMPI_SUCCESS; + } +} + /* NBC_PRINT_ROUND prints a round in a schedule. A round has the format: * [num]{[type][type-args]} types: [int]{[enum][args-type]} * e.g. [2][SEND][SEND-ARGS][RECV][RECV-ARGS] */ diff --git a/ompi/mca/coll/libnbc/nbc_ireduce.c b/ompi/mca/coll/libnbc/nbc_ireduce.c index f4a161ac21..7f74a37125 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce.c @@ -10,6 +10,7 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -54,7 +55,7 @@ int NBC_Reduce_args_compare(NBC_Reduce_args *a, NBC_Reduce_args *b, void *param) /* the non-blocking reduce */ static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res, segsize; size_t size; MPI_Aint ext; @@ -91,8 +92,7 @@ static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Dataty return res; } } - *request = &ompi_request_empty; - return OMPI_SUCCESS; + return nbc_get_noop_request(persistent, request); } span = opal_datatype_span(&datatype->super, count, &gap); @@ -193,7 +193,7 @@ static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Dataty } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -206,7 +206,8 @@ static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Dataty int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, request, module); + int res = nbc_ireduce(sendbuf, recvbuf, count, datatype, op, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -222,7 +223,7 @@ int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_ static int nbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, rsize; NBC_Schedule *schedule; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -258,7 +259,7 @@ static int nbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_ return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -271,7 +272,8 @@ static int nbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_ int ompi_coll_libnbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, comm, request, module); + int res = nbc_ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -554,35 +556,23 @@ static inline int red_sched_linear (int rank, int rsize, int root, const void *s int ompi_coll_libnbc_reduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, request, module); + int res = nbc_ireduce(sendbuf, recvbuf, count, datatype, op, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } int ompi_coll_libnbc_reduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, comm, request, module); + int res = nbc_ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c index 589beda2e0..b9025c2493 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c @@ -13,6 +13,7 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -43,7 +44,7 @@ static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int peer, rank, maxr, p, res, count; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -78,8 +79,7 @@ static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *re } } - *request = &ompi_request_empty; - return OMPI_SUCCESS; + return nbc_get_noop_request(persistent, request); } maxr = (int) ceil ((log((double) p) / LOG2)); @@ -193,7 +193,7 @@ static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *re return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -206,7 +206,8 @@ static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *re int ompi_coll_libnbc_ireduce_scatter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module); + int res = nbc_ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -221,7 +222,7 @@ int ompi_coll_libnbc_ireduce_scatter (const void* sendbuf, void* recvbuf, const } static int nbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, count, lsize, rsize; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -334,7 +335,7 @@ static int nbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -347,7 +348,8 @@ static int nbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_inter(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module); + int res = nbc_ireduce_scatter_inter(sendbuf, recvbuf, recvcounts, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -364,35 +366,23 @@ int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, int ompi_coll_libnbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module); + int res = nbc_ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } int ompi_coll_libnbc_reduce_scatter_inter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_inter(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module); + int res = nbc_ireduce_scatter_inter(sendbuf, recvbuf, recvcounts, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c index 1702123ab8..cde6bd914e 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c @@ -11,6 +11,7 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -41,7 +42,7 @@ static int nbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int peer, rank, maxr, p, res, count; MPI_Aint ext; ptrdiff_t gap, span; @@ -195,7 +196,7 @@ static int nbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int rec return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -208,7 +209,8 @@ static int nbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int rec int ompi_coll_libnbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module); + int res = nbc_ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -223,8 +225,8 @@ int ompi_coll_libnbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, i } static int nbc_ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, int rcount, struct ompi_datatype_t *dtype, - struct ompi_op_t *op, struct ompi_communicator_t *comm, - ompi_request_t **request, struct mca_coll_base_module_2_2_0_t *module) { + struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, count, lsize, rsize; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -333,7 +335,7 @@ static int nbc_ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, i return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -346,7 +348,8 @@ static int nbc_ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, i int ompi_coll_libnbc_ireduce_scatter_block_inter(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module); + int res = nbc_ireduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -363,35 +366,23 @@ int ompi_coll_libnbc_ireduce_scatter_block_inter(const void* sendbuf, void* recv int ompi_coll_libnbc_reduce_scatter_block_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module); + int res = nbc_ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } int ompi_coll_libnbc_reduce_scatter_block_inter_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module); + int res = nbc_ireduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_iscan.c b/ompi/mca/coll/libnbc/nbc_iscan.c index 144a338a51..a2fdd9aac6 100644 --- a/ompi/mca/coll/libnbc/nbc_iscan.c +++ b/ompi/mca/coll/libnbc/nbc_iscan.c @@ -10,6 +10,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -47,7 +48,7 @@ int NBC_Scan_args_compare(NBC_Scan_args *a, NBC_Scan_args *b, void *param) { */ static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; ptrdiff_t gap, span; NBC_Schedule *schedule; @@ -159,7 +160,7 @@ static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, tmpbuf); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, tmpbuf); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); free(tmpbuf); @@ -172,7 +173,8 @@ static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscan(sendbuf, recvbuf, count, datatype, op, comm, request, module); + int res = nbc_iscan(sendbuf, recvbuf, count, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -189,17 +191,11 @@ int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Da int ompi_coll_libnbc_scan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscan(sendbuf, recvbuf, count, datatype, op, comm, request, module); + int res = nbc_iscan(sendbuf, recvbuf, count, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_iscatter.c b/ompi/mca/coll/libnbc/nbc_iscatter.c index 895860008c..dda22a3827 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatter.c +++ b/ompi/mca/coll/libnbc/nbc_iscatter.c @@ -13,6 +13,7 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -47,7 +48,7 @@ int NBC_Scatter_args_compare(NBC_Scatter_args *a, NBC_Scatter_args *b, void *par static int nbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint sndext = 0; NBC_Schedule *schedule; @@ -157,7 +158,7 @@ static int nbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendty } #endif - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -170,7 +171,8 @@ int ompi_coll_libnbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -187,7 +189,7 @@ int ompi_coll_libnbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype static int nbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext; NBC_Schedule *schedule; @@ -235,7 +237,7 @@ static int nbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Datatype return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -248,7 +250,8 @@ int ompi_coll_libnbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Dat void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatter_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_iscatter_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -266,18 +269,12 @@ int ompi_coll_libnbc_scatter_init(const void* sendbuf, int sendcount, MPI_Dataty void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } @@ -285,17 +282,11 @@ int ompi_coll_libnbc_scatter_inter_init(const void* sendbuf, int sendcount, MPI_ void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatter_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_iscatter_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/libnbc/nbc_iscatterv.c b/ompi/mca/coll/libnbc/nbc_iscatterv.c index cf6ccfed0c..08faacb18e 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatterv.c +++ b/ompi/mca/coll/libnbc/nbc_iscatterv.c @@ -13,6 +13,7 @@ * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -30,7 +31,7 @@ static int nbc_iscatterv(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint sndext; NBC_Schedule *schedule; @@ -92,7 +93,7 @@ static int nbc_iscatterv(const void* sendbuf, const int *sendcounts, const int * return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -105,7 +106,8 @@ int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -122,7 +124,7 @@ int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const static int nbc_iscatterv_inter (const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext; NBC_Schedule *schedule; @@ -169,7 +171,7 @@ static int nbc_iscatterv_inter (const void* sendbuf, const int *sendcounts, cons return res; } - res = NBC_Schedule_request(schedule, comm, libnbc_module, request, NULL); + res = NBC_Schedule_request(schedule, comm, libnbc_module, persistent, request, NULL); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; @@ -182,7 +184,8 @@ int ompi_coll_libnbc_iscatterv_inter(const void* sendbuf, const int *sendcounts, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatterv_inter(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_iscatterv_inter(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -200,18 +203,12 @@ int ompi_coll_libnbc_scatterv_init(const void* sendbuf, const int *sendcounts, c void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } @@ -219,17 +216,11 @@ int ompi_coll_libnbc_scatterv_inter_init(const void* sendbuf, const int *sendcou void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatterv_inter(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module); + int res = nbc_iscatterv_inter(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } - res = NBC_Persist(*(ompi_coll_libnbc_request_t **)request); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle ((ompi_coll_libnbc_request_t *)request); - *request = &ompi_request_null.request; - return res; - } - return OMPI_SUCCESS; } From 5c5de3a4fbdb106e544c484863a98224536d1e8a Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 20 Feb 2018 09:52:25 +0900 Subject: [PATCH 11/17] coll/libnbc: Fix handling of completed request Because a persistent reuqest does not free its `schedule` object when the communication completes, the `NBC_Progress` function cannot determine the completion using `schedule`. Without this change, a hang occurs when the `NBC_Progress` function is called recursively through the `NBC_Start_round` function. Signed-off-by: KAWASHIMA Takahiro --- ompi/mca/coll/libnbc/coll_libnbc.h | 1 + ompi/mca/coll/libnbc/nbc.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ompi/mca/coll/libnbc/coll_libnbc.h b/ompi/mca/coll/libnbc/coll_libnbc.h index 6680b17b57..88f59d424d 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc.h +++ b/ompi/mca/coll/libnbc/coll_libnbc.h @@ -117,6 +117,7 @@ struct ompi_coll_libnbc_request_t { ompi_request_t super; MPI_Comm comm; long row_offset; + bool nbc_complete; /* status in libnbc level */ int tag; volatile int req_count; ompi_request_t **req_array; diff --git a/ompi/mca/coll/libnbc/nbc.c b/ompi/mca/coll/libnbc/nbc.c index 1e91518a63..1d5f90ce77 100644 --- a/ompi/mca/coll/libnbc/nbc.c +++ b/ompi/mca/coll/libnbc/nbc.c @@ -321,8 +321,7 @@ int NBC_Progress(NBC_Handle *handle) { int i; ompi_status_public_t status; - /* the handle is done if there is no schedule attached */ - if (NULL == handle->schedule) { + if (handle->nbc_complete) { return NBC_OK; } @@ -388,8 +387,9 @@ int NBC_Progress(NBC_Handle *handle) { /* this was the last round - we're done */ NBC_DEBUG(5, "NBC_Progress last round finished - we're done\n"); + handle->nbc_complete = true; if (!handle->super.req_persistent) { - NBC_Free(handle); + NBC_Free(handle); } return NBC_OK; @@ -706,6 +706,7 @@ int NBC_Schedule_request(NBC_Schedule *schedule, ompi_communicator_t *comm, handle->comm = comm; handle->schedule = NULL; handle->row_offset = 0; + handle->nbc_complete = persistent ? true : false; /******************** Do the tag and shadow comm administration ... ***************/ @@ -811,6 +812,7 @@ int ompi_coll_libnbc_start(size_t count, ompi_request_t ** request) { handle->super.req_complete = REQUEST_PENDING; handle->super.req_state = OMPI_REQUEST_ACTIVE; + handle->nbc_complete = false; res = NBC_Start_internal(handle); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { NBC_DEBUG(5, " ** bad result from NBC_Start_internal **\n"); From ed0144bad4743594f2c84a4b71d91c633df0e1cc Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 20 Feb 2018 09:52:25 +0900 Subject: [PATCH 12/17] coll/libnbc: Adapt local copy for persistent request `NBC_Copy` shoud not be called in `MPI_*_INIT`. `NBC_Sched_copy` should be called instead. Signed-off-by: KAWASHIMA Takahiro --- ompi/mca/coll/libnbc/nbc_iallgather.c | 15 ++++++-- ompi/mca/coll/libnbc/nbc_iallgatherv.c | 12 ++++++- ompi/mca/coll/libnbc/nbc_iallreduce.c | 25 ++++++++----- ompi/mca/coll/libnbc/nbc_ialltoall.c | 23 ++++++------ ompi/mca/coll/libnbc/nbc_ialltoallv.c | 19 +++++----- ompi/mca/coll/libnbc/nbc_ialltoallw.c | 17 +++++---- ompi/mca/coll/libnbc/nbc_iexscan.c | 35 ++++++++++--------- ompi/mca/coll/libnbc/nbc_igather.c | 19 +++++----- ompi/mca/coll/libnbc/nbc_igatherv.c | 4 +-- ompi/mca/coll/libnbc/nbc_ireduce.c | 25 ++++++++----- ompi/mca/coll/libnbc/nbc_ireduce_scatter.c | 12 +++++-- .../coll/libnbc/nbc_ireduce_scatter_block.c | 3 +- ompi/mca/coll/libnbc/nbc_iscan.c | 18 +++++----- ompi/mca/coll/libnbc/nbc_iscatter.c | 21 +++++------ ompi/mca/coll/libnbc/nbc_iscatterv.c | 3 +- 15 files changed, 155 insertions(+), 96 deletions(-) diff --git a/ompi/mca/coll/libnbc/nbc_iallgather.c b/ompi/mca/coll/libnbc/nbc_iallgather.c index 999f12d316..4b9f2224a0 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgather.c +++ b/ompi/mca/coll/libnbc/nbc_iallgather.c @@ -70,7 +70,7 @@ static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendt if (inplace) { sendtype = recvtype; sendcount = recvcount; - } else { + } else if (!persistent) { /* for persistent, the copy must be scheduled */ /* copy my data to receive buffer */ rbuf = (char *) recvbuf + rank * recvcount * rcvext; res = NBC_Copy (sendbuf, sendcount, sendtype, rbuf, recvcount, recvtype, comm); @@ -78,7 +78,7 @@ static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendt return res; } } - if (1 == p) { + if (1 == p && (!persistent || inplace)) { return nbc_get_noop_request(persistent, request); } @@ -99,6 +99,17 @@ static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendt } sbuf = (char *)recvbuf + rank * recvcount * rcvext; + + if (persistent && !inplace) { /* for nonblocking, data has been copied already */ + /* copy my data to receive buffer (= send buffer of NBC_Sched_send) */ + res = NBC_Sched_copy ((void *)sendbuf, false, sendcount, sendtype, + sbuf, false, recvcount, recvtype, schedule, true); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + OBJ_RELEASE(schedule); + return res; + } + } + /* do p-1 rounds */ for(int r = 0 ; r < p ; ++r) { if(r != rank) { diff --git a/ompi/mca/coll/libnbc/nbc_iallgatherv.c b/ompi/mca/coll/libnbc/nbc_iallgatherv.c index 42f7bc4a18..dbfc4328a0 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_iallgatherv.c @@ -58,7 +58,7 @@ static int nbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype send if (inplace) { sendtype = recvtype; sendcount = recvcounts[rank]; - } else { + } else if (!persistent) { /* for persistent, the copy must be scheduled */ /* copy my data to receive buffer */ rbuf = (char *) recvbuf + displs[rank] * rcvext; res = NBC_Copy (sendbuf, sendcount, sendtype, rbuf, recvcounts[rank], recvtype, comm); @@ -74,6 +74,16 @@ static int nbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype send sbuf = (char *) recvbuf + displs[rank] * rcvext; + if (persistent && !inplace) { /* for nonblocking, data has been copied already */ + /* copy my data to receive buffer (= send buffer of NBC_Sched_send) */ + res = NBC_Sched_copy ((void *)sendbuf, false, sendcount, sendtype, + sbuf, false, recvcounts[rank], recvtype, schedule, true); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + OBJ_RELEASE(schedule); + return res; + } + } + /* do p-1 rounds */ for (int r = 1 ; r < p ; ++r) { speer = (rank + r) % p; diff --git a/ompi/mca/coll/libnbc/nbc_iallreduce.c b/ompi/mca/coll/libnbc/nbc_iallreduce.c index 1f4fe5d71e..b37eb4ee17 100644 --- a/ompi/mca/coll/libnbc/nbc_iallreduce.c +++ b/ompi/mca/coll/libnbc/nbc_iallreduce.c @@ -87,7 +87,7 @@ static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Dat return res; } - if (1 == p) { + if (1 == p && (!persistent || inplace)) { if (!inplace) { /* for a single node - copy data to receivebuf */ res = NBC_Copy(sendbuf, count, datatype, recvbuf, count, datatype, comm); @@ -127,13 +127,18 @@ static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Dat return OMPI_ERR_OUT_OF_RESOURCE; } - switch(alg) { - case NBC_ARED_BINOMIAL: - res = allred_sched_diss(rank, p, count, datatype, gap, sendbuf, recvbuf, op, inplace, schedule, tmpbuf); - break; - case NBC_ARED_RING: - res = allred_sched_ring(rank, p, count, datatype, sendbuf, recvbuf, op, size, ext, schedule, tmpbuf); - break; + if (p == 1) { + res = NBC_Sched_copy((void *)sendbuf, false, count, datatype, + recvbuf, false, count, datatype, schedule, false); + } else { + switch(alg) { + case NBC_ARED_BINOMIAL: + res = allred_sched_diss(rank, p, count, datatype, gap, sendbuf, recvbuf, op, inplace, schedule, tmpbuf); + break; + case NBC_ARED_RING: + res = allred_sched_ring(rank, p, count, datatype, sendbuf, recvbuf, op, size, ext, schedule, tmpbuf); + break; + } } if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -348,7 +353,9 @@ static inline int allred_sched_diss(int rank, int p, int count, MPI_Datatype dat rbuf = recvbuf; tmprbuf = false; if (inplace) { - res = NBC_Copy(rbuf, count, datatype, ((char *)tmpbuf) - gap, count, datatype, MPI_COMM_SELF); + res = NBC_Sched_copy(rbuf, false, count, datatype, + ((char *)tmpbuf) - gap, false, count, datatype, + schedule, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ialltoall.c b/ompi/mca/coll/libnbc/nbc_ialltoall.c index 120bf223ee..834ce51c09 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoall.c @@ -110,16 +110,6 @@ static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendty } else alg = NBC_A2A_LINEAR; /*NBC_A2A_PAIRWISE;*/ - if (!inplace) { - /* copy my data to receive buffer */ - rbuf = (char *) recvbuf + rank * recvcount * rcvext; - sbuf = (char *) sendbuf + rank * sendcount * sndext; - res = NBC_Copy (sbuf, sendcount, sendtype, rbuf, recvcount, recvtype, comm); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - /* allocate temp buffer if we need one */ if (alg == NBC_A2A_INPLACE) { span = opal_datatype_span(&recvtype->super, recvcount, &gap); @@ -205,6 +195,19 @@ static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendty return OMPI_ERR_OUT_OF_RESOURCE; } + if (!inplace) { + /* copy my data to receive buffer */ + rbuf = (char *) recvbuf + rank * recvcount * rcvext; + sbuf = (char *) sendbuf + rank * sendcount * sndext; + res = NBC_Sched_copy (sbuf, false, sendcount, sendtype, + rbuf, false, recvcount, recvtype, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + OBJ_RELEASE(schedule); + free(tmpbuf); + return res; + } + } + switch(alg) { case NBC_A2A_INPLACE: res = a2a_sched_inplace(rank, p, schedule, recvbuf, recvcount, recvtype, rcvext, gap, comm); diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallv.c b/ompi/mca/coll/libnbc/nbc_ialltoallv.c index a27a8a9982..ce036dafe0 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallv.c @@ -89,14 +89,6 @@ static int nbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res); return res; } - if (sendcounts[rank] != 0) { - rbuf = (char *) recvbuf + rdispls[rank] * rcvext; - sbuf = (char *) sendbuf + sdispls[rank] * sndext; - res = NBC_Copy (sbuf, sendcounts[rank], sendtype, rbuf, recvcounts[rank], recvtype, comm); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } } schedule = OBJ_NEW(NBC_Schedule); @@ -106,6 +98,17 @@ static int nbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int } + if (!inplace && sendcounts[rank] != 0) { + rbuf = (char *) recvbuf + rdispls[rank] * rcvext; + sbuf = (char *) sendbuf + sdispls[rank] * sndext; + res = NBC_Sched_copy (sbuf, false, sendcounts[rank], sendtype, + rbuf, false, recvcounts[rank], recvtype, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + OBJ_RELEASE(schedule); + return res; + } + } + if (inplace) { res = a2av_sched_inplace(rank, p, schedule, recvbuf, recvcounts, rdispls, rcvext, recvtype, gap); diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallw.c b/ompi/mca/coll/libnbc/nbc_ialltoallw.c index 6ce70e9495..de94206c41 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallw.c @@ -77,13 +77,6 @@ static int nbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int sendcounts = recvcounts; sdispls = rdispls; sendtypes = recvtypes; - } else if (sendcounts[rank] != 0) { - rbuf = (char *) recvbuf + rdispls[rank]; - sbuf = (char *) sendbuf + sdispls[rank]; - res = NBC_Copy(sbuf, sendcounts[rank], sendtypes[rank], rbuf, recvcounts[rank], recvtypes[rank], comm); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } } schedule = OBJ_NEW(NBC_Schedule); @@ -92,6 +85,16 @@ static int nbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int return OMPI_ERR_OUT_OF_RESOURCE; } + if (!inplace && sendcounts[rank] != 0) { + rbuf = (char *) recvbuf + rdispls[rank]; + sbuf = (char *) sendbuf + sdispls[rank]; + res = NBC_Sched_copy(sbuf, false, sendcounts[rank], sendtypes[rank], + rbuf, false, recvcounts[rank], recvtypes[rank], schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } + } + if (inplace) { res = a2aw_sched_inplace(rank, p, schedule, recvbuf, recvcounts, rdispls, recvtypes); diff --git a/ompi/mca/coll/libnbc/nbc_iexscan.c b/ompi/mca/coll/libnbc/nbc_iexscan.c index 6313f8a161..faad1e6a6b 100644 --- a/ompi/mca/coll/libnbc/nbc_iexscan.c +++ b/ompi/mca/coll/libnbc/nbc_iexscan.c @@ -64,23 +64,6 @@ static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Dataty rank = ompi_comm_rank (comm); p = ompi_comm_size (comm); - span = opal_datatype_span(&datatype->super, count, &gap); - if (0 < rank) { - tmpbuf = malloc(span); - if (NULL == tmpbuf) { - return OMPI_ERR_OUT_OF_RESOURCE; - } - if (inplace) { - res = NBC_Copy(recvbuf, count, datatype, (char *)tmpbuf-gap, count, datatype, comm); - } else { - res = NBC_Copy(sendbuf, count, datatype, (char *)tmpbuf-gap, count, datatype, comm); - } - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - free(tmpbuf); - return res; - } - } - #ifdef NBC_CACHE_SCHEDULE /* search schedule in communicator specific tree */ search.sendbuf = sendbuf; @@ -98,6 +81,24 @@ static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Dataty } if (rank != 0) { + span = opal_datatype_span(&datatype->super, count, &gap); + tmpbuf = malloc(span); + if (NULL == tmpbuf) { + return OMPI_ERR_OUT_OF_RESOURCE; + } + if (inplace) { + res = NBC_Sched_copy(recvbuf, false, count, datatype, + (char *)tmpbuf-gap, false, count, datatype, schedule, false); + } else { + res = NBC_Sched_copy((void *)sendbuf, false, count, datatype, + (char *)tmpbuf-gap, false, count, datatype, schedule, false); + } + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + OBJ_RELEASE(schedule); + free(tmpbuf); + return res; + } + res = NBC_Sched_recv (recvbuf, false, count, datatype, rank-1, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_igather.c b/ompi/mca/coll/libnbc/nbc_igather.c index 13802e0b8b..107c1a1f70 100644 --- a/ompi/mca/coll/libnbc/nbc_igather.c +++ b/ompi/mca/coll/libnbc/nbc_igather.c @@ -71,13 +71,6 @@ static int nbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype if (inplace) { sendcount = recvcount; sendtype = recvtype; - } else if (rank == root) { - rbuf = ((char *)recvbuf) + (rank*recvcount*rcvext); - /* if I am the root - just copy the message (only without MPI_IN_PLACE) */ - res = NBC_Copy(sendbuf, sendcount, sendtype, rbuf, recvcount, recvtype, comm); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } } #ifdef NBC_CACHE_SCHEDULE @@ -111,7 +104,17 @@ static int nbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype } else { for (int i = 0 ; i < p ; ++i) { rbuf = (char *)recvbuf + i * recvcount * rcvext; - if (i != root) { + if (i == root) { + if (!inplace) { + /* if I am the root - just copy the message */ + res = NBC_Sched_copy ((void *)sendbuf, false, sendcount, sendtype, + rbuf, false, recvcount, recvtype, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + OBJ_RELEASE(schedule); + return res; + } + } + } else { /* root receives message to the right buffer */ res = NBC_Sched_recv (rbuf, false, recvcount, recvtype, i, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_igatherv.c b/ompi/mca/coll/libnbc/nbc_igatherv.c index bc3880ab9f..a1b916429f 100644 --- a/ompi/mca/coll/libnbc/nbc_igatherv.c +++ b/ompi/mca/coll/libnbc/nbc_igatherv.c @@ -72,8 +72,8 @@ static int nbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtyp if (i == root) { if (!inplace) { /* if I am the root - just copy the message */ - res = NBC_Copy (sendbuf, sendcount, sendtype, rbuf, recvcounts[i], recvtype, - comm); + res = NBC_Sched_copy ((void *)sendbuf, false, sendcount, sendtype, + rbuf, false, recvcounts[i], recvtype, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; diff --git a/ompi/mca/coll/libnbc/nbc_ireduce.c b/ompi/mca/coll/libnbc/nbc_ireduce.c index 7f74a37125..042aacba3f 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce.c @@ -85,7 +85,7 @@ static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Dataty } /* only one node -> copy data */ - if (p == 1) { + if (1 == p && (!persistent || inplace)) { if (!inplace) { res = NBC_Copy (sendbuf, count, datatype, recvbuf, count, datatype, comm); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -140,13 +140,18 @@ static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Dataty return OMPI_ERR_OUT_OF_RESOURCE; } - switch(alg) { - case NBC_RED_BINOMIAL: - res = red_sched_binomial(rank, p, root, sendbuf, redbuf, tmpredbuf, count, datatype, op, inplace, schedule, tmpbuf); - break; - case NBC_RED_CHAIN: - res = red_sched_chain(rank, p, root, sendbuf, recvbuf, count, datatype, op, ext, size, schedule, tmpbuf, segsize); - break; + if (p == 1) { + res = NBC_Sched_copy ((void *)sendbuf, false, count, datatype, + recvbuf, false, count, datatype, schedule, false); + } else { + switch(alg) { + case NBC_RED_BINOMIAL: + res = red_sched_binomial(rank, p, root, sendbuf, redbuf, tmpredbuf, count, datatype, op, inplace, schedule, tmpbuf); + break; + case NBC_RED_CHAIN: + res = red_sched_chain(rank, p, root, sendbuf, recvbuf, count, datatype, op, ext, size, schedule, tmpbuf, segsize); + break; + } } if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -351,7 +356,9 @@ static inline int red_sched_binomial (int rank, int p, int root, const void *sen rbuf = redbuf; tmprbuf = tmpredbuf; if (inplace) { - res = NBC_Copy(rbuf, count, datatype, ((char *)tmpbuf)-gap, count, datatype, MPI_COMM_SELF); + res = NBC_Sched_copy(rbuf, false, count, datatype, + ((char *)tmpbuf)-gap, false, count, datatype, + schedule, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c index b9025c2493..f22e198477 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c @@ -70,7 +70,7 @@ static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *re count += recvcounts[r]; } - if (p == 1 || 0 == count) { + if ((1 == p && (!persistent || inplace)) || 0 == count) { if (!inplace) { /* single node not in_place: copy data to recvbuf */ res = NBC_Copy(sendbuf, recvcounts[0], datatype, recvbuf, recvcounts[0], datatype, comm); @@ -174,8 +174,14 @@ static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *re } } - res = NBC_Sched_copy (lbuf, true, recvcounts[0], datatype, recvbuf, false, - recvcounts[0], datatype, schedule, false); + if (p == 1) { + /* single node not in_place: copy data to recvbuf */ + res = NBC_Sched_copy ((void *)sendbuf, false, recvcounts[0], datatype, + recvbuf, false, recvcounts[0], datatype, schedule, false); + } else { + res = NBC_Sched_copy (lbuf, true, recvcounts[0], datatype, recvbuf, false, + recvcounts[0], datatype, schedule, false); + } } else { res = NBC_Sched_recv (recvbuf, false, recvcounts[rank], datatype, 0, schedule, false); } diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c index cde6bd914e..e40cc69228 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c @@ -89,7 +89,8 @@ static int nbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int rec /* copy data to redbuf if we only have a single node */ if ((p == 1) && !inplace) { - res = NBC_Copy (sendbuf, count, datatype, redbuf, count, datatype, comm); + res = NBC_Sched_copy ((void *)sendbuf, false, count, datatype, + redbuf, false, count, datatype, schedule, false); if (OMPI_SUCCESS != res) { OBJ_RELEASE(schedule); free(tmpbuf); diff --git a/ompi/mca/coll/libnbc/nbc_iscan.c b/ompi/mca/coll/libnbc/nbc_iscan.c index a2fdd9aac6..7b4d8bf0ab 100644 --- a/ompi/mca/coll/libnbc/nbc_iscan.c +++ b/ompi/mca/coll/libnbc/nbc_iscan.c @@ -61,14 +61,6 @@ static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype rank = ompi_comm_rank (comm); p = ompi_comm_size (comm); - if (!inplace) { - /* copy data to receivebuf */ - res = NBC_Copy (sendbuf, count, datatype, recvbuf, count, datatype, comm); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - #ifdef NBC_CACHE_SCHEDULE NBC_Scan_args *args, *found, search; @@ -86,6 +78,16 @@ static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype return OMPI_ERR_OUT_OF_RESOURCE; } + if (!inplace) { + /* copy data to receivebuf */ + res = NBC_Sched_copy ((void *)sendbuf, false, count, datatype, + recvbuf, false, count, datatype, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + OBJ_RELEASE(schedule); + return res; + } + } + if(rank != 0) { span = opal_datatype_span(&datatype->super, count, &gap); tmpbuf = malloc (span); diff --git a/ompi/mca/coll/libnbc/nbc_iscatter.c b/ompi/mca/coll/libnbc/nbc_iscatter.c index dda22a3827..8c4fd138f5 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatter.c +++ b/ompi/mca/coll/libnbc/nbc_iscatter.c @@ -70,15 +70,6 @@ static int nbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendty } } - if ((rank == root) && (!inplace)) { - sbuf = (char *) sendbuf + rank * sendcount * sndext; - /* if I am the root - just copy the message (not for MPI_IN_PLACE) */ - res = NBC_Copy (sbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - #ifdef NBC_CACHE_SCHEDULE NBC_Scatter_args *args, *found, search; @@ -109,7 +100,17 @@ static int nbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendty } else { for (int i = 0 ; i < p ; ++i) { sbuf = (char *) sendbuf + i * sendcount * sndext; - if (i != root) { + if (i == root) { + if (!inplace) { + /* if I am the root - just copy the message */ + res = NBC_Sched_copy (sbuf, false, sendcount, sendtype, + recvbuf, false, recvcount, recvtype, schedule, false); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + OBJ_RELEASE(schedule); + return res; + } + } + } else { /* root sends the right buffer to the right receiver */ res = NBC_Sched_send (sbuf, false, sendcount, sendtype, i, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_iscatterv.c b/ompi/mca/coll/libnbc/nbc_iscatterv.c index 08faacb18e..1a1959ecba 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatterv.c +++ b/ompi/mca/coll/libnbc/nbc_iscatterv.c @@ -64,7 +64,8 @@ static int nbc_iscatterv(const void* sendbuf, const int *sendcounts, const int * if (i == root) { if (!inplace) { /* if I am the root - just copy the message */ - res = NBC_Copy (sbuf, sendcounts[i], sendtype, recvbuf, recvcount, recvtype, comm); + res = NBC_Sched_copy (sbuf, false, sendcounts[i], sendtype, + recvbuf, false, recvcount, recvtype, schedule, false); } else { res = OMPI_SUCCESS; } From 0b8b0f839372bfeaefda30881213b16c115f11f7 Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 20 Feb 2018 09:52:25 +0900 Subject: [PATCH 13/17] coll/libnbc: Implement `MPI_STARTALL` Signed-off-by: KAWASHIMA Takahiro --- ompi/mca/coll/libnbc/coll_libnbc.h | 2 - ompi/mca/coll/libnbc/coll_libnbc_component.c | 41 ++++++++++++- ompi/mca/coll/libnbc/nbc.c | 64 -------------------- 3 files changed, 40 insertions(+), 67 deletions(-) diff --git a/ompi/mca/coll/libnbc/coll_libnbc.h b/ompi/mca/coll/libnbc/coll_libnbc.h index 88f59d424d..dba87225bb 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc.h +++ b/ompi/mca/coll/libnbc/coll_libnbc.h @@ -410,8 +410,6 @@ int ompi_coll_libnbc_neighbor_alltoallw_init(const void *sbuf, const int *scount struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); -int ompi_coll_libnbc_start(size_t count, ompi_request_t ** request); - END_C_DECLS diff --git a/ompi/mca/coll/libnbc/coll_libnbc_component.c b/ompi/mca/coll/libnbc/coll_libnbc_component.c index 7782e5cfdc..226507c564 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc_component.c +++ b/ompi/mca/coll/libnbc/coll_libnbc_component.c @@ -29,6 +29,7 @@ #include "ompi_config.h" #include "coll_libnbc.h" +#include "nbc_internal.h" #include "mpi.h" #include "ompi/mca/coll/coll.h" @@ -384,6 +385,44 @@ OBJ_CLASS_INSTANCE(ompi_coll_libnbc_module_t, libnbc_module_destruct); +static int +request_start(size_t count, ompi_request_t ** requests) +{ + int i, res; + + NBC_DEBUG(5, " ** request_start **\n"); + + for (i = 0; i < count; i++) { + NBC_Handle *handle = (NBC_Handle *) requests[i]; + NBC_Schedule *schedule = handle->schedule; + + NBC_DEBUG(5, "--------------------------------\n"); + NBC_DEBUG(5, "schedule %p size %u\n", &schedule, sizeof(schedule)); + NBC_DEBUG(5, "handle %p size %u\n", &handle, sizeof(handle)); + NBC_DEBUG(5, "data %p size %u\n", &schedule->data, sizeof(schedule->data)); + NBC_DEBUG(5, "req_array %p size %u\n", &handle->req_array, sizeof(handle->req_array)); + NBC_DEBUG(5, "row_offset=%u address=%p size=%u\n", handle->row_offset, &handle->row_offset, sizeof(handle->row_offset)); + NBC_DEBUG(5, "req_count=%u address=%p size=%u\n", handle->req_count, &handle->req_count, sizeof(handle->req_count)); + NBC_DEBUG(5, "tmpbuf address=%p size=%u\n", handle->tmpbuf, sizeof(handle->tmpbuf)); + NBC_DEBUG(5, "--------------------------------\n"); + + handle->super.req_complete = REQUEST_PENDING; + handle->nbc_complete = false; + + res = NBC_Start(handle); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_DEBUG(5, " ** bad result from NBC_Start **\n"); + return res; + } + } + + NBC_DEBUG(5, " ** LEAVING request_start **\n"); + + return OMPI_SUCCESS; + +} + + static int request_cancel(struct ompi_request_t *request, int complete) { @@ -413,7 +452,7 @@ request_construct(ompi_coll_libnbc_request_t *request) { request->super.req_type = OMPI_REQUEST_COLL; request->super.req_status._cancelled = 0; - request->super.req_start = ompi_coll_libnbc_start; + request->super.req_start = request_start; request->super.req_free = request_free; request->super.req_cancel = request_cancel; } diff --git a/ompi/mca/coll/libnbc/nbc.c b/ompi/mca/coll/libnbc/nbc.c index 1d5f90ce77..e183c6bdf9 100644 --- a/ompi/mca/coll/libnbc/nbc.c +++ b/ompi/mca/coll/libnbc/nbc.c @@ -761,67 +761,3 @@ void NBC_SchedCache_args_delete(void *entry) { free(entry); } #endif - -static int NBC_Start_internal(NBC_Handle *handle) { - - /* kick off first round */ - int res = NBC_Start_round(handle); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - - /* - * FIXME - The request may already be complete/inactive now - * if so, it should not be added to the active list - * Must add param to provide the status of request, - * because the user could have already freed it and - * it could already be in use by another operation! - */ - - OPAL_THREAD_LOCK(&mca_coll_libnbc_component.lock); - opal_list_append(&mca_coll_libnbc_component.active_requests, &(handle->super.super.super)); - OPAL_THREAD_UNLOCK(&mca_coll_libnbc_component.lock); - - return OMPI_SUCCESS; - -} - -int ompi_coll_libnbc_start(size_t count, ompi_request_t ** request) { - - NBC_DEBUG(5, " ** ompi_coll_libnbc_start **\n"); - - /* FIXME */ - assert (1 == count); - - NBC_Handle *handle; - NBC_Schedule *schedule; - - int res; - - handle = (NBC_Handle *) *request; - - NBC_DEBUG(5, "--------------------------------\n"); - NBC_DEBUG(5, "schedule %p size %u\n", &schedule, sizeof(schedule)); - NBC_DEBUG(5, "handle %p size %u\n", &handle, sizeof(handle)); - NBC_DEBUG(5, "data %p size %u\n", &schedule->data, sizeof(schedule->data)); - NBC_DEBUG(5, "req_array %p size %u\n", &handle->req_array, sizeof(handle->req_array)); - NBC_DEBUG(5, "row_offset=%u address=%p size=%u\n", handle->row_offset, &handle->row_offset, sizeof(handle->row_offset)); - NBC_DEBUG(5, "req_count=%u address=%p size=%u\n", handle->req_count, &handle->req_count, sizeof(handle->req_count)); - NBC_DEBUG(5, "tmpbuf address=%p size=%u\n", handle->tmpbuf, sizeof(handle->tmpbuf)); - NBC_DEBUG(5, "--------------------------------\n"); - - handle->super.req_complete = REQUEST_PENDING; - handle->super.req_state = OMPI_REQUEST_ACTIVE; - handle->nbc_complete = false; - res = NBC_Start_internal(handle); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_DEBUG(5, " ** bad result from NBC_Start_internal **\n"); - NBC_Return_handle (handle); - return res; - } - - NBC_DEBUG(5, " ** LEAVING ompi_coll_libnbc_start **\n"); - - return OMPI_SUCCESS; - -} From 5c219034774029499d7f96e64665f8e4b17754f3 Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Fri, 11 May 2018 16:39:56 +0900 Subject: [PATCH 14/17] coll/libnbc: Add assertion for `NBC_A2A_DISS` Persistent operation for `NBC_A2A_DISS` is not supported currently. Though the algorithm is not selected at all currently, I put an assertion not to select it by mistake. Signed-off-by: KAWASHIMA Takahiro --- ompi/mca/coll/libnbc/nbc_ialltoall.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ompi/mca/coll/libnbc/nbc_ialltoall.c b/ompi/mca/coll/libnbc/nbc_ialltoall.c index 834ce51c09..1dd2c378e3 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoall.c @@ -118,7 +118,10 @@ static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendty return OMPI_ERR_OUT_OF_RESOURCE; } } else if (alg == NBC_A2A_DISS) { - /* only A2A_DISS needs buffers */ + /* persistent operation is not supported currently for this algorithm; + * we need to replace PMPI_Pack, PMPI_Unpack, and mempcy */ + assert(! persistent); + if(NBC_Type_intrinsic(sendtype)) { datasize = sndext * sendcount; } else { From e12a5056f1dd213c88a43ccc59b7a69f09f2a19a Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Fri, 11 May 2018 16:55:08 +0900 Subject: [PATCH 15/17] coll/libnbc: Rename internal functions The `nbc_i*` functions don't start communication, but create a request. `nbc_*_init` are appropriate names for them. Signed-off-by: KAWASHIMA Takahiro --- ompi/mca/coll/libnbc/nbc_iallgather.c | 28 +++++++-------- ompi/mca/coll/libnbc/nbc_iallgatherv.c | 28 +++++++-------- ompi/mca/coll/libnbc/nbc_iallreduce.c | 28 +++++++-------- ompi/mca/coll/libnbc/nbc_ialltoall.c | 28 +++++++-------- ompi/mca/coll/libnbc/nbc_ialltoallv.c | 36 +++++++++---------- ompi/mca/coll/libnbc/nbc_ialltoallw.c | 36 +++++++++---------- ompi/mca/coll/libnbc/nbc_ibarrier.c | 16 ++++----- ompi/mca/coll/libnbc/nbc_ibcast.c | 28 +++++++-------- ompi/mca/coll/libnbc/nbc_iexscan.c | 14 ++++---- ompi/mca/coll/libnbc/nbc_igather.c | 32 ++++++++--------- ompi/mca/coll/libnbc/nbc_igatherv.c | 32 ++++++++--------- .../mca/coll/libnbc/nbc_ineighbor_allgather.c | 16 ++++----- .../coll/libnbc/nbc_ineighbor_allgatherv.c | 16 ++++----- ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c | 16 ++++----- .../mca/coll/libnbc/nbc_ineighbor_alltoallv.c | 16 ++++----- .../mca/coll/libnbc/nbc_ineighbor_alltoallw.c | 16 ++++----- ompi/mca/coll/libnbc/nbc_ireduce.c | 28 +++++++-------- ompi/mca/coll/libnbc/nbc_ireduce_scatter.c | 28 +++++++-------- .../coll/libnbc/nbc_ireduce_scatter_block.c | 28 +++++++-------- ompi/mca/coll/libnbc/nbc_iscan.c | 14 ++++---- ompi/mca/coll/libnbc/nbc_iscatter.c | 32 ++++++++--------- ompi/mca/coll/libnbc/nbc_iscatterv.c | 32 ++++++++--------- 22 files changed, 274 insertions(+), 274 deletions(-) diff --git a/ompi/mca/coll/libnbc/nbc_iallgather.c b/ompi/mca/coll/libnbc/nbc_iallgather.c index 4b9f2224a0..cb87a645e2 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgather.c +++ b/ompi/mca/coll/libnbc/nbc_iallgather.c @@ -44,9 +44,9 @@ int NBC_Allgather_args_compare(NBC_Allgather_args *a, NBC_Allgather_args *b, voi * the algorithm uses p-1 rounds * each node sends the packet it received last round (or has in round 0) to it's right neighbor (modulo p) * each node receives from it's left (modulo p) neighbor */ -static int nbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint rcvext; @@ -178,8 +178,8 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module, false); + int res = nbc_allgather_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -194,9 +194,9 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype return OMPI_SUCCESS; } -static int nbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext; @@ -254,8 +254,8 @@ static int nbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module, false); + int res = nbc_allgather_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -273,8 +273,8 @@ int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Da int ompi_coll_libnbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module, true); + int res = nbc_allgather_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -285,8 +285,8 @@ int ompi_coll_libnbc_allgather_init(const void* sendbuf, int sendcount, MPI_Data int ompi_coll_libnbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module, true); + int res = nbc_allgather_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_iallgatherv.c b/ompi/mca/coll/libnbc/nbc_iallgatherv.c index dbfc4328a0..83dc8af5d4 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_iallgatherv.c @@ -34,9 +34,9 @@ * second round: * each node sends to node (rank+2)%p sendcount elements * each node receives from node (rank-2)%p recvcounts[(rank+2)%p] elements */ -static int nbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res, speer, rpeer; MPI_Aint rcvext; @@ -122,8 +122,8 @@ static int nbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype send int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, - comm, request, module, false); + int res = nbc_allgatherv_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -138,9 +138,9 @@ int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatyp return OMPI_SUCCESS; } -static int nbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_allgatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext; @@ -201,8 +201,8 @@ static int nbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatyp int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, - comm, request, module, false); + int res = nbc_allgatherv_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -220,8 +220,8 @@ int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_D int ompi_coll_libnbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, - comm, request, module, true); + int res = nbc_allgatherv_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -232,8 +232,8 @@ int ompi_coll_libnbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Dat int ompi_coll_libnbc_allgatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallgatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, - comm, request, module, true); + int res = nbc_allgatherv_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_iallreduce.c b/ompi/mca/coll/libnbc/nbc_iallreduce.c index b37eb4ee17..9bfb294396 100644 --- a/ompi/mca/coll/libnbc/nbc_iallreduce.c +++ b/ompi/mca/coll/libnbc/nbc_iallreduce.c @@ -53,9 +53,9 @@ int NBC_Allreduce_args_compare(NBC_Allreduce_args *a, NBC_Allreduce_args *b, voi } #endif -static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_allreduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; ptrdiff_t ext, lb; @@ -198,8 +198,8 @@ static int nbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Dat int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallreduce(sendbuf, recvbuf, count, datatype, op, - comm, request, module, false); + int res = nbc_allreduce_init(sendbuf, recvbuf, count, datatype, op, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -214,9 +214,9 @@ int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, M return OMPI_SUCCESS; } -static int nbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_allreduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, rsize; size_t size; @@ -281,8 +281,8 @@ static int nbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, M int ompi_coll_libnbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallreduce_inter(sendbuf, recvbuf, count, datatype, op, - comm, request, module, false); + int res = nbc_allreduce_inter_init(sendbuf, recvbuf, count, datatype, op, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -738,8 +738,8 @@ static inline int allred_sched_linear(int rank, int rsize, const void *sendbuf, int ompi_coll_libnbc_allreduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallreduce(sendbuf, recvbuf, count, datatype, op, - comm, request, module, true); + int res = nbc_allreduce_init(sendbuf, recvbuf, count, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -750,8 +750,8 @@ int ompi_coll_libnbc_allreduce_init(const void* sendbuf, void* recvbuf, int coun int ompi_coll_libnbc_allreduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iallreduce_inter(sendbuf, recvbuf, count, datatype, op, - comm, request, module, true); + int res = nbc_allreduce_inter_init(sendbuf, recvbuf, count, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ialltoall.c b/ompi/mca/coll/libnbc/nbc_ialltoall.c index 1dd2c378e3..9f83a08b5c 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoall.c @@ -54,9 +54,9 @@ int NBC_Alltoall_args_compare(NBC_Alltoall_args *a, NBC_Alltoall_args *b, void * #endif /* simple linear MPI_Ialltoall the (simple) algorithm just sends to all nodes */ -static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_alltoall_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res, datasize; size_t a2asize, sndsize; @@ -284,8 +284,8 @@ static int nbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendty int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module, false); + int res = nbc_alltoall_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -300,9 +300,9 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype return OMPI_SUCCESS; } -static int nbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_alltoall_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext, rcvext; @@ -368,8 +368,8 @@ static int nbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Datatype int ompi_coll_libnbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoall_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module, false); + int res = nbc_alltoall_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -593,8 +593,8 @@ static inline int a2a_sched_inplace(int rank, int p, NBC_Schedule* schedule, voi int ompi_coll_libnbc_alltoall_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module, true); + int res = nbc_alltoall_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -605,8 +605,8 @@ int ompi_coll_libnbc_alltoall_init (const void* sendbuf, int sendcount, MPI_Data int ompi_coll_libnbc_alltoall_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoall_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, - comm, request, module, true); + int res = nbc_alltoall_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallv.c b/ompi/mca/coll/libnbc/nbc_ialltoallv.c index ce036dafe0..1f3d4230d5 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallv.c @@ -41,10 +41,10 @@ static inline int a2av_sched_inplace(int rank, int p, NBC_Schedule *schedule, * would not be sufficient ... we simply do not cache it */ /* simple linear Alltoallv */ -static int nbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int *sdispls, - MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_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, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint sndext, rcvext; @@ -144,9 +144,9 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallv(sendbuf, sendcounts, sdispls, sendtype, - recvbuf, recvcounts, rdispls, recvtype, - comm, request, module, false); + int res = nbc_alltoallv_init(sendbuf, sendcounts, sdispls, sendtype, + recvbuf, recvcounts, rdispls, recvtype, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -162,10 +162,10 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons } /* simple linear Alltoallv */ -static int nbc_ialltoallv_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, - MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, - MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_alltoallv_inter_init (const void* sendbuf, const int *sendcounts, const int *sdispls, + MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, + MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext, rcvext; @@ -232,9 +232,9 @@ int ompi_coll_libnbc_ialltoallv_inter (const void* sendbuf, const int *sendcount MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallv_inter(sendbuf, sendcounts, sdispls, sendtype, - recvbuf, recvcounts, rdispls, recvtype, - comm, request, module, false); + int res = nbc_alltoallv_inter_init(sendbuf, sendcounts, sdispls, sendtype, + recvbuf, recvcounts, rdispls, recvtype, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -392,8 +392,8 @@ int ompi_coll_libnbc_alltoallv_init(const void* sendbuf, const int *sendcounts, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, - comm, request, module, true); + int res = nbc_alltoallv_init(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -405,8 +405,8 @@ int ompi_coll_libnbc_alltoallv_inter_init(const void* sendbuf, const int *sendco MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallv_inter(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, - comm, request, module, true); + int res = nbc_alltoallv_inter_init(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallw.c b/ompi/mca/coll/libnbc/nbc_ialltoallw.c index de94206c41..38a69d3b70 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallw.c @@ -41,10 +41,10 @@ static inline int a2aw_sched_inplace(int rank, int p, NBC_Schedule *schedule, * would not be sufficient ... we simply do not cache it */ /* simple linear Alltoallw */ -static int nbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int *sdispls, - struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, - struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_alltoallw_init(const void* sendbuf, const int *sendcounts, const int *sdispls, + struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, + struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; NBC_Schedule *schedule; @@ -130,9 +130,9 @@ int ompi_coll_libnbc_ialltoallw(const void* sendbuf, const int *sendcounts, cons struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, - recvbuf, recvcounts, rdispls, recvtypes, - comm, request, module, false); + int res = nbc_alltoallw_init(sendbuf, sendcounts, sdispls, sendtypes, + recvbuf, recvcounts, rdispls, recvtypes, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -148,10 +148,10 @@ int ompi_coll_libnbc_ialltoallw(const void* sendbuf, const int *sendcounts, cons } /* simple linear Alltoallw */ -static int nbc_ialltoallw_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, - struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, - struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_alltoallw_inter_init (const void* sendbuf, const int *sendcounts, const int *sdispls, + struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, + struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; NBC_Schedule *schedule; @@ -205,9 +205,9 @@ int ompi_coll_libnbc_ialltoallw_inter(const void* sendbuf, const int *sendcounts struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallw_inter(sendbuf, sendcounts, sdispls, sendtypes, - recvbuf, recvcounts, rdispls, recvtypes, - comm, request, module, false); + int res = nbc_alltoallw_inter_init(sendbuf, sendcounts, sdispls, sendtypes, + recvbuf, recvcounts, rdispls, recvtypes, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -366,8 +366,8 @@ int ompi_coll_libnbc_alltoallw_init(const void* sendbuf, const int *sendcounts, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, - comm, request, module, true); + int res = nbc_alltoallw_init(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -379,8 +379,8 @@ int ompi_coll_libnbc_alltoallw_inter_init(const void* sendbuf, const int *sendco struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ialltoallw_inter(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, - comm, request, module, true); + int res = nbc_alltoallw_inter_init(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ibarrier.c b/ompi/mca/coll/libnbc/nbc_ibarrier.c index b3291b0ba5..6b86a5ac64 100644 --- a/ompi/mca/coll/libnbc/nbc_ibarrier.c +++ b/ompi/mca/coll/libnbc/nbc_ibarrier.c @@ -22,8 +22,8 @@ #include "nbc_internal.h" /* Dissemination implementation of MPI_Ibarrier */ -static int nbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_barrier_init(struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, maxround, res, recvpeer, sendpeer; NBC_Schedule *schedule; @@ -101,7 +101,7 @@ static int nbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** requ int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibarrier(comm, request, module, false); + int res = nbc_barrier_init(comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -116,8 +116,8 @@ int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t * return OMPI_SUCCESS; } -static int nbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_barrier_inter_init(struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, rsize; NBC_Schedule *schedule; @@ -188,7 +188,7 @@ static int nbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t * int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibarrier_inter(comm, request, module, false); + int res = nbc_barrier_inter_init(comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -205,7 +205,7 @@ int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_reque int ompi_coll_libnbc_barrier_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibarrier(comm, request, module, true); + int res = nbc_barrier_init(comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -215,7 +215,7 @@ int ompi_coll_libnbc_barrier_init(struct ompi_communicator_t *comm, MPI_Info inf int ompi_coll_libnbc_barrier_inter_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibarrier_inter(comm, request, module, true); + int res = nbc_barrier_inter_init(comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ibcast.c b/ompi/mca/coll/libnbc/nbc_ibcast.c index f8795192c3..140a56af08 100644 --- a/ompi/mca/coll/libnbc/nbc_ibcast.c +++ b/ompi/mca/coll/libnbc/nbc_ibcast.c @@ -45,9 +45,9 @@ int NBC_Bcast_args_compare(NBC_Bcast_args *a, NBC_Bcast_args *b, void *param) { } #endif -static int nbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) +static int nbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res, segsize; size_t size; @@ -175,8 +175,8 @@ int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibcast(buffer, count, datatype, root, - comm, request, module, false); + int res = nbc_bcast_init(buffer, count, datatype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -342,9 +342,9 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch return OMPI_SUCCESS; } -static int nbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_bcast_inter_init(void *buffer, int count, MPI_Datatype datatype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res; NBC_Schedule *schedule; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -397,8 +397,8 @@ static int nbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibcast_inter(buffer, count, datatype, root, - comm, request, module, false); + int res = nbc_bcast_inter_init(buffer, count, datatype, root, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -416,8 +416,8 @@ int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype int ompi_coll_libnbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibcast(buffer, count, datatype, root, - comm, request, module, true); + int res = nbc_bcast_init(buffer, count, datatype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -428,8 +428,8 @@ int ompi_coll_libnbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int ompi_coll_libnbc_bcast_inter_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ibcast_inter(buffer, count, datatype, root, - comm, request, module, true); + int res = nbc_bcast_inter_init(buffer, count, datatype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_iexscan.c b/ompi/mca/coll/libnbc/nbc_iexscan.c index faad1e6a6b..6d12666f57 100644 --- a/ompi/mca/coll/libnbc/nbc_iexscan.c +++ b/ompi/mca/coll/libnbc/nbc_iexscan.c @@ -46,9 +46,9 @@ int NBC_Scan_args_compare(NBC_Scan_args *a, NBC_Scan_args *b, void *param) { * 3. all but rank p-1 do sends to it's right neigbor and exits * */ -static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_exscan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; ptrdiff_t gap, span; NBC_Schedule *schedule; @@ -197,8 +197,8 @@ static int nbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Dataty int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iexscan(sendbuf, recvbuf, count, datatype, op, - comm, request, module, false); + int res = nbc_exscan_init(sendbuf, recvbuf, count, datatype, op, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -216,8 +216,8 @@ int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_ int ompi_coll_libnbc_exscan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iexscan(sendbuf, recvbuf, count, datatype, op, - comm, request, module, true); + int res = nbc_exscan_init(sendbuf, recvbuf, count, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_igather.c b/ompi/mca/coll/libnbc/nbc_igather.c index 107c1a1f70..d897c7b95f 100644 --- a/ompi/mca/coll/libnbc/nbc_igather.c +++ b/ompi/mca/coll/libnbc/nbc_igather.c @@ -44,10 +44,10 @@ int NBC_Gather_args_compare(NBC_Gather_args *a, NBC_Gather_args *b, void *param) } #endif -static int nbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, - int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -177,8 +177,8 @@ int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype se int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, false); + int res = nbc_gather_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -193,10 +193,10 @@ int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype se return OMPI_SUCCESS; } -static int nbc_igather_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, - int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_gather_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -257,8 +257,8 @@ int ompi_coll_libnbc_igather_inter(const void* sendbuf, int sendcount, MPI_Datat int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, false); + int res = nbc_gather_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -277,8 +277,8 @@ int ompi_coll_libnbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatyp int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, true); + int res = nbc_gather_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -290,8 +290,8 @@ int ompi_coll_libnbc_gather_inter_init(const void* sendbuf, int sendcount, MPI_D int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igather_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, true); + int res = nbc_gather_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_igatherv.c b/ompi/mca/coll/libnbc/nbc_igatherv.c index a1b916429f..eac3fa65da 100644 --- a/ompi/mca/coll/libnbc/nbc_igatherv.c +++ b/ompi/mca/coll/libnbc/nbc_igatherv.c @@ -29,10 +29,10 @@ * would not be sufficient ... we simply do not cache it */ -static int nbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, - int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -109,8 +109,8 @@ int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype s void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, - comm, request, module, false); + int res = nbc_gatherv_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -125,10 +125,10 @@ int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype s return OMPI_SUCCESS; } -static int nbc_igatherv_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, - int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_gatherv_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, + int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext; NBC_Schedule *schedule; @@ -189,8 +189,8 @@ int ompi_coll_libnbc_igatherv_inter(const void* sendbuf, int sendcount, MPI_Data void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, - comm, request, module, false); + int res = nbc_gatherv_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, + comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -209,8 +209,8 @@ int ompi_coll_libnbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Dataty void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, - comm, request, module, true); + int res = nbc_gatherv_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -222,8 +222,8 @@ int ompi_coll_libnbc_gatherv_inter_init(const void* sendbuf, int sendcount, MPI_ void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_igatherv_inter(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, - comm, request, module, true); + int res = nbc_gatherv_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c index 1875229d21..cff0d4d956 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c @@ -44,10 +44,10 @@ int NBC_Ineighbor_allgather_args_compare(NBC_Ineighbor_allgather_args *a, NBC_In #endif -static int nbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, - int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, + ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -166,8 +166,8 @@ static int nbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype st int ompi_coll_libnbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_allgather(sbuf, scount, stype, rbuf, rcount, rtype, - comm, request, module, false); + int res = nbc_neighbor_allgather_init(sbuf, scount, stype, rbuf, rcount, rtype, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -336,8 +336,8 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch int ompi_coll_libnbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_allgather(sbuf, scount, stype, rbuf, rcount, rtype, - comm, request, module, true); + int res = nbc_neighbor_allgather_init(sbuf, scount, stype, rbuf, rcount, rtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c index f974d4522a..fd034bd761 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c @@ -44,10 +44,10 @@ int NBC_Ineighbor_allgatherv_args_compare(NBC_Ineighbor_allgatherv_args *a, NBC_ #endif -static int nbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, - const int *rcounts, const int *displs, MPI_Datatype rtype, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_neighbor_allgatherv_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + const int *rcounts, const int *displs, MPI_Datatype rtype, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -168,8 +168,8 @@ int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Data const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_allgatherv(sbuf, scount, stype, rbuf, rcounts, displs, rtype, - comm, request, module, false); + int res = nbc_neighbor_allgatherv_init(sbuf, scount, stype, rbuf, rcounts, displs, rtype, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -187,8 +187,8 @@ int ompi_coll_libnbc_neighbor_allgatherv_init(const void *sbuf, int scount, MPI_ const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_allgatherv(sbuf, scount, stype, rbuf, rcounts, displs, rtype, - comm, request, module, true); + int res = nbc_neighbor_allgatherv_init(sbuf, scount, stype, rbuf, rcounts, displs, rtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c index 7172233982..77a4d3c22c 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c @@ -41,10 +41,10 @@ int NBC_Ineighbor_alltoall_args_compare(NBC_Ineighbor_alltoall_args *a, NBC_Inei } #endif -static int nbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, - int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_neighbor_alltoall_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, + int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, + ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint sndext, rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -170,8 +170,8 @@ static int nbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype sty int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoall(sbuf, scount, stype, rbuf, rcount, rtype, - comm, request, module, false); + int res = nbc_neighbor_alltoall_init(sbuf, scount, stype, rbuf, rcount, rtype, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -188,8 +188,8 @@ int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Dataty int ompi_coll_libnbc_neighbor_alltoall_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoall(sbuf, scount, stype, rbuf, rcount, rtype, - comm, request, module, true); + int res = nbc_neighbor_alltoall_init(sbuf, scount, stype, rbuf, rcount, rtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c index 1dbb43779b..c7fe1ac3b7 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c @@ -44,10 +44,10 @@ int NBC_Ineighbor_alltoallv_args_compare(NBC_Ineighbor_alltoallv_args *a, NBC_In #endif -static int nbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, - void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_neighbor_alltoallv_init(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, + void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint sndext, rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -175,8 +175,8 @@ int ompi_coll_libnbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, c void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoallv(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, - comm, request, module, false); + int res = nbc_neighbor_alltoallv_init(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -194,8 +194,8 @@ int ompi_coll_libnbc_neighbor_alltoallv_init(const void *sbuf, const int *scount void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoallv(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, - comm, request, module, true); + int res = nbc_neighbor_alltoallv_init(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c index b8ea53652f..008cce4492 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c @@ -43,10 +43,10 @@ int NBC_Ineighbor_alltoallw_args_compare(NBC_Ineighbor_alltoallw_args *a, NBC_In } #endif -static int nbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, - void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_neighbor_alltoallw_init(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, + void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; NBC_Schedule *schedule; @@ -160,8 +160,8 @@ int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, c void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoallw(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, - comm, request, module, false); + int res = nbc_neighbor_alltoallw_init(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -179,8 +179,8 @@ int ompi_coll_libnbc_neighbor_alltoallw_init(const void *sbuf, const int *scount void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ineighbor_alltoallw(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, - comm, request, module, true); + int res = nbc_neighbor_alltoallw_init(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ireduce.c b/ompi/mca/coll/libnbc/nbc_ireduce.c index 042aacba3f..185571b889 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce.c @@ -53,9 +53,9 @@ int NBC_Reduce_args_compare(NBC_Reduce_args *a, NBC_Reduce_args *b, void *param) #endif /* the non-blocking reduce */ -static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_reduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res, segsize; size_t size; MPI_Aint ext; @@ -211,8 +211,8 @@ static int nbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Dataty int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce(sendbuf, recvbuf, count, datatype, op, root, - comm, request, module, false); + int res = nbc_reduce_init(sendbuf, recvbuf, count, datatype, op, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -226,9 +226,9 @@ int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_ return OMPI_SUCCESS; } -static int nbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_reduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, rsize; NBC_Schedule *schedule; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -277,8 +277,8 @@ static int nbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_ int ompi_coll_libnbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, - comm, request, module, false); + int res = nbc_reduce_inter_init(sendbuf, recvbuf, count, datatype, op, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -563,8 +563,8 @@ static inline int red_sched_linear (int rank, int rsize, int root, const void *s int ompi_coll_libnbc_reduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce(sendbuf, recvbuf, count, datatype, op, root, - comm, request, module, true); + int res = nbc_reduce_init(sendbuf, recvbuf, count, datatype, op, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -575,8 +575,8 @@ int ompi_coll_libnbc_reduce_init(const void* sendbuf, void* recvbuf, int count, int ompi_coll_libnbc_reduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_inter(sendbuf, recvbuf, count, datatype, op, root, - comm, request, module, true); + int res = nbc_reduce_inter_init(sendbuf, recvbuf, count, datatype, op, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c index f22e198477..118717e938 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c @@ -42,9 +42,9 @@ * */ -static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, - MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int peer, rank, maxr, p, res, count; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -212,8 +212,8 @@ static int nbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *re int ompi_coll_libnbc_ireduce_scatter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, - comm, request, module, false); + int res = nbc_reduce_scatter_init(sendbuf, recvbuf, recvcounts, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -226,9 +226,9 @@ int ompi_coll_libnbc_ireduce_scatter (const void* sendbuf, void* recvbuf, const return OMPI_SUCCESS; } -static int nbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, - MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_reduce_scatter_inter_init (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, count, lsize, rsize; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -354,8 +354,8 @@ static int nbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_inter(sendbuf, recvbuf, recvcounts, datatype, op, - comm, request, module, false); + int res = nbc_reduce_scatter_inter_init(sendbuf, recvbuf, recvcounts, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -372,8 +372,8 @@ int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, int ompi_coll_libnbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, - comm, request, module, true); + int res = nbc_reduce_scatter_init(sendbuf, recvbuf, recvcounts, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -384,8 +384,8 @@ int ompi_coll_libnbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, con int ompi_coll_libnbc_reduce_scatter_inter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_inter(sendbuf, recvbuf, recvcounts, datatype, op, - comm, request, module, true); + int res = nbc_reduce_scatter_inter_init(sendbuf, recvbuf, recvcounts, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c index e40cc69228..07ac5d73c9 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c @@ -40,9 +40,9 @@ * */ -static int nbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, - MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_reduce_scatter_block_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, + MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int peer, rank, maxr, p, res, count; MPI_Aint ext; ptrdiff_t gap, span; @@ -210,8 +210,8 @@ static int nbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int rec int ompi_coll_libnbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, - comm, request, module, false); + int res = nbc_reduce_scatter_block_init(sendbuf, recvbuf, recvcount, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -225,9 +225,9 @@ int ompi_coll_libnbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, i return OMPI_SUCCESS; } -static int nbc_ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, int rcount, struct ompi_datatype_t *dtype, - struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_reduce_scatter_block_inter_init(const void *sendbuf, void *recvbuf, int rcount, struct ompi_datatype_t *dtype, + struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, res, count, lsize, rsize; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -349,8 +349,8 @@ static int nbc_ireduce_scatter_block_inter(const void *sendbuf, void *recvbuf, i int ompi_coll_libnbc_ireduce_scatter_block_inter(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, - comm, request, module, false); + int res = nbc_reduce_scatter_block_inter_init(sendbuf, recvbuf, recvcount, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -367,8 +367,8 @@ int ompi_coll_libnbc_ireduce_scatter_block_inter(const void* sendbuf, void* recv int ompi_coll_libnbc_reduce_scatter_block_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, - comm, request, module, true); + int res = nbc_reduce_scatter_block_init(sendbuf, recvbuf, recvcount, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -379,8 +379,8 @@ int ompi_coll_libnbc_reduce_scatter_block_init(const void* sendbuf, void* recvbu int ompi_coll_libnbc_reduce_scatter_block_inter_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_ireduce_scatter_block_inter(sendbuf, recvbuf, recvcount, datatype, op, - comm, request, module, true); + int res = nbc_reduce_scatter_block_inter_init(sendbuf, recvbuf, recvcount, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_iscan.c b/ompi/mca/coll/libnbc/nbc_iscan.c index 7b4d8bf0ab..43199bcdf0 100644 --- a/ompi/mca/coll/libnbc/nbc_iscan.c +++ b/ompi/mca/coll/libnbc/nbc_iscan.c @@ -46,9 +46,9 @@ int NBC_Scan_args_compare(NBC_Scan_args *a, NBC_Scan_args *b, void *param) { * 3. all but rank p-1 do sends to it's right neighbor and exits * */ -static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_scan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; ptrdiff_t gap, span; NBC_Schedule *schedule; @@ -175,8 +175,8 @@ static int nbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscan(sendbuf, recvbuf, count, datatype, op, - comm, request, module, false); + int res = nbc_scan_init(sendbuf, recvbuf, count, datatype, op, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -193,8 +193,8 @@ int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Da int ompi_coll_libnbc_scan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscan(sendbuf, recvbuf, count, datatype, op, - comm, request, module, true); + int res = nbc_scan_init(sendbuf, recvbuf, count, datatype, op, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_iscatter.c b/ompi/mca/coll/libnbc/nbc_iscatter.c index 8c4fd138f5..a0b0169636 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatter.c +++ b/ompi/mca/coll/libnbc/nbc_iscatter.c @@ -45,10 +45,10 @@ int NBC_Scatter_args_compare(NBC_Scatter_args *a, NBC_Scatter_args *b, void *par #endif /* simple linear MPI_Iscatter */ -static int nbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_scatter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint sndext = 0; NBC_Schedule *schedule; @@ -172,8 +172,8 @@ int ompi_coll_libnbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, false); + int res = nbc_scatter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -187,10 +187,10 @@ int ompi_coll_libnbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype return OMPI_SUCCESS; } -static int nbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_scatter_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext; NBC_Schedule *schedule; @@ -251,8 +251,8 @@ int ompi_coll_libnbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Dat void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatter_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, false); + int res = nbc_scatter_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -270,8 +270,8 @@ int ompi_coll_libnbc_scatter_init(const void* sendbuf, int sendcount, MPI_Dataty void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, true); + int res = nbc_scatter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -283,8 +283,8 @@ int ompi_coll_libnbc_scatter_inter_init(const void* sendbuf, int sendcount, MPI_ void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatter_inter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, true); + int res = nbc_scatter_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } diff --git a/ompi/mca/coll/libnbc/nbc_iscatterv.c b/ompi/mca/coll/libnbc/nbc_iscatterv.c index 1a1959ecba..17da0ae8ff 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatterv.c +++ b/ompi/mca/coll/libnbc/nbc_iscatterv.c @@ -28,10 +28,10 @@ * would not be sufficient ... we simply do not cache it */ /* simple linear MPI_Iscatterv */ -static int nbc_iscatterv(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_scatterv_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int rank, p, res; MPI_Aint sndext; NBC_Schedule *schedule; @@ -107,8 +107,8 @@ int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, false); + int res = nbc_scatterv_init(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -122,10 +122,10 @@ int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const return OMPI_SUCCESS; } -static int nbc_iscatterv_inter (const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, - void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, - struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { +static int nbc_scatterv_inter_init (const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, + struct ompi_communicator_t *comm, ompi_request_t ** request, + struct mca_coll_base_module_2_2_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext; NBC_Schedule *schedule; @@ -185,8 +185,8 @@ int ompi_coll_libnbc_iscatterv_inter(const void* sendbuf, const int *sendcounts, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatterv_inter(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, false); + int res = nbc_scatterv_inter_init(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { return res; } @@ -204,8 +204,8 @@ int ompi_coll_libnbc_scatterv_init(const void* sendbuf, const int *sendcounts, c void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, true); + int res = nbc_scatterv_init(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } @@ -217,8 +217,8 @@ int ompi_coll_libnbc_scatterv_inter_init(const void* sendbuf, const int *sendcou void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { - int res = nbc_iscatterv_inter(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, - comm, request, module, true); + int res = nbc_scatterv_inter_init(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, + comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; } From a38e9e064f9ec2054bde2a4f21e9e54a72e8d99b Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Tue, 22 May 2018 14:23:33 +0900 Subject: [PATCH 16/17] coll: Update COLL module interface version to 2.3.0 Members for persistent operations are added to the module structure in a prior commit. Signed-off-by: KAWASHIMA Takahiro --- ompi/mca/coll/base/coll_base_comm_select.c | 18 +- ompi/mca/coll/coll.h | 256 +++++++++--------- ompi/mca/coll/libnbc/coll_libnbc.h | 148 +++++----- ompi/mca/coll/libnbc/nbc_iallgather.c | 12 +- ompi/mca/coll/libnbc/nbc_iallgatherv.c | 12 +- ompi/mca/coll/libnbc/nbc_iallreduce.c | 12 +- ompi/mca/coll/libnbc/nbc_ialltoall.c | 12 +- ompi/mca/coll/libnbc/nbc_ialltoallv.c | 12 +- ompi/mca/coll/libnbc/nbc_ialltoallw.c | 12 +- ompi/mca/coll/libnbc/nbc_ibarrier.c | 12 +- ompi/mca/coll/libnbc/nbc_ibcast.c | 12 +- ompi/mca/coll/libnbc/nbc_iexscan.c | 6 +- ompi/mca/coll/libnbc/nbc_igather.c | 12 +- ompi/mca/coll/libnbc/nbc_igatherv.c | 12 +- .../mca/coll/libnbc/nbc_ineighbor_allgather.c | 6 +- .../coll/libnbc/nbc_ineighbor_allgatherv.c | 6 +- ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c | 6 +- .../mca/coll/libnbc/nbc_ineighbor_alltoallv.c | 6 +- .../mca/coll/libnbc/nbc_ineighbor_alltoallw.c | 6 +- ompi/mca/coll/libnbc/nbc_ireduce.c | 12 +- ompi/mca/coll/libnbc/nbc_ireduce_scatter.c | 12 +- .../coll/libnbc/nbc_ireduce_scatter_block.c | 12 +- ompi/mca/coll/libnbc/nbc_iscan.c | 6 +- ompi/mca/coll/libnbc/nbc_iscatter.c | 12 +- ompi/mca/coll/libnbc/nbc_iscatterv.c | 12 +- ompi/mca/coll/portals4/coll_portals4.h | 6 +- .../coll/portals4/coll_portals4_allreduce.c | 4 +- .../mca/coll/portals4/coll_portals4_barrier.c | 2 +- ompi/mca/coll/portals4/coll_portals4_reduce.c | 2 +- 29 files changed, 329 insertions(+), 329 deletions(-) diff --git a/ompi/mca/coll/base/coll_base_comm_select.c b/ompi/mca/coll/base/coll_base_comm_select.c index 1d0d9da232..b853f1ad26 100644 --- a/ompi/mca/coll/base/coll_base_comm_select.c +++ b/ompi/mca/coll/base/coll_base_comm_select.c @@ -53,7 +53,7 @@ struct avail_coll_t { opal_list_item_t super; int ac_priority; - mca_coll_base_module_2_2_0_t *ac_module; + mca_coll_base_module_2_3_0_t *ac_module; const char * ac_component_name; }; typedef struct avail_coll_t avail_coll_t; @@ -66,16 +66,16 @@ static opal_list_t *check_components(opal_list_t * components, ompi_communicator_t * comm); static int check_one_component(ompi_communicator_t * comm, const mca_base_component_t * component, - mca_coll_base_module_2_2_0_t ** module); + mca_coll_base_module_2_3_0_t ** module); static int query(const mca_base_component_t * component, ompi_communicator_t * comm, int *priority, - mca_coll_base_module_2_2_0_t ** module); + mca_coll_base_module_2_3_0_t ** module); static int query_2_0_0(const mca_coll_base_component_2_0_0_t * coll_component, ompi_communicator_t * comm, int *priority, - mca_coll_base_module_2_2_0_t ** module); + mca_coll_base_module_2_3_0_t ** module); /* * Stuff for the OBJ interface @@ -330,7 +330,7 @@ static opal_list_t *check_components(opal_list_t * components, int priority; const mca_base_component_t *component; mca_base_component_list_item_t *cli; - mca_coll_base_module_2_2_0_t *module; + mca_coll_base_module_2_3_0_t *module; opal_list_t *selectable; avail_coll_t *avail; @@ -386,7 +386,7 @@ static opal_list_t *check_components(opal_list_t * components, */ static int check_one_component(ompi_communicator_t * comm, const mca_base_component_t * component, - mca_coll_base_module_2_2_0_t ** module) + mca_coll_base_module_2_3_0_t ** module) { int err; int priority = -1; @@ -420,7 +420,7 @@ static int check_one_component(ompi_communicator_t * comm, */ static int query(const mca_base_component_t * component, ompi_communicator_t * comm, - int *priority, mca_coll_base_module_2_2_0_t ** module) + int *priority, mca_coll_base_module_2_3_0_t ** module) { *module = NULL; if (2 == component->mca_type_major_version && @@ -440,9 +440,9 @@ static int query(const mca_base_component_t * component, static int query_2_0_0(const mca_coll_base_component_2_0_0_t * component, ompi_communicator_t * comm, int *priority, - mca_coll_base_module_2_2_0_t ** module) + mca_coll_base_module_2_3_0_t ** module) { - mca_coll_base_module_2_2_0_t *ret; + mca_coll_base_module_2_3_0_t *ret; /* There's currently no need for conversion */ diff --git a/ompi/mca/coll/coll.h b/ompi/mca/coll/coll.h index d8b47bcd31..f852f26732 100644 --- a/ompi/mca/coll/coll.h +++ b/ompi/mca/coll/coll.h @@ -138,7 +138,7 @@ typedef int (*mca_coll_base_component_init_query_fn_t) * provide a module with the requested functionality or NULL if the * component should not be used on the given communicator. */ -typedef struct mca_coll_base_module_2_2_0_t * +typedef struct mca_coll_base_module_2_3_0_t * (*mca_coll_base_component_comm_query_2_0_0_fn_t) (struct ompi_communicator_t *comm, int *priority); @@ -178,7 +178,7 @@ typedef struct mca_coll_base_module_2_2_0_t * * @param[in] comm Communicator being created */ typedef int -(*mca_coll_base_module_enable_1_1_0_fn_t)(struct mca_coll_base_module_2_2_0_t* module, +(*mca_coll_base_module_enable_1_1_0_fn_t)(struct mca_coll_base_module_2_3_0_t* module, struct ompi_communicator_t *comm); @@ -193,225 +193,225 @@ typedef int * @param[in] comm Communicator being disabled */ typedef int -(*mca_coll_base_module_disable_1_2_0_fn_t)(struct mca_coll_base_module_2_2_0_t* module, +(*mca_coll_base_module_disable_1_2_0_fn_t)(struct mca_coll_base_module_2_3_0_t* module, struct ompi_communicator_t *comm); /* blocking collectives */ typedef int (*mca_coll_base_module_allgather_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_allgatherv_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void * rbuf, const int *rcounts, const int *disps, struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_allreduce_fn_t) (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, - struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_alltoall_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_alltoallv_fn_t) (const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t *sdtype, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t *rdtype, - struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_alltoallw_fn_t) (const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, - struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_barrier_fn_t) - (struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + (struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_bcast_fn_t) (void *buff, int count, struct ompi_datatype_t *datatype, int root, - struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_exscan_fn_t) (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, - struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_gather_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, - int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_gatherv_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, const int *rcounts, const int *disps, struct ompi_datatype_t *rdtype, - int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_reduce_fn_t) (const void *sbuf, void* rbuf, int count, struct ompi_datatype_t *dtype, - struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_reduce_scatter_fn_t) (const void *sbuf, void *rbuf, const int *rcounts, struct ompi_datatype_t *dtype, - struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_reduce_scatter_block_fn_t) (const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, - struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_scan_fn_t) (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, - struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_scatter_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, - int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_scatterv_fn_t) (const void *sbuf, const int *scounts, const int *disps, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, - int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); /* nonblocking collectives */ typedef int (*mca_coll_base_module_iallgather_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_iallgatherv_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void * rbuf, const int *rcounts, const int *disps, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_iallreduce_fn_t) (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); + ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_ialltoall_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_ialltoallv_fn_t) (const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t *sdtype, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_ialltoallw_fn_t) (const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_ibarrier_fn_t) (struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_ibcast_fn_t) (void *buff, int count, struct ompi_datatype_t *datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_iexscan_fn_t) (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_igather_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_igatherv_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, const int *rcounts, const int *disps, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_ireduce_fn_t) (const void *sbuf, void* rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_ireduce_scatter_fn_t) (const void *sbuf, void *rbuf, const int *rcounts, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_ireduce_scatter_block_fn_t) (const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_iscan_fn_t) (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_iscatter_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_iscatterv_fn_t) (const void *sbuf, const int *scounts, const int *disps, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); /* persistent collectives */ typedef int (*mca_coll_base_module_allgather_init_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_allgatherv_init_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void * rbuf, const int *rcounts, const int *disps, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_allreduce_init_fn_t) (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); + ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_alltoall_init_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_alltoallv_init_fn_t) (const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t *sdtype, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_alltoallw_init_fn_t) (const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_barrier_init_fn_t) (struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_bcast_init_fn_t) (void *buff, int count, struct ompi_datatype_t *datatype, int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_exscan_init_fn_t) (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_gather_init_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_gatherv_init_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, const int *rcounts, const int *disps, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_reduce_init_fn_t) (const void *sbuf, void* rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_reduce_scatter_init_fn_t) (const void *sbuf, void *rbuf, const int *rcounts, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_reduce_scatter_block_init_fn_t) (const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_scan_init_fn_t) (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_scatter_init_fn_t) (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_scatterv_init_fn_t) (const void *sbuf, const int *scounts, const int *disps, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); /* * The signature of the neighborhood alltoallw differs from alltoallw @@ -419,17 +419,17 @@ typedef int (*mca_coll_base_module_scatterv_init_fn_t) typedef int (*mca_coll_base_module_neighbor_alltoallw_fn_t) (const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rdtypes, - struct ompi_communicator_t *comm, struct mca_coll_base_module_2_2_0_t *module); + struct ompi_communicator_t *comm, struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_ineighbor_alltoallw_fn_t) (const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rdtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); typedef int (*mca_coll_base_module_neighbor_alltoallw_init_fn_t) (const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rdtypes, struct ompi_communicator_t *comm, struct ompi_info_t *info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); /* * reduce_local @@ -440,7 +440,7 @@ typedef int (*mca_coll_base_module_neighbor_alltoallw_init_fn_t) typedef int (*mca_coll_base_module_reduce_local_fn_t) (const void *inbuf, void *inoutbuf, int count, struct ompi_datatype_t * dtype, struct ompi_op_t * op, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); /** @@ -501,7 +501,7 @@ typedef struct mca_coll_base_component_2_0_0_t mca_coll_base_component_t; * function, so the component is free to create a structure that * inherits from this one for use as the module structure. */ -struct mca_coll_base_module_2_2_0_t { +struct mca_coll_base_module_2_3_0_t { /** Collective modules all inherit from opal_object */ opal_object_t super; @@ -602,12 +602,12 @@ struct mca_coll_base_module_2_2_0_t { not be used by other modules */ struct mca_coll_base_comm_t* base_data; }; -typedef struct mca_coll_base_module_2_2_0_t mca_coll_base_module_2_2_0_t; +typedef struct mca_coll_base_module_2_3_0_t mca_coll_base_module_2_3_0_t; /** Per guidence in mca.h, use the unversioned struct name if you just want to always keep up with the most recent version of the interace. */ -typedef struct mca_coll_base_module_2_2_0_t mca_coll_base_module_t; +typedef struct mca_coll_base_module_2_3_0_t mca_coll_base_module_t; OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_coll_base_module_t); /** @@ -623,150 +623,150 @@ struct mca_coll_base_comm_coll_t { /* blocking collectives */ mca_coll_base_module_allgather_fn_t coll_allgather; - mca_coll_base_module_2_2_0_t *coll_allgather_module; + mca_coll_base_module_2_3_0_t *coll_allgather_module; mca_coll_base_module_allgatherv_fn_t coll_allgatherv; - mca_coll_base_module_2_2_0_t *coll_allgatherv_module; + mca_coll_base_module_2_3_0_t *coll_allgatherv_module; mca_coll_base_module_allreduce_fn_t coll_allreduce; - mca_coll_base_module_2_2_0_t *coll_allreduce_module; + mca_coll_base_module_2_3_0_t *coll_allreduce_module; mca_coll_base_module_alltoall_fn_t coll_alltoall; - mca_coll_base_module_2_2_0_t *coll_alltoall_module; + mca_coll_base_module_2_3_0_t *coll_alltoall_module; mca_coll_base_module_alltoallv_fn_t coll_alltoallv; - mca_coll_base_module_2_2_0_t *coll_alltoallv_module; + mca_coll_base_module_2_3_0_t *coll_alltoallv_module; mca_coll_base_module_alltoallw_fn_t coll_alltoallw; - mca_coll_base_module_2_2_0_t *coll_alltoallw_module; + mca_coll_base_module_2_3_0_t *coll_alltoallw_module; mca_coll_base_module_barrier_fn_t coll_barrier; - mca_coll_base_module_2_2_0_t *coll_barrier_module; + mca_coll_base_module_2_3_0_t *coll_barrier_module; mca_coll_base_module_bcast_fn_t coll_bcast; - mca_coll_base_module_2_2_0_t *coll_bcast_module; + mca_coll_base_module_2_3_0_t *coll_bcast_module; mca_coll_base_module_exscan_fn_t coll_exscan; - mca_coll_base_module_2_2_0_t *coll_exscan_module; + mca_coll_base_module_2_3_0_t *coll_exscan_module; mca_coll_base_module_gather_fn_t coll_gather; - mca_coll_base_module_2_2_0_t *coll_gather_module; + mca_coll_base_module_2_3_0_t *coll_gather_module; mca_coll_base_module_gatherv_fn_t coll_gatherv; - mca_coll_base_module_2_2_0_t *coll_gatherv_module; + mca_coll_base_module_2_3_0_t *coll_gatherv_module; mca_coll_base_module_reduce_fn_t coll_reduce; - mca_coll_base_module_2_2_0_t *coll_reduce_module; + mca_coll_base_module_2_3_0_t *coll_reduce_module; mca_coll_base_module_reduce_scatter_fn_t coll_reduce_scatter; - mca_coll_base_module_2_2_0_t *coll_reduce_scatter_module; + mca_coll_base_module_2_3_0_t *coll_reduce_scatter_module; mca_coll_base_module_reduce_scatter_block_fn_t coll_reduce_scatter_block; - mca_coll_base_module_2_2_0_t *coll_reduce_scatter_block_module; + mca_coll_base_module_2_3_0_t *coll_reduce_scatter_block_module; mca_coll_base_module_scan_fn_t coll_scan; - mca_coll_base_module_2_2_0_t *coll_scan_module; + mca_coll_base_module_2_3_0_t *coll_scan_module; mca_coll_base_module_scatter_fn_t coll_scatter; - mca_coll_base_module_2_2_0_t *coll_scatter_module; + mca_coll_base_module_2_3_0_t *coll_scatter_module; mca_coll_base_module_scatterv_fn_t coll_scatterv; - mca_coll_base_module_2_2_0_t *coll_scatterv_module; + mca_coll_base_module_2_3_0_t *coll_scatterv_module; /* nonblocking collectives */ mca_coll_base_module_iallgather_fn_t coll_iallgather; - mca_coll_base_module_2_2_0_t *coll_iallgather_module; + mca_coll_base_module_2_3_0_t *coll_iallgather_module; mca_coll_base_module_iallgatherv_fn_t coll_iallgatherv; - mca_coll_base_module_2_2_0_t *coll_iallgatherv_module; + mca_coll_base_module_2_3_0_t *coll_iallgatherv_module; mca_coll_base_module_iallreduce_fn_t coll_iallreduce; - mca_coll_base_module_2_2_0_t *coll_iallreduce_module; + mca_coll_base_module_2_3_0_t *coll_iallreduce_module; mca_coll_base_module_ialltoall_fn_t coll_ialltoall; - mca_coll_base_module_2_2_0_t *coll_ialltoall_module; + mca_coll_base_module_2_3_0_t *coll_ialltoall_module; mca_coll_base_module_ialltoallv_fn_t coll_ialltoallv; - mca_coll_base_module_2_2_0_t *coll_ialltoallv_module; + mca_coll_base_module_2_3_0_t *coll_ialltoallv_module; mca_coll_base_module_ialltoallw_fn_t coll_ialltoallw; - mca_coll_base_module_2_2_0_t *coll_ialltoallw_module; + mca_coll_base_module_2_3_0_t *coll_ialltoallw_module; mca_coll_base_module_ibarrier_fn_t coll_ibarrier; - mca_coll_base_module_2_2_0_t *coll_ibarrier_module; + mca_coll_base_module_2_3_0_t *coll_ibarrier_module; mca_coll_base_module_ibcast_fn_t coll_ibcast; - mca_coll_base_module_2_2_0_t *coll_ibcast_module; + mca_coll_base_module_2_3_0_t *coll_ibcast_module; mca_coll_base_module_iexscan_fn_t coll_iexscan; - mca_coll_base_module_2_2_0_t *coll_iexscan_module; + mca_coll_base_module_2_3_0_t *coll_iexscan_module; mca_coll_base_module_igather_fn_t coll_igather; - mca_coll_base_module_2_2_0_t *coll_igather_module; + mca_coll_base_module_2_3_0_t *coll_igather_module; mca_coll_base_module_igatherv_fn_t coll_igatherv; - mca_coll_base_module_2_2_0_t *coll_igatherv_module; + mca_coll_base_module_2_3_0_t *coll_igatherv_module; mca_coll_base_module_ireduce_fn_t coll_ireduce; - mca_coll_base_module_2_2_0_t *coll_ireduce_module; + mca_coll_base_module_2_3_0_t *coll_ireduce_module; mca_coll_base_module_ireduce_scatter_fn_t coll_ireduce_scatter; - mca_coll_base_module_2_2_0_t *coll_ireduce_scatter_module; + mca_coll_base_module_2_3_0_t *coll_ireduce_scatter_module; mca_coll_base_module_ireduce_scatter_block_fn_t coll_ireduce_scatter_block; - mca_coll_base_module_2_2_0_t *coll_ireduce_scatter_block_module; + mca_coll_base_module_2_3_0_t *coll_ireduce_scatter_block_module; mca_coll_base_module_iscan_fn_t coll_iscan; - mca_coll_base_module_2_2_0_t *coll_iscan_module; + mca_coll_base_module_2_3_0_t *coll_iscan_module; mca_coll_base_module_iscatter_fn_t coll_iscatter; - mca_coll_base_module_2_2_0_t *coll_iscatter_module; + mca_coll_base_module_2_3_0_t *coll_iscatter_module; mca_coll_base_module_iscatterv_fn_t coll_iscatterv; - mca_coll_base_module_2_2_0_t *coll_iscatterv_module; + mca_coll_base_module_2_3_0_t *coll_iscatterv_module; /* persistent collectives */ mca_coll_base_module_allgather_init_fn_t coll_allgather_init; - mca_coll_base_module_2_2_0_t *coll_allgather_init_module; + mca_coll_base_module_2_3_0_t *coll_allgather_init_module; mca_coll_base_module_allgatherv_init_fn_t coll_allgatherv_init; - mca_coll_base_module_2_2_0_t *coll_allgatherv_init_module; + mca_coll_base_module_2_3_0_t *coll_allgatherv_init_module; mca_coll_base_module_allreduce_init_fn_t coll_allreduce_init; - mca_coll_base_module_2_2_0_t *coll_allreduce_init_module; + mca_coll_base_module_2_3_0_t *coll_allreduce_init_module; mca_coll_base_module_alltoall_init_fn_t coll_alltoall_init; - mca_coll_base_module_2_2_0_t *coll_alltoall_init_module; + mca_coll_base_module_2_3_0_t *coll_alltoall_init_module; mca_coll_base_module_alltoallv_init_fn_t coll_alltoallv_init; - mca_coll_base_module_2_2_0_t *coll_alltoallv_init_module; + mca_coll_base_module_2_3_0_t *coll_alltoallv_init_module; mca_coll_base_module_alltoallw_init_fn_t coll_alltoallw_init; - mca_coll_base_module_2_2_0_t *coll_alltoallw_init_module; + mca_coll_base_module_2_3_0_t *coll_alltoallw_init_module; mca_coll_base_module_barrier_init_fn_t coll_barrier_init; - mca_coll_base_module_2_2_0_t *coll_barrier_init_module; + mca_coll_base_module_2_3_0_t *coll_barrier_init_module; mca_coll_base_module_bcast_init_fn_t coll_bcast_init; - mca_coll_base_module_2_2_0_t *coll_bcast_init_module; + mca_coll_base_module_2_3_0_t *coll_bcast_init_module; mca_coll_base_module_exscan_init_fn_t coll_exscan_init; - mca_coll_base_module_2_2_0_t *coll_exscan_init_module; + mca_coll_base_module_2_3_0_t *coll_exscan_init_module; mca_coll_base_module_gather_init_fn_t coll_gather_init; - mca_coll_base_module_2_2_0_t *coll_gather_init_module; + mca_coll_base_module_2_3_0_t *coll_gather_init_module; mca_coll_base_module_gatherv_init_fn_t coll_gatherv_init; - mca_coll_base_module_2_2_0_t *coll_gatherv_init_module; + mca_coll_base_module_2_3_0_t *coll_gatherv_init_module; mca_coll_base_module_reduce_init_fn_t coll_reduce_init; - mca_coll_base_module_2_2_0_t *coll_reduce_init_module; + mca_coll_base_module_2_3_0_t *coll_reduce_init_module; mca_coll_base_module_reduce_scatter_init_fn_t coll_reduce_scatter_init; - mca_coll_base_module_2_2_0_t *coll_reduce_scatter_init_module; + mca_coll_base_module_2_3_0_t *coll_reduce_scatter_init_module; mca_coll_base_module_reduce_scatter_block_init_fn_t coll_reduce_scatter_block_init; - mca_coll_base_module_2_2_0_t *coll_reduce_scatter_block_init_module; + mca_coll_base_module_2_3_0_t *coll_reduce_scatter_block_init_module; mca_coll_base_module_scan_init_fn_t coll_scan_init; - mca_coll_base_module_2_2_0_t *coll_scan_init_module; + mca_coll_base_module_2_3_0_t *coll_scan_init_module; mca_coll_base_module_scatter_init_fn_t coll_scatter_init; - mca_coll_base_module_2_2_0_t *coll_scatter_init_module; + mca_coll_base_module_2_3_0_t *coll_scatter_init_module; mca_coll_base_module_scatterv_init_fn_t coll_scatterv_init; - mca_coll_base_module_2_2_0_t *coll_scatterv_init_module; + mca_coll_base_module_2_3_0_t *coll_scatterv_init_module; /* blocking neighborhood collectives */ mca_coll_base_module_allgather_fn_t coll_neighbor_allgather; - mca_coll_base_module_2_2_0_t *coll_neighbor_allgather_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_allgather_module; mca_coll_base_module_allgatherv_fn_t coll_neighbor_allgatherv; - mca_coll_base_module_2_2_0_t *coll_neighbor_allgatherv_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_allgatherv_module; mca_coll_base_module_alltoall_fn_t coll_neighbor_alltoall; - mca_coll_base_module_2_2_0_t *coll_neighbor_alltoall_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_alltoall_module; mca_coll_base_module_alltoallv_fn_t coll_neighbor_alltoallv; - mca_coll_base_module_2_2_0_t *coll_neighbor_alltoallv_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_alltoallv_module; mca_coll_base_module_neighbor_alltoallw_fn_t coll_neighbor_alltoallw; - mca_coll_base_module_2_2_0_t *coll_neighbor_alltoallw_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_alltoallw_module; /* nonblocking neighborhood collectives */ mca_coll_base_module_iallgather_fn_t coll_ineighbor_allgather; - mca_coll_base_module_2_2_0_t *coll_ineighbor_allgather_module; + mca_coll_base_module_2_3_0_t *coll_ineighbor_allgather_module; mca_coll_base_module_iallgatherv_fn_t coll_ineighbor_allgatherv; - mca_coll_base_module_2_2_0_t *coll_ineighbor_allgatherv_module; + mca_coll_base_module_2_3_0_t *coll_ineighbor_allgatherv_module; mca_coll_base_module_ialltoall_fn_t coll_ineighbor_alltoall; - mca_coll_base_module_2_2_0_t *coll_ineighbor_alltoall_module; + mca_coll_base_module_2_3_0_t *coll_ineighbor_alltoall_module; mca_coll_base_module_ialltoallv_fn_t coll_ineighbor_alltoallv; - mca_coll_base_module_2_2_0_t *coll_ineighbor_alltoallv_module; + mca_coll_base_module_2_3_0_t *coll_ineighbor_alltoallv_module; mca_coll_base_module_ineighbor_alltoallw_fn_t coll_ineighbor_alltoallw; - mca_coll_base_module_2_2_0_t *coll_ineighbor_alltoallw_module; + mca_coll_base_module_2_3_0_t *coll_ineighbor_alltoallw_module; /* persistent neighborhood collectives */ mca_coll_base_module_allgather_init_fn_t coll_neighbor_allgather_init; - mca_coll_base_module_2_2_0_t *coll_neighbor_allgather_init_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_allgather_init_module; mca_coll_base_module_allgatherv_init_fn_t coll_neighbor_allgatherv_init; - mca_coll_base_module_2_2_0_t *coll_neighbor_allgatherv_init_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_allgatherv_init_module; mca_coll_base_module_alltoall_init_fn_t coll_neighbor_alltoall_init; - mca_coll_base_module_2_2_0_t *coll_neighbor_alltoall_init_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_alltoall_init_module; mca_coll_base_module_alltoallv_init_fn_t coll_neighbor_alltoallv_init; - mca_coll_base_module_2_2_0_t *coll_neighbor_alltoallv_init_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_alltoallv_init_module; mca_coll_base_module_neighbor_alltoallw_init_fn_t coll_neighbor_alltoallw_init; - mca_coll_base_module_2_2_0_t *coll_neighbor_alltoallw_init_module; + mca_coll_base_module_2_3_0_t *coll_neighbor_alltoallw_init_module; mca_coll_base_module_reduce_local_fn_t coll_reduce_local; - mca_coll_base_module_2_2_0_t *coll_reduce_local_module; + mca_coll_base_module_2_3_0_t *coll_reduce_local_module; }; typedef struct mca_coll_base_comm_coll_t mca_coll_base_comm_coll_t; diff --git a/ompi/mca/coll/libnbc/coll_libnbc.h b/ompi/mca/coll/libnbc/coll_libnbc.h index dba87225bb..967a779425 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc.h +++ b/ompi/mca/coll/libnbc/coll_libnbc.h @@ -157,258 +157,258 @@ int NBC_Progress(NBC_Handle *handle); int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ialltoallw(const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, struct ompi_communicator_t *comm, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iexscan(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ireduce_scatter(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ireduce_scatter_block(const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iscatter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ialltoall_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ialltoallv_inter(const void* sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ialltoallw_inter(const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, struct ompi_communicator_t *comm, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_igather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_igatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ireduce_scatter_inter(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ireduce_scatter_block_inter(const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iscatter_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_iscatterv_inter(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); + ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); + ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_allreduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_alltoall_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_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, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_alltoallw_init(const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_barrier_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_exscan_init(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_reduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_reduce_scatter_block_init(const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_scan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_scatter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_scatterv_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_allgatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_allreduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_alltoall_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_alltoallv_inter_init(const void* sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_alltoallw_inter_init(const void *sbuf, const int *scounts, const int *sdisps, struct ompi_datatype_t * const *sdtypes, void *rbuf, const int *rcounts, const int *rdisps, struct ompi_datatype_t * const *rdtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_barrier_inter_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_bcast_inter_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_gather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_gatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_reduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_reduce_scatter_inter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_reduce_scatter_block_inter_init(const void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_scatter_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_scatterv_inter_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); + MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_neighbor_allgatherv_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_neighbor_alltoall_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module); + ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_neighbor_alltoallv_init(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_libnbc_neighbor_alltoallw_init(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); END_C_DECLS diff --git a/ompi/mca/coll/libnbc/nbc_iallgather.c b/ompi/mca/coll/libnbc/nbc_iallgather.c index cb87a645e2..e7a9104fba 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgather.c +++ b/ompi/mca/coll/libnbc/nbc_iallgather.c @@ -46,7 +46,7 @@ int NBC_Allgather_args_compare(NBC_Allgather_args *a, NBC_Allgather_args *b, voi * each node receives from it's left (modulo p) neighbor */ static int nbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; MPI_Aint rcvext; @@ -176,7 +176,7 @@ static int nbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype s int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allgather_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module, false); @@ -196,7 +196,7 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype static int nbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext; @@ -253,7 +253,7 @@ static int nbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Data int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allgather_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -272,7 +272,7 @@ int ompi_coll_libnbc_iallgather_inter(const void* sendbuf, int sendcount, MPI_Da int ompi_coll_libnbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allgather_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -284,7 +284,7 @@ int ompi_coll_libnbc_allgather_init(const void* sendbuf, int sendcount, MPI_Data int ompi_coll_libnbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allgather_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_iallgatherv.c b/ompi/mca/coll/libnbc/nbc_iallgatherv.c index 83dc8af5d4..500a29dd6c 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_iallgatherv.c @@ -36,7 +36,7 @@ * each node receives from node (rank-2)%p recvcounts[(rank+2)%p] elements */ static int nbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res, speer, rpeer; MPI_Aint rcvext; @@ -121,7 +121,7 @@ static int nbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Datatype int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allgatherv_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -140,7 +140,7 @@ int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatyp static int nbc_allgatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext; @@ -200,7 +200,7 @@ static int nbc_allgatherv_inter_init(const void* sendbuf, int sendcount, MPI_Dat int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allgatherv_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -219,7 +219,7 @@ int ompi_coll_libnbc_iallgatherv_inter(const void* sendbuf, int sendcount, MPI_D int ompi_coll_libnbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allgatherv_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -231,7 +231,7 @@ int ompi_coll_libnbc_allgatherv_init(const void* sendbuf, int sendcount, MPI_Dat int ompi_coll_libnbc_allgatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allgatherv_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_iallreduce.c b/ompi/mca/coll/libnbc/nbc_iallreduce.c index 9bfb294396..f61b5fbb93 100644 --- a/ompi/mca/coll/libnbc/nbc_iallreduce.c +++ b/ompi/mca/coll/libnbc/nbc_iallreduce.c @@ -55,7 +55,7 @@ int NBC_Allreduce_args_compare(NBC_Allreduce_args *a, NBC_Allreduce_args *b, voi static int nbc_allreduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; ptrdiff_t ext, lb; @@ -197,7 +197,7 @@ static int nbc_allreduce_init(const void* sendbuf, void* recvbuf, int count, MPI int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allreduce_init(sendbuf, recvbuf, count, datatype, op, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -216,7 +216,7 @@ int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, M static int nbc_allreduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, res, rsize; size_t size; @@ -280,7 +280,7 @@ static int nbc_allreduce_inter_init(const void* sendbuf, void* recvbuf, int coun int ompi_coll_libnbc_iallreduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allreduce_inter_init(sendbuf, recvbuf, count, datatype, op, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -737,7 +737,7 @@ static inline int allred_sched_linear(int rank, int rsize, const void *sendbuf, int ompi_coll_libnbc_allreduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allreduce_init(sendbuf, recvbuf, count, datatype, op, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -749,7 +749,7 @@ int ompi_coll_libnbc_allreduce_init(const void* sendbuf, void* recvbuf, int coun int ompi_coll_libnbc_allreduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_allreduce_inter_init(sendbuf, recvbuf, count, datatype, op, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ialltoall.c b/ompi/mca/coll/libnbc/nbc_ialltoall.c index 9f83a08b5c..f51562708e 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoall.c @@ -56,7 +56,7 @@ int NBC_Alltoall_args_compare(NBC_Alltoall_args *a, NBC_Alltoall_args *b, void * /* simple linear MPI_Ialltoall the (simple) algorithm just sends to all nodes */ static int nbc_alltoall_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res, datasize; size_t a2asize, sndsize; @@ -283,7 +283,7 @@ static int nbc_alltoall_init(const void* sendbuf, int sendcount, MPI_Datatype se int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoall_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -302,7 +302,7 @@ int ompi_coll_libnbc_ialltoall(const void* sendbuf, int sendcount, MPI_Datatype static int nbc_alltoall_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext, rcvext; @@ -367,7 +367,7 @@ static int nbc_alltoall_inter_init (const void* sendbuf, int sendcount, MPI_Data int ompi_coll_libnbc_ialltoall_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoall_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -592,7 +592,7 @@ static inline int a2a_sched_inplace(int rank, int p, NBC_Schedule* schedule, voi int ompi_coll_libnbc_alltoall_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoall_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -604,7 +604,7 @@ int ompi_coll_libnbc_alltoall_init (const void* sendbuf, int sendcount, MPI_Data int ompi_coll_libnbc_alltoall_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoall_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallv.c b/ompi/mca/coll/libnbc/nbc_ialltoallv.c index 1f3d4230d5..2c433d0611 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallv.c @@ -44,7 +44,7 @@ static inline int a2av_sched_inplace(int rank, int p, NBC_Schedule *schedule, static int nbc_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, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; MPI_Aint sndext, rcvext; @@ -143,7 +143,7 @@ static int nbc_alltoallv_init(const void* sendbuf, const int *sendcounts, const int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoallv_init(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm, request, module, false); @@ -165,7 +165,7 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons static int nbc_alltoallv_inter_init (const void* sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext, rcvext; @@ -231,7 +231,7 @@ static int nbc_alltoallv_inter_init (const void* sendbuf, const int *sendcounts, int ompi_coll_libnbc_ialltoallv_inter (const void* sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoallv_inter_init(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm, request, module, false); @@ -391,7 +391,7 @@ static inline int a2av_sched_inplace(int rank, int p, NBC_Schedule *schedule, int ompi_coll_libnbc_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, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoallv_init(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -404,7 +404,7 @@ int ompi_coll_libnbc_alltoallv_init(const void* sendbuf, const int *sendcounts, int ompi_coll_libnbc_alltoallv_inter_init(const void* sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoallv_inter_init(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ialltoallw.c b/ompi/mca/coll/libnbc/nbc_ialltoallw.c index 38a69d3b70..366c0aa752 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoallw.c @@ -44,7 +44,7 @@ static inline int a2aw_sched_inplace(int rank, int p, NBC_Schedule *schedule, static int nbc_alltoallw_init(const void* sendbuf, const int *sendcounts, const int *sdispls, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; NBC_Schedule *schedule; @@ -129,7 +129,7 @@ static int nbc_alltoallw_init(const void* sendbuf, const int *sendcounts, const int ompi_coll_libnbc_ialltoallw(const void* sendbuf, const int *sendcounts, const int *sdispls, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoallw_init(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, request, module, false); @@ -151,7 +151,7 @@ int ompi_coll_libnbc_ialltoallw(const void* sendbuf, const int *sendcounts, cons static int nbc_alltoallw_inter_init (const void* sendbuf, const int *sendcounts, const int *sdispls, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, rsize; NBC_Schedule *schedule; @@ -204,7 +204,7 @@ static int nbc_alltoallw_inter_init (const void* sendbuf, const int *sendcounts, int ompi_coll_libnbc_ialltoallw_inter(const void* sendbuf, const int *sendcounts, const int *sdispls, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoallw_inter_init(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, request, module, false); @@ -365,7 +365,7 @@ static inline int a2aw_sched_inplace(int rank, int p, NBC_Schedule *schedule, int ompi_coll_libnbc_alltoallw_init(const void* sendbuf, const int *sendcounts, const int *sdispls, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoallw_init(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -378,7 +378,7 @@ int ompi_coll_libnbc_alltoallw_init(const void* sendbuf, const int *sendcounts, int ompi_coll_libnbc_alltoallw_inter_init(const void* sendbuf, const int *sendcounts, const int *sdispls, struct ompi_datatype_t * const *sendtypes, void* recvbuf, const int *recvcounts, const int *rdispls, struct ompi_datatype_t * const *recvtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_alltoallw_inter_init(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ibarrier.c b/ompi/mca/coll/libnbc/nbc_ibarrier.c index 6b86a5ac64..bed454b859 100644 --- a/ompi/mca/coll/libnbc/nbc_ibarrier.c +++ b/ompi/mca/coll/libnbc/nbc_ibarrier.c @@ -23,7 +23,7 @@ /* Dissemination implementation of MPI_Ibarrier */ static int nbc_barrier_init(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, maxround, res, recvpeer, sendpeer; NBC_Schedule *schedule; @@ -100,7 +100,7 @@ static int nbc_barrier_init(struct ompi_communicator_t *comm, ompi_request_t ** } int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_barrier_init(comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; @@ -117,7 +117,7 @@ int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t * } static int nbc_barrier_inter_init(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, res, rsize; NBC_Schedule *schedule; @@ -187,7 +187,7 @@ static int nbc_barrier_inter_init(struct ompi_communicator_t *comm, ompi_request } int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_barrier_inter_init(comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; @@ -204,7 +204,7 @@ int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_reque } int ompi_coll_libnbc_barrier_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_barrier_init(comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; @@ -214,7 +214,7 @@ int ompi_coll_libnbc_barrier_init(struct ompi_communicator_t *comm, MPI_Info inf } int ompi_coll_libnbc_barrier_inter_init(struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_barrier_inter_init(comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; diff --git a/ompi/mca/coll/libnbc/nbc_ibcast.c b/ompi/mca/coll/libnbc/nbc_ibcast.c index 140a56af08..8f2ecd64c1 100644 --- a/ompi/mca/coll/libnbc/nbc_ibcast.c +++ b/ompi/mca/coll/libnbc/nbc_ibcast.c @@ -47,7 +47,7 @@ int NBC_Bcast_args_compare(NBC_Bcast_args *a, NBC_Bcast_args *b, void *param) { static int nbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res, segsize; size_t size; @@ -173,7 +173,7 @@ static int nbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int ro int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_bcast_init(buffer, count, datatype, root, comm, request, module, false); @@ -344,7 +344,7 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch static int nbc_bcast_inter_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res; NBC_Schedule *schedule; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -396,7 +396,7 @@ static int nbc_bcast_inter_init(void *buffer, int count, MPI_Datatype datatype, int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_bcast_inter_init(buffer, count, datatype, root, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -415,7 +415,7 @@ int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype int ompi_coll_libnbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_bcast_init(buffer, count, datatype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -427,7 +427,7 @@ int ompi_coll_libnbc_bcast_init(void *buffer, int count, MPI_Datatype datatype, int ompi_coll_libnbc_bcast_inter_init(void *buffer, int count, MPI_Datatype datatype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_bcast_inter_init(buffer, count, datatype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_iexscan.c b/ompi/mca/coll/libnbc/nbc_iexscan.c index 6d12666f57..7cc8c7f4e6 100644 --- a/ompi/mca/coll/libnbc/nbc_iexscan.c +++ b/ompi/mca/coll/libnbc/nbc_iexscan.c @@ -48,7 +48,7 @@ int NBC_Scan_args_compare(NBC_Scan_args *a, NBC_Scan_args *b, void *param) { */ static int nbc_exscan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; ptrdiff_t gap, span; NBC_Schedule *schedule; @@ -196,7 +196,7 @@ static int nbc_exscan_init(const void* sendbuf, void* recvbuf, int count, MPI_Da int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_exscan_init(sendbuf, recvbuf, count, datatype, op, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -215,7 +215,7 @@ int ompi_coll_libnbc_iexscan(const void* sendbuf, void* recvbuf, int count, MPI_ int ompi_coll_libnbc_exscan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_exscan_init(sendbuf, recvbuf, count, datatype, op, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_igather.c b/ompi/mca/coll/libnbc/nbc_igather.c index d897c7b95f..521d583af8 100644 --- a/ompi/mca/coll/libnbc/nbc_igather.c +++ b/ompi/mca/coll/libnbc/nbc_igather.c @@ -47,7 +47,7 @@ int NBC_Gather_args_compare(NBC_Gather_args *a, NBC_Gather_args *b, void *param) static int nbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -176,7 +176,7 @@ static int nbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatype send int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_gather_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -196,7 +196,7 @@ int ompi_coll_libnbc_igather(const void* sendbuf, int sendcount, MPI_Datatype se static int nbc_gather_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -256,7 +256,7 @@ static int nbc_gather_inter_init (const void* sendbuf, int sendcount, MPI_Dataty int ompi_coll_libnbc_igather_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_gather_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -276,7 +276,7 @@ int ompi_coll_libnbc_igather_inter(const void* sendbuf, int sendcount, MPI_Datat int ompi_coll_libnbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_gather_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -289,7 +289,7 @@ int ompi_coll_libnbc_gather_init(const void* sendbuf, int sendcount, MPI_Datatyp int ompi_coll_libnbc_gather_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_gather_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_igatherv.c b/ompi/mca/coll/libnbc/nbc_igatherv.c index eac3fa65da..0fe0fbfd80 100644 --- a/ompi/mca/coll/libnbc/nbc_igatherv.c +++ b/ompi/mca/coll/libnbc/nbc_igatherv.c @@ -32,7 +32,7 @@ static int nbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; MPI_Aint rcvext = 0; NBC_Schedule *schedule; @@ -108,7 +108,7 @@ static int nbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sen int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_gatherv_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -128,7 +128,7 @@ int ompi_coll_libnbc_igatherv(const void* sendbuf, int sendcount, MPI_Datatype s static int nbc_gatherv_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, rsize; MPI_Aint rcvext; NBC_Schedule *schedule; @@ -188,7 +188,7 @@ static int nbc_gatherv_inter_init (const void* sendbuf, int sendcount, MPI_Datat int ompi_coll_libnbc_igatherv_inter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_gatherv_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request, module, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -208,7 +208,7 @@ int ompi_coll_libnbc_igatherv_inter(const void* sendbuf, int sendcount, MPI_Data int ompi_coll_libnbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_gatherv_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -221,7 +221,7 @@ int ompi_coll_libnbc_gatherv_init(const void* sendbuf, int sendcount, MPI_Dataty int ompi_coll_libnbc_gatherv_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_gatherv_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c index cff0d4d956..9835b0f5a0 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c @@ -47,7 +47,7 @@ int NBC_Ineighbor_allgather_args_compare(NBC_Ineighbor_allgather_args *a, NBC_In static int nbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -165,7 +165,7 @@ static int nbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatyp int ompi_coll_libnbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_allgather_init(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -335,7 +335,7 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch int ompi_coll_libnbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + MPI_Info info, ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_allgather_init(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c index fd034bd761..649349b751 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgatherv.c @@ -47,7 +47,7 @@ int NBC_Ineighbor_allgatherv_args_compare(NBC_Ineighbor_allgatherv_args *a, NBC_ static int nbc_neighbor_allgatherv_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -167,7 +167,7 @@ static int nbc_neighbor_allgatherv_init(const void *sbuf, int scount, MPI_Dataty int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_allgatherv_init(sbuf, scount, stype, rbuf, rcounts, displs, rtype, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -186,7 +186,7 @@ int ompi_coll_libnbc_ineighbor_allgatherv(const void *sbuf, int scount, MPI_Data int ompi_coll_libnbc_neighbor_allgatherv_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *displs, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_allgatherv_init(sbuf, scount, stype, rbuf, rcounts, displs, rtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c index 77a4d3c22c..c24a8781bd 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoall.c @@ -44,7 +44,7 @@ int NBC_Ineighbor_alltoall_args_compare(NBC_Ineighbor_alltoall_args *a, NBC_Inei static int nbc_neighbor_alltoall_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint sndext, rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -169,7 +169,7 @@ static int nbc_neighbor_alltoall_init(const void *sbuf, int scount, MPI_Datatype int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_alltoall_init(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -187,7 +187,7 @@ int ompi_coll_libnbc_ineighbor_alltoall(const void *sbuf, int scount, MPI_Dataty int ompi_coll_libnbc_neighbor_alltoall_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, - ompi_request_t ** request, struct mca_coll_base_module_2_2_0_t *module) { + ompi_request_t ** request, struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_alltoall_init(sbuf, scount, stype, rbuf, rcount, rtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c index c7fe1ac3b7..58307dbd43 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallv.c @@ -47,7 +47,7 @@ int NBC_Ineighbor_alltoallv_args_compare(NBC_Ineighbor_alltoallv_args *a, NBC_In static int nbc_neighbor_alltoallv_init(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; MPI_Aint sndext, rcvext; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -174,7 +174,7 @@ static int nbc_neighbor_alltoallv_init(const void *sbuf, const int *scounts, con int ompi_coll_libnbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_alltoallv_init(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -193,7 +193,7 @@ int ompi_coll_libnbc_ineighbor_alltoallv(const void *sbuf, const int *scounts, c int ompi_coll_libnbc_neighbor_alltoallv_init(const void *sbuf, const int *scounts, const int *sdispls, MPI_Datatype stype, void *rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rtype, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_alltoallv_init(sbuf, scounts, sdispls, stype, rbuf, rcounts, rdispls, rtype, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c index 008cce4492..adc0ba3ae5 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_alltoallw.c @@ -46,7 +46,7 @@ int NBC_Ineighbor_alltoallw_args_compare(NBC_Ineighbor_alltoallw_args *a, NBC_In static int nbc_neighbor_alltoallw_init(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, indegree, outdegree, *srcs, *dsts; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; NBC_Schedule *schedule; @@ -159,7 +159,7 @@ static int nbc_neighbor_alltoallw_init(const void *sbuf, const int *scounts, con int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_alltoallw_init(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -178,7 +178,7 @@ int ompi_coll_libnbc_ineighbor_alltoallw(const void *sbuf, const int *scounts, c int ompi_coll_libnbc_neighbor_alltoallw_init(const void *sbuf, const int *scounts, const MPI_Aint *sdisps, struct ompi_datatype_t * const *stypes, void *rbuf, const int *rcounts, const MPI_Aint *rdisps, struct ompi_datatype_t * const *rtypes, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_neighbor_alltoallw_init(sbuf, scounts, sdisps, stypes, rbuf, rcounts, rdisps, rtypes, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ireduce.c b/ompi/mca/coll/libnbc/nbc_ireduce.c index 185571b889..d4bcb62e06 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce.c @@ -55,7 +55,7 @@ int NBC_Reduce_args_compare(NBC_Reduce_args *a, NBC_Reduce_args *b, void *param) /* the non-blocking reduce */ static int nbc_reduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res, segsize; size_t size; MPI_Aint ext; @@ -210,7 +210,7 @@ static int nbc_reduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Da int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_init(sendbuf, recvbuf, count, datatype, op, root, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -228,7 +228,7 @@ int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_ static int nbc_reduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, res, rsize; NBC_Schedule *schedule; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; @@ -276,7 +276,7 @@ static int nbc_reduce_inter_init(const void* sendbuf, void* recvbuf, int count, int ompi_coll_libnbc_ireduce_inter(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_inter_init(sendbuf, recvbuf, count, datatype, op, root, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -562,7 +562,7 @@ static inline int red_sched_linear (int rank, int rsize, int root, const void *s int ompi_coll_libnbc_reduce_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_init(sendbuf, recvbuf, count, datatype, op, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -574,7 +574,7 @@ int ompi_coll_libnbc_reduce_init(const void* sendbuf, void* recvbuf, int count, int ompi_coll_libnbc_reduce_inter_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_inter_init(sendbuf, recvbuf, count, datatype, op, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c index 118717e938..3b318ea1d3 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter.c @@ -44,7 +44,7 @@ static int nbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int peer, rank, maxr, p, res, count; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -211,7 +211,7 @@ static int nbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, const int int ompi_coll_libnbc_ireduce_scatter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_scatter_init(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -228,7 +228,7 @@ int ompi_coll_libnbc_ireduce_scatter (const void* sendbuf, void* recvbuf, const } static int nbc_reduce_scatter_inter_init (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, res, count, lsize, rsize; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -353,7 +353,7 @@ static int nbc_reduce_scatter_inter_init (const void* sendbuf, void* recvbuf, co int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_scatter_inter_init(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -371,7 +371,7 @@ int ompi_coll_libnbc_ireduce_scatter_inter (const void* sendbuf, void* recvbuf, int ompi_coll_libnbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_scatter_init(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -383,7 +383,7 @@ int ompi_coll_libnbc_reduce_scatter_init(const void* sendbuf, void* recvbuf, con int ompi_coll_libnbc_reduce_scatter_inter_init(const void* sendbuf, void* recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_scatter_inter_init(sendbuf, recvbuf, recvcounts, datatype, op, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c index 07ac5d73c9..6553b44d63 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce_scatter_block.c @@ -42,7 +42,7 @@ static int nbc_reduce_scatter_block_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int peer, rank, maxr, p, res, count; MPI_Aint ext; ptrdiff_t gap, span; @@ -209,7 +209,7 @@ static int nbc_reduce_scatter_block_init(const void* sendbuf, void* recvbuf, int int ompi_coll_libnbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_scatter_block_init(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -227,7 +227,7 @@ int ompi_coll_libnbc_ireduce_scatter_block(const void* sendbuf, void* recvbuf, i static int nbc_reduce_scatter_block_inter_init(const void *sendbuf, void *recvbuf, int rcount, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, res, count, lsize, rsize; MPI_Aint ext; ptrdiff_t gap, span, span_align; @@ -348,7 +348,7 @@ static int nbc_reduce_scatter_block_inter_init(const void *sendbuf, void *recvbu int ompi_coll_libnbc_ireduce_scatter_block_inter(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_scatter_block_inter_init(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -366,7 +366,7 @@ int ompi_coll_libnbc_ireduce_scatter_block_inter(const void* sendbuf, void* recv int ompi_coll_libnbc_reduce_scatter_block_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_scatter_block_init(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -378,7 +378,7 @@ int ompi_coll_libnbc_reduce_scatter_block_init(const void* sendbuf, void* recvbu int ompi_coll_libnbc_reduce_scatter_block_inter_init(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_reduce_scatter_block_inter_init(sendbuf, recvbuf, recvcount, datatype, op, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_iscan.c b/ompi/mca/coll/libnbc/nbc_iscan.c index 43199bcdf0..4d4f3677b7 100644 --- a/ompi/mca/coll/libnbc/nbc_iscan.c +++ b/ompi/mca/coll/libnbc/nbc_iscan.c @@ -48,7 +48,7 @@ int NBC_Scan_args_compare(NBC_Scan_args *a, NBC_Scan_args *b, void *param) { */ static int nbc_scan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; ptrdiff_t gap, span; NBC_Schedule *schedule; @@ -174,7 +174,7 @@ static int nbc_scan_init(const void* sendbuf, void* recvbuf, int count, MPI_Data int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scan_init(sendbuf, recvbuf, count, datatype, op, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -192,7 +192,7 @@ int ompi_coll_libnbc_iscan(const void* sendbuf, void* recvbuf, int count, MPI_Da int ompi_coll_libnbc_scan_init(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scan_init(sendbuf, recvbuf, count, datatype, op, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_iscatter.c b/ompi/mca/coll/libnbc/nbc_iscatter.c index a0b0169636..a7bbb42b66 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatter.c +++ b/ompi/mca/coll/libnbc/nbc_iscatter.c @@ -48,7 +48,7 @@ int NBC_Scatter_args_compare(NBC_Scatter_args *a, NBC_Scatter_args *b, void *par static int nbc_scatter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; MPI_Aint sndext = 0; NBC_Schedule *schedule; @@ -171,7 +171,7 @@ static int nbc_scatter_init (const void* sendbuf, int sendcount, MPI_Datatype se int ompi_coll_libnbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scatter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -190,7 +190,7 @@ int ompi_coll_libnbc_iscatter (const void* sendbuf, int sendcount, MPI_Datatype static int nbc_scatter_inter_init (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext; NBC_Schedule *schedule; @@ -250,7 +250,7 @@ static int nbc_scatter_inter_init (const void* sendbuf, int sendcount, MPI_Datat int ompi_coll_libnbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scatter_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -269,7 +269,7 @@ int ompi_coll_libnbc_iscatter_inter (const void* sendbuf, int sendcount, MPI_Dat int ompi_coll_libnbc_scatter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scatter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -282,7 +282,7 @@ int ompi_coll_libnbc_scatter_init(const void* sendbuf, int sendcount, MPI_Dataty int ompi_coll_libnbc_scatter_inter_init(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scatter_inter_init(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/libnbc/nbc_iscatterv.c b/ompi/mca/coll/libnbc/nbc_iscatterv.c index 17da0ae8ff..e9f8ba7394 100644 --- a/ompi/mca/coll/libnbc/nbc_iscatterv.c +++ b/ompi/mca/coll/libnbc/nbc_iscatterv.c @@ -31,7 +31,7 @@ static int nbc_scatterv_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int rank, p, res; MPI_Aint sndext; NBC_Schedule *schedule; @@ -106,7 +106,7 @@ static int nbc_scatterv_init(const void* sendbuf, const int *sendcounts, const i int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scatterv_init(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -125,7 +125,7 @@ int ompi_coll_libnbc_iscatterv(const void* sendbuf, const int *sendcounts, const static int nbc_scatterv_inter_init (const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module, bool persistent) { + struct mca_coll_base_module_2_3_0_t *module, bool persistent) { int res, rsize; MPI_Aint sndext; NBC_Schedule *schedule; @@ -184,7 +184,7 @@ static int nbc_scatterv_inter_init (const void* sendbuf, const int *sendcounts, int ompi_coll_libnbc_iscatterv_inter(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scatterv_inter_init(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, false); if (OPAL_LIKELY(OMPI_SUCCESS != res)) { @@ -203,7 +203,7 @@ int ompi_coll_libnbc_iscatterv_inter(const void* sendbuf, const int *sendcounts, int ompi_coll_libnbc_scatterv_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scatterv_init(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { @@ -216,7 +216,7 @@ int ompi_coll_libnbc_scatterv_init(const void* sendbuf, const int *sendcounts, c int ompi_coll_libnbc_scatterv_inter_init(const void* sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, MPI_Info info, ompi_request_t ** request, - struct mca_coll_base_module_2_2_0_t *module) { + struct mca_coll_base_module_2_3_0_t *module) { int res = nbc_scatterv_inter_init(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request, module, true); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { diff --git a/ompi/mca/coll/portals4/coll_portals4.h b/ompi/mca/coll/portals4/coll_portals4.h index e1cbfc2bd7..175c951e81 100644 --- a/ompi/mca/coll/portals4/coll_portals4.h +++ b/ompi/mca/coll/portals4/coll_portals4.h @@ -206,18 +206,18 @@ int ompi_coll_portals4_ireduce_intra(const void* sendbuf, void* recvbuf, int cou int root, struct ompi_communicator_t *comm, ompi_request_t ** ompi_request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_portals4_ireduce_intra_fini(struct ompi_coll_portals4_request_t *request); int ompi_coll_portals4_allreduce_intra(const void* sendbuf, void* recvbuf, int count, MPI_Datatype dtype, MPI_Op op, struct ompi_communicator_t *comm, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_portals4_iallreduce_intra(const void* sendbuf, void* recvbuf, int count, MPI_Datatype dtype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** ompi_request, - struct mca_coll_base_module_2_2_0_t *module); + struct mca_coll_base_module_2_3_0_t *module); int ompi_coll_portals4_iallreduce_intra_fini(struct ompi_coll_portals4_request_t *request); diff --git a/ompi/mca/coll/portals4/coll_portals4_allreduce.c b/ompi/mca/coll/portals4/coll_portals4_allreduce.c index 56f1ea3062..fe0250defd 100644 --- a/ompi/mca/coll/portals4/coll_portals4_allreduce.c +++ b/ompi/mca/coll/portals4/coll_portals4_allreduce.c @@ -360,7 +360,7 @@ allreduce_kary_tree_bottom(ompi_coll_portals4_request_t *request) int ompi_coll_portals4_allreduce_intra(const void* sendbuf, void* recvbuf, int count, MPI_Datatype dtype, MPI_Op op, struct ompi_communicator_t *comm, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_3_0_t *module) { mca_coll_portals4_module_t *portals4_module = (mca_coll_portals4_module_t*) module; ompi_coll_portals4_request_t *request; @@ -390,7 +390,7 @@ int ompi_coll_portals4_iallreduce_intra(const void* sendbuf, void* recvbuf, int MPI_Datatype dtype, MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** ompi_request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_3_0_t *module) { mca_coll_portals4_module_t *portals4_module = (mca_coll_portals4_module_t*) module; ompi_coll_portals4_request_t *request; diff --git a/ompi/mca/coll/portals4/coll_portals4_barrier.c b/ompi/mca/coll/portals4/coll_portals4_barrier.c index f2544ce0cd..b40c1f9256 100644 --- a/ompi/mca/coll/portals4/coll_portals4_barrier.c +++ b/ompi/mca/coll/portals4/coll_portals4_barrier.c @@ -269,7 +269,7 @@ ompi_coll_portals4_barrier_intra(struct ompi_communicator_t *comm, int ompi_coll_portals4_ibarrier_intra(struct ompi_communicator_t *comm, ompi_request_t **ompi_req, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_3_0_t *module) { int ret; mca_coll_portals4_module_t *portals4_module = (mca_coll_portals4_module_t*) module; diff --git a/ompi/mca/coll/portals4/coll_portals4_reduce.c b/ompi/mca/coll/portals4/coll_portals4_reduce.c index 2fdb36b739..798a1fa17e 100644 --- a/ompi/mca/coll/portals4/coll_portals4_reduce.c +++ b/ompi/mca/coll/portals4/coll_portals4_reduce.c @@ -402,7 +402,7 @@ ompi_coll_portals4_ireduce_intra(const void* sendbuf, void* recvbuf, int count, int root, struct ompi_communicator_t *comm, ompi_request_t ** ompi_request, - struct mca_coll_base_module_2_2_0_t *module) + struct mca_coll_base_module_2_3_0_t *module) { int ret; mca_coll_portals4_module_t *portals4_module = (mca_coll_portals4_module_t*) module; From 3dce039886905515ccc3b9030ec9b4ee933bbe47 Mon Sep 17 00:00:00 2001 From: KAWASHIMA Takahiro Date: Mon, 11 Jun 2018 10:10:51 +0900 Subject: [PATCH 17/17] README: Add explanation of persistent collectives Signed-off-by: KAWASHIMA Takahiro --- README | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README b/README index 69b8bb386a..86e0f13696 100644 --- a/README +++ b/README @@ -717,6 +717,14 @@ Open MPI Extensions - The following extensions are included in this version of Open MPI: + - pcollreq: Provides routines for persistent collective + communication operations and persistent neighborhood collective + communication operations, which are proposed in the MPI Forum as + of June 2018. The function names are prefixed with MPIX_ instead + of MPI_, like MPIX_Barrier_init, because they are not standardized + yet. Future versions of Open MPI will switch to the MPI_ prefix + once the MPI Standard which includes this feature is published. + See their man page for more details. - affinity: Provides the OMPI_Affinity_str() routine on retrieving a string that contains what resources a process is bound to. See its man page for more details.