Commit b0f5772f authored by Min Si's avatar Min Si Committed by Junchao Zhang
Browse files

Revert RMA ADI change for req-based RMA operations.

We should never change the ADI which is exposed to MPI layer for CH3
internal implementation. However, commit 3e005f03 changed the ADI of
put/get/accumulate/get_accumulate for reusing the routine of normal RMA
operations in request-based operations.

This patch defines new CH3 internal functions of
put/get/accumulate/get_accumulate to be reused by both normal and
request-based operations and reverts the ADI change in commit 3e005f03

.
Signed-off-by: default avatarXin Zhao <xinzhao3@illinois.edu>
Signed-off-by: default avatarJunchao Zhang <jczhang@mcs.anl.gov>
parent eedd51e0
......@@ -1616,11 +1616,11 @@ typedef struct MPID_RMA_Ops {
int (*Win_free)(struct MPID_Win **);
int (*Put) (const void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, struct MPID_Win *, MPID_Request *);
MPI_Datatype, struct MPID_Win *);
int (*Get) (void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype,
struct MPID_Win *, MPID_Request *);
struct MPID_Win *);
int (*Accumulate) (const void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPI_Op, struct MPID_Win *, MPID_Request *);
MPI_Datatype, MPI_Op, struct MPID_Win *);
int (*Win_fence)(int, struct MPID_Win *);
int (*Win_post)(MPID_Group *, int, struct MPID_Win *);
......@@ -1651,7 +1651,7 @@ typedef struct MPID_RMA_Ops {
int (*Get_accumulate)(const void *, int , MPI_Datatype, void *, int,
MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op,
struct MPID_Win *, MPID_Request *);
struct MPID_Win *);
int (*Fetch_and_op)(const void *, void *, MPI_Datatype, int, MPI_Aint, MPI_Op,
struct MPID_Win *);
int (*Compare_and_swap)(const void *, const void *, void *, MPI_Datatype, int,
......
......@@ -148,7 +148,7 @@ int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
mpi_errno = MPIU_RMA_CALL(win_ptr,Accumulate(origin_addr, origin_count,
origin_datatype,
target_rank, target_disp, target_count,
target_datatype, op, win_ptr, NULL));
target_datatype, op, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -142,7 +142,7 @@ int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype
mpi_errno = MPIU_RMA_CALL(win_ptr,
Get(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, win_ptr, NULL));
target_datatype, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -198,7 +198,7 @@ int MPI_Get_accumulate(const void *origin_addr, int origin_count,
result_addr, result_count,
result_datatype,
target_rank, target_disp, target_count,
target_datatype, op, win_ptr, NULL));
target_datatype, op, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -142,7 +142,7 @@ int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype
mpi_errno = MPIU_RMA_CALL(win_ptr,
Put(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, win_ptr, NULL));
target_datatype, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -1154,11 +1154,11 @@ int MPIDI_Win_create(void *, MPI_Aint, int, MPID_Info *, MPID_Comm *,
int MPIDI_Win_free(MPID_Win **);
int MPIDI_Put(const void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPID_Win *, MPID_Request * ureq);
MPI_Datatype, MPID_Win *);
int MPIDI_Get(void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPID_Win *, MPID_Request * ureq);
MPI_Datatype, MPID_Win *);
int MPIDI_Accumulate(const void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPI_Op, MPID_Win *, MPID_Request * ureq);
MPI_Datatype, MPI_Op, MPID_Win *);
int MPIDI_Win_fence(int, MPID_Win *);
int MPIDI_Win_post(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr);
......@@ -1187,8 +1187,7 @@ int MPIDI_Win_get_info(MPID_Win *win, MPID_Info **info_used);
int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win,
MPID_Request * ureq);
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win);
int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
MPI_Datatype datatype, int target_rank, MPI_Aint target_disp,
MPI_Op op, MPID_Win *win);
......@@ -1235,6 +1234,27 @@ int MPIDI_CH3I_Try_acquire_win_lock(MPID_Win * win_ptr, int requested_lock);
int MPIDI_CH3I_Progress_finalize(void);
/* Internal RMA operation routines.
* Called by normal RMA operations and request-based RMA operations . */
int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
MPID_Request * ureq);
int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
MPID_Request * ureq);
int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op,
MPID_Win * win_ptr, MPID_Request * ureq);
int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op,
MPID_Win * win_ptr, MPID_Request * ureq);
/*@
MPIDI_CH3_Progress_signal_completion - Inform the progress engine that a
pending request has completed.
......
......@@ -36,13 +36,13 @@ cvars:
*/
#undef FUNCNAME
#define FUNCNAME MPIDI_Put
#define FUNCNAME MPIDI_CH3I_Put
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
MPID_Request * ureq)
int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
MPID_Request * ureq)
{
int mpi_errno = MPI_SUCCESS;
int dt_contig ATTRIBUTE((unused)), rank;
......@@ -51,9 +51,9 @@ int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
MPIDI_msg_sz_t data_sz;
MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
int made_progress = 0;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_PUT);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PUT);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_PUT);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PUT);
MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
......@@ -210,7 +210,7 @@ int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
}
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_PUT);
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PUT);
return mpi_errno;
/* --BEGIN ERROR HANDLING-- */
......@@ -219,16 +219,14 @@ int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
/* --END ERROR HANDLING-- */
}
#undef FUNCNAME
#define FUNCNAME MPIDI_Get
#define FUNCNAME MPIDI_CH3I_Get
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
MPID_Request * ureq)
int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
MPID_Request * ureq)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_msg_sz_t data_sz;
......@@ -237,9 +235,9 @@ int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
MPID_Datatype *dtp;
MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
int made_progress = 0;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_GET);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_GET);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_GET);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_GET);
MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
......@@ -372,7 +370,7 @@ int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
}
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_GET);
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_GET);
return mpi_errno;
/* --BEGIN ERROR HANDLING-- */
......@@ -382,15 +380,14 @@ int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
}
#undef FUNCNAME
#define FUNCNAME MPIDI_Accumulate
#define FUNCNAME MPIDI_CH3I_Accumulate
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op,
MPID_Win * win_ptr, MPID_Request * ureq)
int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op,
MPID_Win * win_ptr, MPID_Request * ureq)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_msg_sz_t data_sz;
......@@ -399,9 +396,9 @@ int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
MPID_Datatype *dtp;
MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
int made_progress = 0;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_ACCUMULATE);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_ACCUMULATE);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_ACCUMULATE);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_ACCUMULATE);
MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
......@@ -560,7 +557,7 @@ int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
}
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_ACCUMULATE);
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_ACCUMULATE);
return mpi_errno;
/* --BEGIN ERROR HANDLING-- */
......@@ -571,14 +568,14 @@ int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
#undef FUNCNAME
#define FUNCNAME MPIDI_Get_accumulate
#define FUNCNAME MPIDI_CH3I_Get_accumulate
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op,
MPID_Win * win_ptr, MPID_Request * ureq)
int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op,
MPID_Win * win_ptr, MPID_Request * ureq)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_msg_sz_t data_sz;
......@@ -588,9 +585,9 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
MPID_Datatype *dtp;
MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
int made_progress = 0;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_GET_ACCUMULATE);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_GET_ACCUMULATE);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_GET_ACCUMULATE);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_GET_ACCUMULATE);
MPIU_ERR_CHKANDJUMP(win_ptr->states.access_state == MPIDI_RMA_NONE,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
......@@ -790,6 +787,118 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
}
}
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_GET_ACCUMULATE);
return mpi_errno;
/* --BEGIN ERROR HANDLING-- */
fn_fail:
goto fn_exit;
/* --END ERROR HANDLING-- */
}
#undef FUNCNAME
#define FUNCNAME MPIDI_Put
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_PUT);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_PUT);
mpi_errno = MPIDI_CH3I_Put(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count, target_datatype,
win_ptr, NULL);
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_PUT);
return mpi_errno;
/* --BEGIN ERROR HANDLING-- */
fn_fail:
goto fn_exit;
/* --END ERROR HANDLING-- */
}
#undef FUNCNAME
#define FUNCNAME MPIDI_Get
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_GET);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_GET);
mpi_errno = MPIDI_CH3I_Get(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count, target_datatype,
win_ptr, NULL);
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_GET);
return mpi_errno;
/* --BEGIN ERROR HANDLING-- */
fn_fail:
goto fn_exit;
/* --END ERROR HANDLING-- */
}
#undef FUNCNAME
#define FUNCNAME MPIDI_Accumulate
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win * win_ptr)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_ACCUMULATE);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_ACCUMULATE);
mpi_errno = MPIDI_CH3I_Accumulate(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count, target_datatype,
op, win_ptr, NULL);
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_ACCUMULATE);
return mpi_errno;
/* --BEGIN ERROR HANDLING-- */
fn_fail:
goto fn_exit;
/* --END ERROR HANDLING-- */
}
#undef FUNCNAME
#define FUNCNAME MPIDI_Get_accumulate
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op,
MPID_Win * win_ptr)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_GET_ACCUMULATE);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_GET_ACCUMULATE);
mpi_errno = MPIDI_CH3I_Get_accumulate(origin_addr, origin_count, origin_datatype,
result_addr, result_count, result_datatype,
target_rank, target_disp, target_count,
target_datatype, op, win_ptr, NULL);
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_GET_ACCUMULATE);
return mpi_errno;
......
......@@ -47,9 +47,9 @@ int MPIDI_Rput(const void *origin_addr, int origin_count,
/* This request is referenced by user and ch3 by default. */
MPIU_Object_set_ref(ureq, 2);
mpi_errno = win_ptr->RMAFns.Put(origin_addr, origin_count,
origin_datatype, target_rank,
target_disp, target_count, target_datatype, win_ptr, ureq);
mpi_errno = MPIDI_CH3I_Put(origin_addr, origin_count,
origin_datatype, target_rank,
target_disp, target_count, target_datatype, win_ptr, ureq);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
......@@ -109,9 +109,9 @@ int MPIDI_Rget(void *origin_addr, int origin_count,
/* This request is referenced by user and ch3 by default. */
MPIU_Object_set_ref(ureq, 2);
mpi_errno = win_ptr->RMAFns.Get(origin_addr, origin_count,
origin_datatype, target_rank,
target_disp, target_count, target_datatype, win_ptr, ureq);
mpi_errno = MPIDI_CH3I_Get(origin_addr, origin_count,
origin_datatype, target_rank,
target_disp, target_count, target_datatype, win_ptr, ureq);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
......@@ -171,10 +171,10 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count,
/* This request is referenced by user and ch3 by default. */
MPIU_Object_set_ref(ureq, 2);
mpi_errno = win_ptr->RMAFns.Accumulate(origin_addr, origin_count,
origin_datatype, target_rank,
target_disp, target_count,
target_datatype, op, win_ptr, ureq);
mpi_errno = MPIDI_CH3I_Accumulate(origin_addr, origin_count,
origin_datatype, target_rank,
target_disp, target_count,
target_datatype, op, win_ptr, ureq);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
}
......@@ -236,12 +236,11 @@ int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count,
/* This request is referenced by user and ch3 by default. */
MPIU_Object_set_ref(ureq, 2);
mpi_errno = win_ptr->RMAFns.Get_accumulate(origin_addr, origin_count,
origin_datatype, result_addr,
result_count, result_datatype,
target_rank, target_disp,
target_count, target_datatype,
op, win_ptr, ureq);
mpi_errno = MPIDI_CH3I_Get_accumulate(origin_addr, origin_count,
origin_datatype, result_addr,
result_count, result_datatype,
target_rank, target_disp,
target_count, target_datatype, op, win_ptr, ureq);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment