static bool
more_handles (DT_Tdep_Print_Head *phead,
- DAT_HANDLE **old_ptrptr, /* pointer to current pointer */
+ void **old_ptrptr, /* pointer to current pointer */
unsigned int *old_count, /* number pointed to */
unsigned int size) /* size of one datum */
{
unsigned int count = *old_count;
- DAT_HANDLE *old_handles = *old_ptrptr;
- DAT_HANDLE *handle_tmp = DT_Mdep_Malloc (count * 2 * size);
+ void *old_handles = *old_ptrptr;
+ void *handle_tmp = DT_Mdep_Malloc (count * 2 * size);
if (!handle_tmp)
{
DAT_EVD_HANDLE ia_async_handle;
}
OneOpen;
- unsigned int count = START_COUNT;
- OneOpen *hdlptr = (OneOpen *)
- DT_Mdep_Malloc (count * sizeof (*hdlptr));
+ unsigned int count = START_COUNT;
+ void *hptr = DT_Mdep_Malloc (count * sizeof(OneOpen));
+ OneOpen *hdlptr = (OneOpen *)hptr;
/* IA Exhaustion test loop */
if (hdlptr)
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
- &count,
- sizeof (*hdlptr)))
+ && !more_handles (phead, &hptr, &count, sizeof(*hdlptr)))
{
DT_Tdep_PT_Printf (phead, "%s: IAs opened: %d\n", module, w);
retval = true;
break;
}
+ hdlptr = (OneOpen *)hptr;
/* Specify that we want to get back an async EVD. */
hdlptr[w].ia_async_handle = DAT_HANDLE_NULL;
ret = dat_ia_open (cmd->device_name,
/*
* See how many PZs we can create
*/
- unsigned int count = START_COUNT;
- DAT_PZ_HANDLE *hdlptr = (DAT_PZ_HANDLE *)
- DT_Mdep_Malloc (count * sizeof (*hdlptr));
+ unsigned int count = START_COUNT;
+ void *hptr = DT_Mdep_Malloc (count * sizeof(DAT_PZ_HANDLE));
+ DAT_PZ_HANDLE *hdlptr = (DAT_PZ_HANDLE *)hptr;
/* PZ Exhaustion test loop */
if (hdlptr)
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
- &count,
- sizeof (*hdlptr)))
+ && !more_handles(phead, &hptr, &count, sizeof(*hdlptr)))
{
DT_Tdep_PT_Printf (phead, "%s: PZs created: %d\n", module, w);
retval = true;
break;
}
+ hdlptr = (DAT_PZ_HANDLE *)hptr;
ret = dat_pz_create (hdl_sets[w % cmd->width].ia_handle,
&hdlptr[w]);
if (ret != DAT_SUCCESS)
/*
* See how many CNOs we can create
*/
- unsigned int count = START_COUNT;
- DAT_CNO_HANDLE *hdlptr = (DAT_CNO_HANDLE *)
- DT_Mdep_Malloc (count * sizeof (*hdlptr));
-
+ unsigned int count = START_COUNT;
+ void *hptr = DT_Mdep_Malloc (count * sizeof(DAT_CNO_HANDLE));
+ DAT_CNO_HANDLE *hdlptr = (DAT_CNO_HANDLE *)hptr;
+
/* CNO Exhaustion test loop */
if (hdlptr)
{
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
- &count,
- sizeof (*hdlptr)))
+ && !more_handles(phead, &hptr, &count, sizeof (*hdlptr)))
{
DT_Tdep_PT_Printf (phead, "%s: CNOs created: %d\n", module, w);
retval = true;
break;
}
+ hdlptr = (DAT_CNO_HANDLE *)hptr;
ret = dat_cno_create (hdl_sets[w % cmd->width].ia_handle,
DAT_OS_WAIT_PROXY_AGENT_NULL,
&hdlptr[w]);
/*
* See how many EVDs we can create
*/
- unsigned int count = START_COUNT;
- DAT_EVD_HANDLE *hdlptr = (DAT_EVD_HANDLE *)
- DT_Mdep_Malloc (count * sizeof (*hdlptr));
+ unsigned int count = START_COUNT;
+ void *hptr = DT_Mdep_Malloc(count * sizeof(DAT_EVD_HANDLE));
+ DAT_EVD_HANDLE *hdlptr = (DAT_EVD_HANDLE *)hptr;
+
DAT_EVD_FLAGS flags = ( DAT_EVD_DTO_FLAG
| DAT_EVD_RMR_BIND_FLAG
| DAT_EVD_CR_FLAG);
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
- &count,
- sizeof (*hdlptr)))
+ && !more_handles(phead, &hptr, &count, sizeof(*hdlptr)))
{
DT_Tdep_PT_Printf (phead, "%s: EVDs created: %d\n", module, w);
retval = true;
break;
}
+ hdlptr = (DAT_EVD_HANDLE *)hptr;
ret = DT_Tdep_evd_create (hdl_sets[w % cmd->width].ia_handle,
DFLT_QLEN,
hdl_sets[w % cmd->width].cno_handle,
/*
* See how many EPs we can create
*/
- unsigned int count = START_COUNT;
- DAT_EP_HANDLE *hdlptr = (DAT_EP_HANDLE *)
- DT_Mdep_Malloc (count * sizeof (*hdlptr));
+ unsigned int count = START_COUNT;
+ void *hptr = DT_Mdep_Malloc(count * sizeof(DAT_EP_HANDLE));
+ DAT_EP_HANDLE *hdlptr = (DAT_EP_HANDLE *)hptr;
/* EP Exhaustion test loop */
if (hdlptr)
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
- &count,
- sizeof (*hdlptr)))
+ && !more_handles(phead, &hptr, &count, sizeof(*hdlptr)))
{
DT_Tdep_PT_Printf (phead, "%s: EPs created: %d\n", module, w);
retval = true;
break;
}
+ hdlptr = (DAT_EP_HANDLE *)hptr;
ret = dat_ep_create (hdl_sets[w % cmd->width].ia_handle,
hdl_sets[w % cmd->width].pz_handle,
hdl_sets[w % cmd->width].evd_handle,
/*
* See how many RSPs we can create
*/
- unsigned int count = START_COUNT;
- DAT_RSP_HANDLE *hdlptr = (DAT_RSP_HANDLE *)
- DT_Mdep_Malloc (count * sizeof (*hdlptr));
- DAT_EP_HANDLE *epptr = (DAT_EP_HANDLE *)
- DT_Mdep_Malloc (count * sizeof (*epptr));
+ unsigned int count = START_COUNT;
+ void *hptr = DT_Mdep_Malloc(count * sizeof (DAT_RSP_HANDLE));
+ DAT_RSP_HANDLE *hdlptr = (DAT_RSP_HANDLE *)hptr;
+ void *eptr = DT_Mdep_Malloc(count * sizeof (DAT_EP_HANDLE));
+ DAT_EP_HANDLE *epptr = (DAT_EP_HANDLE *)eptr;
/* RSP Exhaustion test loop */
if (hdlptr)
unsigned int count1 = count;
unsigned int count2 = count;
- if (!more_handles (phead, (DAT_HANDLE **) &hdlptr,
- &count1,
- sizeof (*hdlptr)))
+ if (!more_handles(phead, &hptr, &count1, sizeof(*hdlptr)))
{
DT_Tdep_PT_Printf (phead, "%s: RSPs created: %d\n", module, w);
retval = true;
break;
}
- if (!more_handles (phead, (DAT_HANDLE **) &epptr,
- &count2,
- sizeof (*epptr)))
+ hdlptr = (DAT_RSP_HANDLE *)hptr;
+
+ if (!more_handles (phead, &eptr, &count2, sizeof(*epptr)))
{
DT_Tdep_PT_Printf (phead, "%s: RSPs created: %d\n", module, w);
retval = true;
break;
}
-
+ epptr = (DAT_EP_HANDLE *)eptr;
if (count1 != count2)
{
DT_Tdep_PT_Printf (phead, "%s: Mismatch in allocation of handle arrays at point %d\n",
/*
* See how many PSPs we can create
*/
- unsigned int count = START_COUNT;
- DAT_PSP_HANDLE *hdlptr = (DAT_PSP_HANDLE *)
- DT_Mdep_Malloc (count * sizeof (*hdlptr));
+ unsigned int count = START_COUNT;
+ void *hptr = DT_Mdep_Malloc (count * sizeof (DAT_PSP_HANDLE));
+ DAT_PSP_HANDLE *hdlptr = (DAT_PSP_HANDLE *)hptr;
/* PSP Exhaustion test loop */
if (hdlptr)
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
- &count,
- sizeof (*hdlptr)))
+ && !more_handles (phead, &hptr, &count, sizeof(*hdlptr)))
{
DT_Tdep_PT_Printf (phead, "%s: PSPs created: %d\n", module, w);
retval = true;
break;
}
+ hdlptr = (DAT_PSP_HANDLE *)hptr;
ret = dat_psp_create (hdl_sets[w % cmd->width].ia_handle,
CONN_QUAL0 + w,
hdl_sets[w % cmd->width].evd_handle,
/*
* See how many LMRs we can create
*/
- unsigned int count = START_COUNT;
- Bpool **hdlptr = (Bpool **)
- DT_Mdep_Malloc (count * sizeof (*hdlptr));
-
+ unsigned int count = START_COUNT;
+ void *hptr = DT_Mdep_Malloc (count * sizeof(Bpool*));
+ Bpool **hdlptr = (Bpool **)hptr;
+
/* LMR Exhaustion test loop */
if (hdlptr)
{
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
- &count,
- sizeof (*hdlptr)))
+ && !more_handles (phead, &hptr, &count, sizeof(*hdlptr)))
{
DT_Tdep_PT_Printf (phead, "%s: no memory for LMR handles\n",
module);
retval = true;
break;
}
+ hdlptr = (Bpool **)hptr;
/*
* Let BpoolAlloc do the hard work; this means that
* we're testing unique memory registrations rather
* We are posting the same buffer 'cnt' times, deliberately,
* but that should be OK.
*/
- unsigned int count = START_COUNT;
- DAT_LMR_TRIPLET *hdlptr = (DAT_LMR_TRIPLET *)
- DT_Mdep_Malloc (count * cmd->width * sizeof (*hdlptr));
+ unsigned int count = START_COUNT;
+ void *hptr =
+ DT_Mdep_Malloc(count * cmd->width * sizeof(DAT_LMR_TRIPLET));
+ DAT_LMR_TRIPLET *hdlptr = (DAT_LMR_TRIPLET *)hptr;
/* Recv-Post Exhaustion test loop */
if (hdlptr)
{
- unsigned int w = 0;
+ unsigned int w = 0;
unsigned int i = 0;
unsigned int done = 0;
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
- &count,
- cmd->width * sizeof (*hdlptr)))
+ && !more_handles (phead, &hptr, &count,
+ cmd->width * sizeof(*hdlptr)))
{
DT_Tdep_PT_Printf (phead, "%s: no memory for IOVs \n",
module);
done = retval = true;
break;
}
+ hdlptr = (DAT_LMR_TRIPLET *)hptr;
for (i = 0; i < cmd->width; i++)
{
DAT_LMR_TRIPLET *iovp = &hdlptr[w * cmd->width + i];
#define DAPL_PROVIDER "OpenIB-cma"
#endif
+#define F64x "%"PRIx64""
#define MAX_POLLING_CNT 50000
#define MAX_RDMA_RD 4
#define MAX_PROCS 1000
} time;
/* defaults */
-static int parent=1;
static int connected=0;
static int burst=10;
static int server=1;
static int poll_count=0;
static int rdma_wr_poll_count=0;
static int rdma_rd_poll_count[MAX_RDMA_RD]={0};
-static int pin_memory=0;
static int delay=0;
static int buf_len=RDMA_BUFFER_SIZE;
static int use_cno=0;
-static int post_recv_count=MSG_BUF_COUNT;
static int recv_msg_index=0;
static int burst_msg_posted=0;
static int burst_msg_index=0;
-static pid_t child[MAX_PROCS+1];
-
/* forward prototypes */
const char * DT_RetToString (DAT_RETURN ret_value);
const char * DT_EventToSTr (DAT_EVENT_NUMBER event_code);
#define LOGPRINTF(_format, _aa...) \
if (verbose) \
printf(_format, ##_aa)
-
+int
main(int argc, char **argv)
{
int i,c;
inet_ntop(AF_INET,
&((struct sockaddr_in *)ep_param.local_ia_address_ptr)->sin_addr,
addr_str, sizeof(addr_str));
- printf("\n%d Query EP: LOCAL addr %s port %d\n", getpid(),
+ printf("\n%d Query EP: LOCAL addr %s port "F64x"\n", getpid(),
addr_str, ep_param.local_port_qual);
inet_ntop(AF_INET,
&((struct sockaddr_in *)ep_param.remote_ia_address_ptr)->sin_addr,
addr_str, sizeof(addr_str));
- printf("%d Query EP: REMOTE addr %s port %d\n", getpid(),
+ printf("%d Query EP: REMOTE addr %s port "F64x"\n", getpid(),
addr_str, ep_param.remote_port_qual);
fflush(stdout);
/* free rdma buffers */
free(rbuf);
free(sbuf);
+ return(0);
}
if ((event.event_data.dto_completion_event_data.transfered_length != size ) ||
(event.event_data.dto_completion_event_data.user_cookie.as_64 != 0xaaaa )) {
- fprintf(stderr, "%d: ERROR: DTO len %d or cookie " PRIx64 "\n",
+ fprintf(stderr, "%d: ERROR: DTO len "F64x" or cookie "F64x"\n",
getpid(),
event.event_data.dto_completion_event_data.transfered_length,
event.event_data.dto_completion_event_data.user_cookie.as_64 );
connect_ep( char *hostname, int conn_id )
{
DAT_SOCK_ADDR remote_addr;
- DAT_EP_ATTR ep_attr;
DAT_RETURN ret;
DAT_REGION_DESCRIPTION region;
DAT_EVENT event;
/* Register send message buffer */
LOGPRINTF("%d Registering send Message Buffer %p, len %d\n",
- getpid(), &rmr_send_msg, sizeof(DAT_RMR_TRIPLET) );
+ getpid(), &rmr_send_msg, (int)sizeof(DAT_RMR_TRIPLET));
region.for_va = &rmr_send_msg;
ret = dat_lmr_create( h_ia,
DAT_MEM_TYPE_VIRTUAL,
rmr_send_msg.target_address = (DAT_VADDR)(unsigned long)rbuf;
rmr_send_msg.segment_length = RDMA_BUFFER_SIZE;
- printf("%d Send RMR to remote: snd_msg: r_key_ctx=%x,pad=%x,va=%llx,len=0x%x\n",
+ printf("%d Send RMR to remote: snd_msg: r_key_ctx=%x,pad=%x, "
+ "va="F64x",len="F64x"\n",
getpid(), rmr_send_msg.rmr_context, rmr_send_msg.pad,
rmr_send_msg.target_address, rmr_send_msg.segment_length );
sizeof( DAT_RMR_TRIPLET )) ||
(event.event_data.dto_completion_event_data.user_cookie.as_64 !=
recv_msg_index) ) {
- fprintf(stderr,"ERR recv event: len=%d cookie=" PRIx64 " expected %d/%d\n",
+ fprintf(stderr,"ERR recv event: len=%d cookie="F64x" expected %d/%d\n",
(int)event.event_data.dto_completion_event_data.transfered_length,
- (int)event.event_data.dto_completion_event_data.user_cookie.as_64,
- sizeof(DAT_RMR_TRIPLET), recv_msg_index );
+ event.event_data.dto_completion_event_data.user_cookie.as_64,
+ (int)sizeof(DAT_RMR_TRIPLET), recv_msg_index );
return( DAT_ABORT );
}
r_iov = rmr_recv_msg[ recv_msg_index ];
- printf("%d Received RMR from remote: r_iov: r_key_ctx=%x,pad=%x,va=%llx,len=0x%x\n",
+ printf("%d Received RMR from remote: r_iov: r_key_ctx=%x,pad=%x "
+ ",va="F64x",len="F64x"\n",
getpid(), r_iov.rmr_context, r_iov.pad,
r_iov.target_address, r_iov.segment_length );
DAT_RETURN ret;
DAT_EVENT event;
DAT_COUNT nmore;
- int i,flush_cnt;
if (connected) {
DAT_RETURN
do_rdma_write_with_msg( )
{
- DAT_REGION_DESCRIPTION region;
DAT_EVENT event;
DAT_COUNT nmore;
DAT_LMR_TRIPLET l_iov[MSG_IOV_COUNT];
DAT_RMR_TRIPLET r_iov;
DAT_DTO_COOKIE cookie;
- DAT_RMR_CONTEXT their_context;
DAT_RETURN ret;
int i;
l_iov[i].virtual_address = (DAT_VADDR)(unsigned long)
(&sbuf[l_iov[i].segment_length*i]);
- LOGPRINTF("%d rdma_write iov[%d] buf=%p,len=%d\n",
+ LOGPRINTF("%d rdma_write iov[%d] buf=%p,len="F64x"\n",
getpid(), i, &sbuf[l_iov[i].segment_length*i],
l_iov[i].segment_length);
}
if ( (event.event_data.dto_completion_event_data.transfered_length != sizeof( DAT_RMR_TRIPLET )) ||
(event.event_data.dto_completion_event_data.user_cookie.as_64 != recv_msg_index) ) { +
- fprintf(stderr,"unexpected event data for receive: len=%d cookie=" PRIx64 " exp %d/%d\n",
+ fprintf(stderr,"unexpected event data for receive: len=%d cookie="F64x" exp %d/%d\n",
(int)event.event_data.dto_completion_event_data.transfered_length,
- (int)event.event_data.dto_completion_event_data.user_cookie.as_64,
- sizeof(DAT_RMR_TRIPLET), recv_msg_index );
+ event.event_data.dto_completion_event_data.user_cookie.as_64,
+ (int)sizeof(DAT_RMR_TRIPLET), recv_msg_index );
return( DAT_ABORT );
}
r_iov = rmr_recv_msg[ recv_msg_index ];
- printf("%d Received RMR from remote: r_iov: ctx=%x,pad=%x,va=%p,len=0x%x\n",
+ printf("%d Received RMR from remote: r_iov: ctx=%x,pad=%x,va=%p,len="F64x"\n",
getpid(), r_iov.rmr_context,
r_iov.pad,
(void*)(unsigned long)r_iov.target_address,
DAT_RETURN
do_rdma_read_with_msg( )
{
- DAT_REGION_DESCRIPTION region;
DAT_EVENT event;
DAT_COUNT nmore;
DAT_LMR_TRIPLET l_iov;
DAT_RMR_TRIPLET r_iov;
DAT_DTO_COOKIE cookie;
- DAT_RMR_CONTEXT their_context;
DAT_RETURN ret;
int i;
}
if ((event.event_data.dto_completion_event_data.transfered_length != buf_len ) ||
(event.event_data.dto_completion_event_data.user_cookie.as_64 != 0x9999 )) {
- fprintf(stderr, "%d: ERROR: DTO len %d or cookie " PRIx64 "\n",
+ fprintf(stderr, "%d: ERROR: DTO len %d or cookie "F64x"\n",
getpid(),
- event.event_data.dto_completion_event_data.transfered_length,
+ (int)event.event_data.dto_completion_event_data.transfered_length,
event.event_data.dto_completion_event_data.user_cookie.as_64 );
return( DAT_ABORT );
}
if ( (event.event_data.dto_completion_event_data.transfered_length != sizeof( DAT_RMR_TRIPLET )) ||
(event.event_data.dto_completion_event_data.user_cookie.as_64 != recv_msg_index) ) {
- fprintf(stderr,"unexpected event data for receive: len=%d cookie=" PRIx64 " exp %d/%d\n",
+ fprintf(stderr,"unexpected event data for receive: len=%d cookie="F64x" exp %d/%d\n",
(int)event.event_data.dto_completion_event_data.transfered_length,
- (int)event.event_data.dto_completion_event_data.user_cookie.as_64,
- sizeof(DAT_RMR_TRIPLET), recv_msg_index );
+ event.event_data.dto_completion_event_data.user_cookie.as_64,
+ (int)sizeof(DAT_RMR_TRIPLET), recv_msg_index );
return( DAT_ABORT );
}
r_iov = rmr_recv_msg[ recv_msg_index ];
- printf("%d Received RMR from remote: r_iov: ctx=%x,pad=%x,va=%p,len=0x%x\n",
+ printf("%d Received RMR from remote: r_iov: ctx=%x,pad=%x,va=%p,len="F64x"\n",
getpid(), r_iov.rmr_context, r_iov.pad,
(void*)(unsigned long)r_iov.target_address, r_iov.segment_length );
!= buf_len) ||
(event.event_data.dto_completion_event_data.user_cookie.as_64
!= burst_msg_index) ) {
- fprintf(stderr,"ERR: recv event: len=%d cookie=" PRIx64 " exp %d/%d\n",
+ fprintf(stderr,"ERR: recv event: len=%d cookie="F64x" exp %d/%d\n",
(int)event.event_data.dto_completion_event_data.transfered_length,
- (int)event.event_data.dto_completion_event_data.user_cookie.as_64,
+ event.event_data.dto_completion_event_data.user_cookie.as_64,
buf_len, burst_msg_index );
return( DAT_ABORT );
DT_RetToString (DAT_RETURN ret_value)
{
const char *major_msg, *minor_msg;
- int sz;
dat_strerror (ret_value, &major_msg, &minor_msg);