diff --git a/src/mpid/ch4/ch4_api.txt b/src/mpid/ch4/ch4_api.txt index 96ace1800b8..061dab24f2b 100644 --- a/src/mpid/ch4/ch4_api.txt +++ b/src/mpid/ch4/ch4_api.txt @@ -138,12 +138,18 @@ Non Native API: SHM*: req Native API: + send_data : int + NM*: data-2, rank, tag, comm, attr-2, addr, req_p + SHM*: data-2, rank, tag, comm, attr-2, addr, req_p mpi_isend : int NM*: buf, count, datatype, rank, tag, comm, attr-2, addr, req_p SHM*: buf, count, datatype, rank, tag, comm, attr-2, addr, req_p mpi_cancel_send : int NM*: sreq SHM*: sreq + recv_data : int + NM*: data-2, rank, tag, comm, attr-2, addr, req_p, partner + SHM*: data-2, rank, tag, comm, attr-2, req_p mpi_irecv : int NM*: buf-2, count, datatype, rank, tag, comm, attr-2, addr, req_p, partner SHM*: buf-2, count, datatype, rank, tag, comm, attr-2, req_p @@ -446,6 +452,7 @@ PARAM: context_id: MPIR_Context_id_t count: MPI_Aint data: const void * + data-2: MPIR_Data * data_sz: MPI_Aint datatype: MPI_Datatype datatype_p: MPIR_Datatype * diff --git a/src/mpid/ch4/src/mpidig_send.h b/src/mpid/ch4/src/mpidig_send.h index 36a36da42c0..72d19b30a4d 100644 --- a/src/mpid/ch4/src/mpidig_send.h +++ b/src/mpid/ch4/src/mpidig_send.h @@ -27,8 +27,7 @@ #define MPIDIG_AM_SEND_GET_RNDV_ID(flags) (flags >> 8) MPL_STATIC_INLINE_PREFIX bool MPIDIG_check_eager(int is_local, MPI_Aint am_hdr_sz, MPI_Aint data_sz, - const void *buf, MPI_Aint count, - MPI_Datatype datatype, MPIR_Request * sreq) + MPIR_Data * data, MPIR_Request * sreq) { #ifdef MPIDI_CH4_DIRECT_NETMOD return MPIDI_NM_am_check_eager(am_hdr_sz, data_sz, buf, count, datatype, sreq); @@ -41,8 +40,7 @@ MPL_STATIC_INLINE_PREFIX bool MPIDIG_check_eager(int is_local, MPI_Aint am_hdr_s #endif } -MPL_STATIC_INLINE_PREFIX int MPIDIG_isend_impl(const void *buf, MPI_Aint count, - MPI_Datatype datatype, int rank, int tag, +MPL_STATIC_INLINE_PREFIX int MPIDIG_isend_impl(MPIR_Data * data, int rank, int tag, MPIR_Comm * comm, int context_offset, MPIDI_av_entry_t * addr, uint8_t flags, int src_vci, int dst_vci, @@ -84,14 +82,15 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_isend_impl(const void *buf, MPI_Aint count, am_hdr.rndv_hdr_sz = 0; #ifdef HAVE_DEBUGGER_SUPPORT - MPIDIG_REQUEST(sreq, datatype) = datatype; - MPIDIG_REQUEST(sreq, buffer) = (void *) buf; - MPIDIG_REQUEST(sreq, count) = count; + /* FIXME: partial data support in debugger */ + MPIDIG_REQUEST(sreq, datatype) = data->datatype; + MPIDIG_REQUEST(sreq, buffer) = data->buf; + MPIDIG_REQUEST(sreq, count) = data->count; #endif int is_local = MPIDI_av_is_local(addr); MPI_Aint am_hdr_sz = (MPI_Aint) sizeof(am_hdr); - if (MPIDIG_check_eager(is_local, am_hdr_sz, data_sz, buf, count, datatype, sreq)) { + if (MPIDIG_check_eager(is_local, am_hdr_sz, data_sz, data, sreq)) { /* EAGER send */ CH4_CALL(am_isend(rank, comm, MPIDIG_SEND, &am_hdr, am_hdr_sz, buf, count, datatype, src_vci, dst_vci, sreq), is_local, mpi_errno); @@ -116,10 +115,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_isend_impl(const void *buf, MPI_Aint count, goto fn_exit; } -MPL_STATIC_INLINE_PREFIX int MPIDIG_mpi_isend(const void *buf, - MPI_Aint count, - MPI_Datatype datatype, - int rank, +MPL_STATIC_INLINE_PREFIX int MPIDIG_send_data(MPIR_Data * data, int rank, int tag, MPIR_Comm * comm, int context_offset, MPIDI_av_entry_t * addr, int src_vci, int dst_vci, MPIR_Request ** request, @@ -129,13 +125,34 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_mpi_isend(const void *buf, MPIR_FUNC_ENTER; uint8_t flags = syncflag ? MPIDIG_AM_SEND_FLAGS_SYNC : MPIDIG_AM_SEND_FLAGS_NONE; - mpi_errno = MPIDIG_isend_impl(buf, count, datatype, rank, tag, comm, context_offset, addr, + mpi_errno = MPIDIG_isend_impl(data, rank, tag, comm, context_offset, addr, flags, src_vci, dst_vci, request, errflag); MPIR_FUNC_EXIT; return mpi_errno; } +MPL_STATIC_INLINE_PREFIX int MPIDIG_mpi_isend(const void *buf, + MPI_Aint count, + MPI_Datatype datatype, + int rank, + int tag, MPIR_Comm * comm, int context_offset, + MPIDI_av_entry_t * addr, int src_vci, int dst_vci, + MPIR_Request ** request, + bool syncflag, MPIR_Errflag_t errflag) +{ + MPIR_Data data = { + .buf = (void *) buf, + .count = count, + .datatype = datatype, + .offset = 0, + .length = -1, + }; + + return MPIDIG_send_data(&data, rank, tag, comm, context_offset, addr, src_vci, dst_vci, + request, syncflag, errflag); +} + MPL_STATIC_INLINE_PREFIX int MPIDIG_mpi_cancel_send(MPIR_Request * sreq) { int mpi_errno = MPI_SUCCESS;