Commit 81dfdbea authored by James Dinan's avatar James Dinan
Browse files

[svn-r10682] RMA Req-ops: Added state tracking and error checks

Note: Request-generating operations can only be called within a passive target
epoch.

Reviewer: goodell
parent 2ebbda72
......@@ -150,6 +150,10 @@ int MPIDI_Rput(const void *origin_addr, int origin_count,
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_RPUT);
MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_LOCK &&
win_ptr->epoch_state != MPIDI_EPOCH_LOCK_ALL,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t*,
sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno,
"req-based RMA state");
......@@ -176,9 +180,8 @@ int MPIDI_Rput(const void *origin_addr, int origin_count,
*request = req_state->request;
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RPUT);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RPUT);
return mpi_errno;
fn_fail:
MPIU_CHKPMEM_REAP();
......@@ -202,6 +205,10 @@ int MPIDI_Rget(void *origin_addr, int origin_count,
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_RGET);
MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_LOCK &&
win_ptr->epoch_state != MPIDI_EPOCH_LOCK_ALL,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t*,
sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno,
"req-based RMA state");
......@@ -228,9 +235,8 @@ int MPIDI_Rget(void *origin_addr, int origin_count,
*request = req_state->request;
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RGET);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RGET);
return mpi_errno;
fn_fail:
MPIU_CHKPMEM_REAP();
......@@ -254,6 +260,10 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count,
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_RACCUMULATE);
MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_LOCK &&
win_ptr->epoch_state != MPIDI_EPOCH_LOCK_ALL,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t*,
sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno,
"req-based RMA state");
......@@ -280,9 +290,8 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count,
*request = req_state->request;
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RACCUMULATE);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RACCUMULATE);
return mpi_errno;
fn_fail:
MPIU_CHKPMEM_REAP();
......@@ -307,6 +316,10 @@ int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count,
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_RGET_ACCUMULATE);
MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_LOCK &&
win_ptr->epoch_state != MPIDI_EPOCH_LOCK_ALL,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t*,
sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno,
"req-based RMA state");
......@@ -335,9 +348,8 @@ int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count,
*request = req_state->request;
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RGET_ACCUMULATE);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RGET_ACCUMULATE);
return mpi_errno;
fn_fail:
MPIU_CHKPMEM_REAP();
......
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