Commit 19bdecfa authored by Xin Zhao's avatar Xin Zhao Committed by Pavan Balaji
Browse files

Add asserts and comments in Nemesis and MXM netmod about streaming offset.



Note that here we move the definition of streaming unit size to
mpidimpl.h in CH3, so that Nemesis can see it and do assert check on it.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 08d72e37
......@@ -440,6 +440,16 @@ MPID_nem_mpich_send_seg_header (MPID_Segment *segment, MPIDI_msg_sz_t *segment_f
{
MPID_nem_fbox_mpich_t *pbox = vc_ch->fbox_out;
/* Add a compiler time check on streaming unit size and FASTBOX size */
MPIU_Static_assert((MPIDI_CH3U_Acc_stream_size > MPID_NEM_FBOX_DATALEN),
"RMA ACC Streaming unit size <= FASTBOX size in Nemesis.");
/* NOTE: when FASTBOX is being used, streaming optimization is never triggered,
* because streaming unit size is larger than FASTBOX size. In such case,
* first offset (*segment_first) is zero, and last offset (segment_size)
* is the data size */
MPIU_Assert(*segment_first == 0);
if (MPID_nem_fbox_is_full((MPID_nem_fbox_common_ptr_t)pbox))
goto usequeue_l;
......
......@@ -180,6 +180,13 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
req_area->iov_buf[0].length = sizeof(MPIDI_CH3_Pkt_t);
last = sreq->dev.segment_size;
/* NOTE: currently upper layer never pass packet with data that has
* either "last <= 0" or "last-sreq->dev.segment_first <=0" to this
* layer. In future, if upper layer passes such kind of packet, the
* judgement of the following IF branch needs to be modified. */
MPIU_Assert(last > 0 && last - sreq->dev.segment_first > 0);
if (last > 0) {
sreq->dev.tmpbuf = MPIU_Malloc((size_t) (sreq->dev.segment_size - sreq->dev.segment_first));
MPIU_Assert(sreq->dev.tmpbuf);
......
......@@ -10,9 +10,6 @@
#include "mpl_utlist.h"
#include "mpid_rma_types.h"
/* define ACC stream size as the SRBuf size */
#define MPIDI_CH3U_Acc_stream_size MPIDI_CH3U_SRBuf_size
/* =========================================================== */
/* auxiliary functions */
/* =========================================================== */
......
......@@ -10,9 +10,6 @@
#include "mpl_utlist.h"
#include "mpid_rma_types.h"
/* define ACC stream size as the SRBuf size */
#define MPIDI_CH3U_Acc_stream_size MPIDI_CH3U_SRBuf_size
static inline int do_accumulate_op(void *source_buf, int source_count, MPI_Datatype source_dtp,
void *target_buf, int target_count, MPI_Datatype target_dtp,
MPI_Aint stream_offset, MPI_Op acc_op);
......
......@@ -925,6 +925,11 @@ extern MPIDI_CH3U_SRBuf_element_t * MPIDI_CH3U_SRBuf_pool;
END SEND/RECEIVE BUFFER SECTION
-------------------------------*/
/* define ACC stream size as the SRBuf size */
#if !defined(MPIDI_CH3U_Acc_stream_size)
#define MPIDI_CH3U_Acc_stream_size MPIDI_CH3U_SRBuf_size
#endif
/*----------------------------
BEGIN DEBUGGING TOOL SECTION
----------------------------*/
......
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