Skip to content

Commit

Permalink
ch4: remove buf-count-datatype from am_check_eager interface
Browse files Browse the repository at this point in the history
The buf, count, datatype triplet are not needed in checking eager limit.
Removing them from the interface facilitates later we add partial
datatype via MPIR_Data.
  • Loading branch information
hzhou committed Sep 4, 2024
1 parent 6b98800 commit 824a6f6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 17 deletions.
4 changes: 1 addition & 3 deletions doc/wiki/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,7 @@ MPI_Aint MPIDI_[NM|SHM]_am_eager_limit(void)
MPI_Aint MPIDI_[NM|SHM]_am_eager_buf_limit(void)
/* return true/false if pt2pt message can be sent eagerly */
bool MPIDI_[NM|SHM]_am_check_eager(MPI_Aint am_hdr_sz, MPI_Aint data_sz,
const void *data, MPI_Aint count,
MPI_Datatype datatype, MPIR_Request * sreq)
bool MPIDI_[NM|SHM]_am_check_eager(MPI_Aint am_hdr_sz, MPI_Aint data_sz, MPIR_Request * sreq)
/****************** Callback APIs ******************/
Expand Down
4 changes: 2 additions & 2 deletions src/mpid/ch4/ch4_api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ Non Native API:
NM*: void
SHM*: void
am_check_eager: bool
NM*: am_hdr_sz, data_sz, data, count, datatype, sreq
SHM*: am_hdr_sz, data_sz, data, count, datatype, sreq
NM*: am_hdr_sz, data_sz, sreq
SHM*: am_hdr_sz, data_sz, sreq
comm_get_gpid : int
NM*: comm_ptr, idx, gpid_ptr, is_remote
get_local_upids : int
Expand Down
3 changes: 1 addition & 2 deletions src/mpid/ch4/netmod/ofi/ofi_am.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_NM_am_send_hdr_reply(MPIR_Comm * comm,
}

MPL_STATIC_INLINE_PREFIX bool MPIDI_NM_am_check_eager(MPI_Aint am_hdr_sz, MPI_Aint data_sz,
const void *data, MPI_Aint count,
MPI_Datatype datatype, MPIR_Request * sreq)
MPIR_Request * sreq)
{
MPIDI_OFI_AMREQUEST(sreq, data_sz) = data_sz;
if ((am_hdr_sz + data_sz)
Expand Down
3 changes: 1 addition & 2 deletions src/mpid/ch4/netmod/ucx/ucx_am.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_NM_am_send_hdr_reply(MPIR_Comm * comm,
}

MPL_STATIC_INLINE_PREFIX bool MPIDI_NM_am_check_eager(MPI_Aint am_hdr_sz, MPI_Aint data_sz,
const void *data, MPI_Aint count,
MPI_Datatype datatype, MPIR_Request * sreq)
MPIR_Request * sreq)
{
#ifdef HAVE_UCP_AM_NBX
/* ucx will handle rndv */
Expand Down
3 changes: 1 addition & 2 deletions src/mpid/ch4/shm/src/shm_am.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ MPL_STATIC_INLINE_PREFIX void MPIDI_SHM_am_request_finalize(MPIR_Request * req)
}

MPL_STATIC_INLINE_PREFIX bool MPIDI_SHM_am_check_eager(MPI_Aint am_hdr_sz, MPI_Aint data_sz,
const void *data, MPI_Aint count,
MPI_Datatype datatype, MPIR_Request * sreq)
MPIR_Request * sreq)
{
/* TODO: add checking for IPC transmission */
return (am_hdr_sz + data_sz) <= MPIDI_POSIX_am_eager_limit();
Expand Down
11 changes: 5 additions & 6 deletions src/mpid/ch4/src/mpidig_send.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@
#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_Request * sreq)
{
#ifdef MPIDI_CH4_DIRECT_NETMOD
return MPIDI_NM_am_check_eager(am_hdr_sz, data_sz, buf, count, datatype, sreq);
return MPIDI_NM_am_check_eager(am_hdr_sz, data_sz, sreq);
#else
if (is_local) {
return MPIDI_SHM_am_check_eager(am_hdr_sz, data_sz, buf, count, datatype, sreq);
return MPIDI_SHM_am_check_eager(am_hdr_sz, data_sz, sreq);
} else {
return MPIDI_NM_am_check_eager(am_hdr_sz, data_sz, buf, count, datatype, sreq);
return MPIDI_NM_am_check_eager(am_hdr_sz, data_sz, sreq);
}
#endif
}
Expand Down Expand Up @@ -91,7 +90,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_isend_impl(const void *buf, MPI_Aint count,

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, 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);
Expand Down

0 comments on commit 824a6f6

Please sign in to comment.