Commit 002ce8c8 authored by Xin Zhao's avatar Xin Zhao Committed by Pavan Balaji
Browse files

Allocate buffer with stream size for ACC/GACC data piggybacked with LOCK.



For queued ACC/GACC data piggybacked with LOCK, we do not
need to allocate the buffer for the entire operation, but
only need to allocate a buffer with stream unit size. This
patch fixes this issue.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent efad963a
......@@ -538,6 +538,21 @@ MPIDI_CH3_PKT_DEFS
} \
}
#define MPIDI_CH3_PKT_RMA_GET_STREAM_OFFSET(pkt_, stream_offset_, err_) \
{ \
err_ = MPI_SUCCESS; \
switch((pkt_).type) { \
case (MPIDI_CH3_PKT_ACCUMULATE): \
(stream_offset_) = (pkt_).accum.info.metadata.stream_offset; \
break; \
case (MPIDI_CH3_PKT_GET_ACCUM): \
(stream_offset_) = (pkt_).get_accum.info.metadata.stream_offset; \
break; \
default: \
MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
} \
}
#define MPIDI_CH3_PKT_RMA_GET_REQUEST_HANDLE(pkt_, request_hdl_, err_) \
{ \
err_ = MPI_SUCCESS; \
......
......@@ -372,8 +372,22 @@ static inline int enqueue_lock_origin(MPID_Win * win_ptr, MPIDI_VC_t * vc,
MPID_Datatype_get_extent_macro(target_dtp, type_extent);
MPID_Datatype_get_size_macro(target_dtp, type_size);
recv_data_sz = type_size * target_count;
buf_size = type_extent * target_count;
if (pkt->type == MPIDI_CH3_PKT_PUT) {
recv_data_sz = type_size * target_count;
buf_size = type_extent * target_count;
}
else {
MPI_Aint stream_offset, stream_elem_count;
MPI_Aint total_len, rest_len;
MPIDI_CH3_PKT_RMA_GET_STREAM_OFFSET((*pkt), stream_offset, mpi_errno);
stream_elem_count = MPIDI_CH3U_SRBuf_size / type_extent;
total_len = type_size * target_count;
rest_len = total_len - stream_offset;
recv_data_sz = MPIR_MIN(rest_len, type_size * stream_elem_count);
buf_size = type_extent * (recv_data_sz / type_size);
}
if (new_ptr != NULL) {
if (win_ptr->current_lock_data_bytes + buf_size < MPIR_CVAR_CH3_RMA_LOCK_DATA_BYTES) {
......
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