Commit cc63b367 authored by Xin Zhao's avatar Xin Zhao
Browse files

Delete no longer needed code.



We made a huge change to RMA infrastructure and
a lot of old code can be droped, including separate
handlers for lock-op-unlock, ACCUM_IMMED specific
code, O(p) data structure code, code of lazy issuing,
etc.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 0542e304
......@@ -566,42 +566,6 @@ static inline int MPIDI_CH3I_Win_get_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t **e)
}
/* Return nonzero if the RMA operations list is empty.
*/
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_RMA_Ops_isempty
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline int MPIDI_CH3I_RMA_Ops_isempty(MPIDI_RMA_Ops_list_t * list)
{
return *list == NULL;
}
/* Return a pointer to the first element in the list.
*/
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_RMA_Ops_head
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline MPIDI_RMA_Op_t *MPIDI_CH3I_RMA_Ops_head(MPIDI_RMA_Ops_list_t * list)
{
return *list;
}
/* Return a pointer to the last element in the list.
*/
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_RMA_Ops_tail
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline MPIDI_RMA_Op_t *MPIDI_CH3I_RMA_Ops_tail(MPIDI_RMA_Ops_list_t * list_tail)
{
return (*list_tail);
}
/* Append an element to the tail of the RMA ops list
*
* @param IN list Pointer to the RMA ops list
......@@ -618,38 +582,6 @@ static inline void MPIDI_CH3I_RMA_Ops_append(MPIDI_RMA_Ops_list_t * list, MPIDI_
}
/* Allocate a new element on the tail of the RMA operations list.
*
* @param IN list Pointer to the RMA ops list
* @param OUT new_ptr Pointer to the element that was allocated
* @return MPI error class
*/
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_RMA_Ops_alloc_tail
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline int MPIDI_CH3I_RMA_Ops_alloc_tail(MPID_Win * win_ptr, MPIDI_RMA_Ops_list_t * list,
MPIDI_RMA_Ops_list_t * list_tail,
MPIDI_RMA_Op_t ** new_elem)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_RMA_Op_t *tmp_ptr;
mpi_errno = MPIDI_CH3I_Win_get_op(win_ptr, &tmp_ptr);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
MPL_LL_APPEND(*list, *list_tail, tmp_ptr);
*new_elem = tmp_ptr;
fn_exit:
return mpi_errno;
fn_fail:
*new_elem = NULL;
goto fn_exit;
}
/* Unlink an element from the RMA ops list
*
* @param IN list Pointer to the RMA ops list
......@@ -689,78 +621,4 @@ static inline void MPIDI_CH3I_RMA_Ops_free_elem(MPID_Win * win_ptr, MPIDI_RMA_Op
}
/* Free an element in the RMA operations list.
*
* @param IN list Pointer to the RMA ops list
* @param INOUT curr_ptr Pointer to the element to be freed. Will be updated
* to point to the element following the element that
* was freed.
*/
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_RMA_Ops_free_and_next
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline void MPIDI_CH3I_RMA_Ops_free_and_next(MPID_Win * win_ptr, MPIDI_RMA_Ops_list_t * list,
MPIDI_RMA_Ops_list_t * list_tail,
MPIDI_RMA_Op_t ** curr_ptr)
{
MPIDI_RMA_Op_t *next_ptr = (*curr_ptr)->next;
MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, list, list_tail, *curr_ptr);
*curr_ptr = next_ptr;
}
/* Free the entire RMA operations list.
*/
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_RMA_Ops_free
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline void MPIDI_CH3I_RMA_Ops_free(MPID_Win * win_ptr, MPIDI_RMA_Ops_list_t * list,
MPIDI_RMA_Ops_list_t * list_tail)
{
MPIDI_RMA_Op_t *curr_ptr, *tmp_ptr;
MPL_LL_FOREACH_SAFE(*list, curr_ptr, tmp_ptr) {
MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, list, list_tail, curr_ptr);
}
}
/* Retrieve the RMA ops list pointer from the window. This routine detects
* whether we are in an active or passive target epoch and returns the correct
* ops list; we use a shared list for active target and separate per-target
* lists for passive target.
*/
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_RMA_Get_ops_list
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline MPIDI_RMA_Ops_list_t *MPIDI_CH3I_RMA_Get_ops_list(MPID_Win * win_ptr, int target)
{
if (win_ptr->epoch_state == MPIDI_EPOCH_FENCE ||
win_ptr->epoch_state == MPIDI_EPOCH_START || win_ptr->epoch_state == MPIDI_EPOCH_PSCW) {
return &win_ptr->at_rma_ops_list;
}
else {
return &win_ptr->targets[target].rma_ops_list;
}
}
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_RMA_Get_ops_list
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline MPIDI_RMA_Ops_list_t *MPIDI_CH3I_RMA_Get_ops_list_tail(MPID_Win * win_ptr, int target)
{
if (win_ptr->epoch_state == MPIDI_EPOCH_FENCE ||
win_ptr->epoch_state == MPIDI_EPOCH_START || win_ptr->epoch_state == MPIDI_EPOCH_PSCW) {
return &win_ptr->at_rma_ops_list_tail;
}
else {
return &win_ptr->targets[target].rma_ops_list_tail;
}
}
#endif /* MPID_RMA_OPLIST_H_INCLUDED */
......@@ -1230,9 +1230,6 @@ void MPIDI_CH3_RMA_Init_Pvars(void);
/* internal */
int MPIDI_CH3I_Release_lock(MPID_Win * win_ptr);
int MPIDI_CH3I_Try_acquire_win_lock(MPID_Win * win_ptr, int requested_lock);
int MPIDI_CH3_Start_rma_op_target(MPID_Win *win_ptr, MPIDI_CH3_Pkt_flags_t flags);
int MPIDI_CH3_Finish_rma_op_target(MPIDI_VC_t *vc, MPID_Win *win_ptr, int is_rma_update,
MPIDI_CH3_Pkt_flags_t flags, MPI_Win source_win_handle);
int MPIDI_CH3I_Progress_finalize(void);
......@@ -1789,8 +1786,6 @@ int MPIDI_CH3_PktHandler_Accumulate( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_GetAccumulate( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_Accumulate_Immed( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_CAS( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_CASResp( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
......@@ -1817,12 +1812,6 @@ int MPIDI_CH3_PktHandler_FlushAck( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_DecrAtCnt( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_LockPutUnlock( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_LockAccumUnlock( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_LockGetUnlock( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_FlowCntlUpdate( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_Close( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
......@@ -1905,8 +1894,6 @@ int MPIDI_CH3_ReqHandler_AccumDerivedDTRecvComplete( MPIDI_VC_t *,
int MPIDI_CH3_ReqHandler_GaccumDerivedDTRecvComplete( MPIDI_VC_t *,
MPID_Request *,
int * );
int MPIDI_CH3_ReqHandler_SinglePutAccumComplete( MPIDI_VC_t *, MPID_Request *,
int * );
int MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete( MPIDI_VC_t *,
MPID_Request *, int * );
/* Send Handlers */
......
......@@ -79,7 +79,6 @@ typedef enum {
MPIDI_CH3_PKT_GET,
MPIDI_CH3_PKT_ACCUMULATE,
MPIDI_CH3_PKT_GET_ACCUM,
MPIDI_CH3_PKT_ACCUM_IMMED, /* optimization for short accumulate */
MPIDI_CH3_PKT_FOP,
MPIDI_CH3_PKT_CAS,
MPIDI_CH3_PKT_GET_RESP,
......@@ -92,9 +91,6 @@ typedef enum {
MPIDI_CH3_PKT_FLUSH,
MPIDI_CH3_PKT_FLUSH_ACK,
MPIDI_CH3_PKT_DECR_AT_COUNTER,
MPIDI_CH3_PKT_LOCK_PUT_UNLOCK, /* optimization for single puts */
MPIDI_CH3_PKT_LOCK_GET_UNLOCK, /* optimization for single gets */
MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK, /* optimization for single accumulates */
/* RMA Packets end here */
MPIDI_CH3_PKT_FLOW_CNTL_UPDATE, /* FIXME: Unused */
MPIDI_CH3_PKT_CLOSE,
......@@ -213,18 +209,6 @@ MPIDI_CH3_PKT_DEFS
case (MPIDI_CH3_PKT_FOP): \
datatype_ = (pkt_).fop.datatype; \
break; \
case (MPIDI_CH3_PKT_LOCK_PUT_UNLOCK): \
datatype_ = pkt_.lock_put_unlock.datatype; \
break; \
case (MPIDI_CH3_PKT_LOCK_GET_UNLOCK): \
datatype_ = pkt_.lock_get_unlock.datatype; \
break; \
case (MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK): \
datatype_ = pkt_.lock_accum_unlock.datatype; \
break; \
case (MPIDI_CH3_PKT_ACCUM_IMMED): \
datatype_ = pkt_.accum_immed.datatype; \
break; \
default: \
MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
} \
......@@ -493,25 +477,6 @@ typedef struct MPIDI_CH3_Pkt_get_accum_resp {
MPIDI_CH3_Pkt_flags_t flags;
} MPIDI_CH3_Pkt_get_accum_resp_t;
typedef struct MPIDI_CH3_Pkt_accum_immed {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
void *addr;
int count;
/* FIXME: Compress datatype/op into a single word (immedate mode) */
MPI_Datatype datatype;
MPI_Op op;
/* FIXME: do we need these (use a regular accum packet if we do?) */
MPI_Win target_win_handle; /* Used in the last RMA operation in each
* epoch for decrementing rma op counter in
* active target rma and for unlocking window
* in passive target rma. Otherwise set to NULL*/
MPI_Win source_win_handle; /* Used in the last RMA operation in an
* epoch in the case of passive target rma
* with shared locks. Otherwise set to NULL*/
int data[MPIDI_RMA_IMMED_INTS];
} MPIDI_CH3_Pkt_accum_immed_t;
typedef struct MPIDI_CH3_Pkt_cas {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
......@@ -618,45 +583,6 @@ typedef struct MPIDI_CH3_Pkt_decr_at_counter {
MPI_Win target_win_handle;
} MPIDI_CH3_Pkt_decr_at_counter_t;
typedef struct MPIDI_CH3_Pkt_lock_put_unlock {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Win target_win_handle;
MPI_Win source_win_handle;
int origin_rank;
int lock_type;
void *addr;
int count;
MPI_Datatype datatype;
} MPIDI_CH3_Pkt_lock_put_unlock_t;
typedef struct MPIDI_CH3_Pkt_lock_get_unlock {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Win target_win_handle;
MPI_Win source_win_handle;
int origin_rank;
int lock_type;
void *addr;
int count;
MPI_Datatype datatype;
MPI_Request request_handle;
} MPIDI_CH3_Pkt_lock_get_unlock_t;
typedef struct MPIDI_CH3_Pkt_lock_accum_unlock {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Win target_win_handle;
MPI_Win source_win_handle;
int origin_rank;
int lock_type;
void *addr;
int count;
MPI_Datatype datatype;
MPI_Op op;
} MPIDI_CH3_Pkt_lock_accum_unlock_t;
typedef struct MPIDI_CH3_Pkt_close {
MPIDI_CH3_Pkt_type_t type;
int ack;
......@@ -685,7 +611,6 @@ typedef union MPIDI_CH3_Pkt {
MPIDI_CH3_Pkt_get_t get;
MPIDI_CH3_Pkt_get_resp_t get_resp;
MPIDI_CH3_Pkt_accum_t accum;
MPIDI_CH3_Pkt_accum_immed_t accum_immed;
MPIDI_CH3_Pkt_get_accum_t get_accum;
MPIDI_CH3_Pkt_lock_t lock;
MPIDI_CH3_Pkt_lock_granted_t lock_granted;
......@@ -693,9 +618,6 @@ typedef union MPIDI_CH3_Pkt {
MPIDI_CH3_Pkt_flush_t flush;
MPIDI_CH3_Pkt_flush_ack_t flush_ack;
MPIDI_CH3_Pkt_decr_at_counter_t decr_at_cnt;
MPIDI_CH3_Pkt_lock_put_unlock_t lock_put_unlock;
MPIDI_CH3_Pkt_lock_get_unlock_t lock_get_unlock;
MPIDI_CH3_Pkt_lock_accum_unlock_t lock_accum_unlock;
MPIDI_CH3_Pkt_close_t close;
MPIDI_CH3_Pkt_cas_t cas;
MPIDI_CH3_Pkt_cas_resp_t cas_resp;
......
......@@ -311,22 +311,6 @@ typedef struct MPIDI_RMA_Pkt_orderings {
extern MPIDI_RMA_Pkt_orderings_t *MPIDI_RMA_Pkt_orderings;
struct MPIDI_Win_target_state {
struct MPIDI_RMA_Op *rma_ops_list;
/* List of outstanding RMA operations */
struct MPIDI_RMA_Op *rma_ops_list_tail;
volatile enum MPIDI_CH3_Lock_states remote_lock_state;
/* Indicates the state of the target
process' "lock" for passive target
RMA. */
int remote_lock_mode; /* Indicates the access mode
(shared/exclusive) of the target
process for passive target RMA. Valid
whenever state != NONE. */
int remote_lock_assert; /* Assertion value provided in the call
to Lock */
};
#define MPIDI_DEV_WIN_DECL \
volatile int at_completion_counter; /* completion counter for operations \
targeting this window */ \
......@@ -346,14 +330,6 @@ struct MPIDI_Win_target_state {
\
MPI_Aint *sizes; /* array of sizes of all windows */ \
struct MPIDI_Win_info_args info_args; \
struct MPIDI_Win_target_state *targets; /* Target state and ops \
lists for passive target \
mode of operation */ \
struct MPIDI_RMA_Op *at_rma_ops_list; /* Ops list for active target \
mode of operation. */ \
struct MPIDI_RMA_Op *at_rma_ops_list_tail; \
enum MPIDI_Win_epoch_states epoch_state; \
int epoch_count; \
int shm_allocated; /* flag: TRUE iff this window has a shared memory \
region associated with it */ \
struct MPIDI_RMA_Op *op_pool_start; /* start pointer used for freeing */\
......
......@@ -12,8 +12,6 @@
#include "mpid_rma_shm.h"
#include "mpid_rma_issue.h"
int MPIDI_CH3I_Issue_rma_op(MPIDI_RMA_Op_t * op_ptr, MPID_Win * win_ptr,
MPIDI_CH3_Pkt_flags_t flags);
#undef FUNCNAME
#define FUNCNAME send_lock_msg
......@@ -29,8 +27,6 @@ static inline int send_lock_msg(int dest, int lock_type, MPID_Win * win_ptr)
MPIDI_STATE_DECL(MPID_STATE_SEND_LOCK_MSG);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_SEND_LOCK_MSG);
MPIU_Assert(win_ptr->targets[dest].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED);
MPIDI_Comm_get_vc_set_active(win_ptr->comm_ptr, dest, &vc);
MPIDI_Pkt_init(lock_pkt, MPIDI_CH3_PKT_LOCK);
......@@ -39,9 +35,6 @@ static inline int send_lock_msg(int dest, int lock_type, MPID_Win * win_ptr)
lock_pkt->lock_type = lock_type;
lock_pkt->origin_rank = win_ptr->comm_ptr->rank;
win_ptr->targets[dest].remote_lock_state = MPIDI_CH3_WIN_LOCK_REQUESTED;
win_ptr->targets[dest].remote_lock_mode = lock_type;
MPIU_THREAD_CS_ENTER(CH3COMM, vc);
mpi_errno = MPIDI_CH3_iStartMsg(vc, lock_pkt, sizeof(*lock_pkt), &req);
MPIU_THREAD_CS_EXIT(CH3COMM, vc);
......@@ -75,8 +68,6 @@ static inline int send_unlock_msg(int dest, MPID_Win * win_ptr)
MPIDI_STATE_DECL(MPID_STATE_SEND_UNLOCK_MSG);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_SEND_UNLOCK_MSG);
MPIU_Assert(win_ptr->targets[dest].remote_lock_state == MPIDI_CH3_WIN_LOCK_GRANTED);
MPIDI_Comm_get_vc_set_active(win_ptr->comm_ptr, dest, &vc);
/* Send a lock packet over to the target. wait for the lock_granted
......@@ -86,9 +77,6 @@ static inline int send_unlock_msg(int dest, MPID_Win * win_ptr)
unlock_pkt->target_win_handle = win_ptr->all_win_handles[dest];
unlock_pkt->source_win_handle = win_ptr->handle;
/* Reset the local state of the target to unlocked */
win_ptr->targets[dest].remote_lock_state = MPIDI_CH3_WIN_LOCK_NONE;
MPIU_THREAD_CS_ENTER(CH3COMM, vc);
mpi_errno = MPIDI_CH3_iStartMsg(vc, unlock_pkt, sizeof(*unlock_pkt), &req);
MPIU_THREAD_CS_EXIT(CH3COMM, vc);
......@@ -307,9 +295,6 @@ static inline int acquire_local_lock(MPID_Win * win_ptr, int lock_type)
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
}
win_ptr->targets[win_ptr->comm_ptr->rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_GRANTED;
win_ptr->targets[win_ptr->comm_ptr->rank].remote_lock_mode = lock_type;
fn_exit:
MPIDI_RMA_FUNC_EXIT(MPID_STATE_ACQUIRE_LOCAL_LOCK);
return mpi_errno;
......
......@@ -590,14 +590,6 @@ int MPIDI_CH3_PktHandler_Init( MPIDI_CH3_PktHandler_Fcn *pktArray[],
MPIDI_CH3_PktHandler_FlushAck;
pktArray[MPIDI_CH3_PKT_DECR_AT_COUNTER] =
MPIDI_CH3_PktHandler_DecrAtCnt;
pktArray[MPIDI_CH3_PKT_LOCK_PUT_UNLOCK] =
MPIDI_CH3_PktHandler_LockPutUnlock;
pktArray[MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK] =
MPIDI_CH3_PktHandler_LockAccumUnlock;
pktArray[MPIDI_CH3_PKT_LOCK_GET_UNLOCK] =
MPIDI_CH3_PktHandler_LockGetUnlock;
pktArray[MPIDI_CH3_PKT_ACCUM_IMMED] =
MPIDI_CH3_PktHandler_Accumulate_Immed;
pktArray[MPIDI_CH3_PKT_CAS] =
MPIDI_CH3_PktHandler_CAS;
pktArray[MPIDI_CH3_PKT_CAS_RESP] =
......
......@@ -8,8 +8,6 @@
#include "mpidrma.h"
static int create_derived_datatype(MPID_Request * rreq, MPID_Datatype ** dtp);
static int do_simple_accumulate(MPIDI_PT_single_op *single_op);
static int do_simple_get(MPID_Win *win_ptr, MPIDI_Win_lock_queue *lock_queue);
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3U_Handle_recv_req
......@@ -117,9 +115,6 @@ int MPIDI_CH3_ReqHandler_PutRecvComplete( MPIDI_VC_t *vc,
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIDI_CH3_Progress_signal_completion();
}
mpi_errno = MPIDI_CH3_Finish_rma_op_target(vc, win_ptr, TRUE, rreq->dev.flags,
rreq->dev.source_win_handle);
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
/* mark data transfer as complete and decrement CC */
MPIDI_CH3U_Request_complete(rreq);
......@@ -192,10 +187,6 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete( MPIDI_VC_t *vc,
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
mpi_errno = MPIDI_CH3_Finish_rma_op_target(vc, win_ptr, TRUE, rreq->dev.flags,
rreq->dev.source_win_handle);
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
/* mark data transfer as complete and decrement CC */
MPIDI_CH3U_Request_complete(rreq);
*complete = TRUE;
......@@ -513,6 +504,7 @@ int MPIDI_CH3_ReqHandler_GaccumDerivedDTRecvComplete( MPIDI_VC_t *vc ATTRIBUTE((
}
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete
#undef FCNAME
......@@ -598,88 +590,6 @@ int MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete( MPIDI_VC_t *vc,
return mpi_errno;
}
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3_ReqHandler_SinglePutAccumComplete
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_CH3_ReqHandler_SinglePutAccumComplete( MPIDI_VC_t *vc,
MPID_Request *rreq,
int *complete )
{
int mpi_errno = MPI_SUCCESS;
MPID_Win *win_ptr;
MPIDI_Win_lock_queue *lock_queue_entry, *curr_ptr, **curr_ptr_ptr;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_SINGLEPUTACCUMCOMPLETE);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_SINGLEPUTACCUMCOMPLETE);
/* received all the data for single lock-put(accum)-unlock
optimization where the lock was not acquired in
ch3u_handle_recv_pkt. Try to acquire the lock and do the
operation. */
MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr);
lock_queue_entry = rreq->dev.lock_queue_entry;
if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr,
lock_queue_entry->lock_type) == 1)
{
if (MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_PT_SINGLE_PUT) {
/* copy the data over */
mpi_errno = MPIR_Localcopy(rreq->dev.user_buf,
rreq->dev.user_count,
rreq->dev.datatype,
lock_queue_entry->pt_single_op->addr,
lock_queue_entry->pt_single_op->count,
lock_queue_entry->pt_single_op->datatype);
}
else {
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
mpi_errno = do_simple_accumulate(lock_queue_entry->pt_single_op);
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
}
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
/* free lock_queue_entry including data buffer and remove
it from the queue. */
curr_ptr = (MPIDI_Win_lock_queue *) win_ptr->lock_queue;
curr_ptr_ptr = (MPIDI_Win_lock_queue **) &(win_ptr->lock_queue);
while (curr_ptr != lock_queue_entry) {
curr_ptr_ptr = &(curr_ptr->next);
curr_ptr = curr_ptr->next;
}
*curr_ptr_ptr = curr_ptr->next;
mpi_errno = MPIDI_CH3_Finish_rma_op_target(vc, win_ptr, TRUE,
lock_queue_entry->pt_single_op->flags,
lock_queue_entry->source_win_handle);
MPIU_Free(lock_queue_entry->pt_single_op->data);
MPIU_Free(lock_queue_entry->pt_single_op);
MPIU_Free(lock_queue_entry);
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
}
else {
/* could not acquire lock. mark data recd as 1 */
lock_queue_entry->pt_single_op->data_recd = 1;
}
/* mark data transfer as complete and decrement CC */
MPIDI_CH3U_Request_complete(rreq);
*complete = TRUE;
fn_fail:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_REQHANDLER_SINGLEPUTACCUMCOMPLETE);
return mpi_errno;
}
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3_ReqHandler_UnpackUEBufComplete
......@@ -1036,117 +946,3 @@ int MPIDI_CH3I_Release_lock(MPID_Win *win_ptr)
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME do_simple_accumulate
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static int do_simple_accumulate(MPIDI_PT_single_op *single_op)
{
int mpi_errno = MPI_SUCCESS;
MPI_User_function *uop;
MPIDI_STATE_DECL(MPID_STATE_DO_SIMPLE_ACCUMULATE);
MPIDI_FUNC_ENTER(MPID_STATE_DO_SIMPLE_ACCUMULATE);
if (single_op->op == MPI_REPLACE)
{
/* simply copy the data */
mpi_errno = MPIR_Localcopy(single_op->data, single_op->count,
single_op->datatype, single_op->addr,
single_op->count, single_op->datatype);
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
goto fn_exit;
}
if (HANDLE_GET_KIND(single_op->op) == HANDLE_KIND_BUILTIN)
{
/* get the function by indexing into the op table */
uop = MPIR_OP_HDL_TO_FN(single_op->op);
}
else
{
/* --BEGIN ERROR HANDLING-- */
mpi_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opnotpredefined", "**opnotpredefined %d", single_op->op );
goto fn_fail;
/* --END ERROR HANDLING-- */
}
/* only basic datatypes supported for this optimization. */
(*uop)(single_op->data, single_op->addr,
&(single_op->count), &(single_op->datatype));
fn_fail:
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_DO_SIMPLE_ACCUMULATE);
return mpi_errno;
}
#undef FUNCNAME
#define FUNCNAME do_simple_get