if (align_data) {
/* allocate send and receive buffers */
- if (posix_memalign((void**)&rbuf, 4096, max(64, buf_len * rq_cnt)) ||
- posix_memalign((void**)&sbuf, 4096, max(64, buf_len * rq_cnt))) {
+ if (posix_memalign((void**)&rbuf, 4096, max(4096, buf_len * rq_cnt)) ||
+ posix_memalign((void**)&sbuf, 4096, max(4096, buf_len * rq_cnt))) {
perror("malloc");
exit(1);
}
exit(1);
}
}
- LOGPRINTF("%d Allocated RDMA buffers (r:%p,s:%p) len %d \n",
- getpid(), rbuf, sbuf, buf_len);
+ init_data();
+ LOGPRINTF("%d Allocated RDMA buffers (r:%p=%d,s:%p=%d) len %d \n",
+ getpid(), rbuf, *rbuf, sbuf, *sbuf, buf_len);
if (posix_memalign((void**)&p_rmr_rcv, 4096, 4096) ||
posix_memalign((void**)&p_rmr_snd, 4096, 4096)) {
l_iov[i].segment_length);
}
start = get_time();
- for (i = 0; i < burst; i++) {
- if (rx_cnt < burst && !(server && !tx_cnt)) {
+ for (i = 0; i <= burst; i++) {
+ if (rx_cnt < burst && !(!server && !tx_cnt)) {
rx_cnt++;
while (*rx_buf != (char)rx_cnt);
}
- LOGPRINTF("%d rdma_write # %d data rcv'ed\n", getpid(), rx_cnt);
if (!((i+1) % signal_rate))
suppress = DAT_COMPLETION_DEFAULT_FLAG;
else
suppress = DAT_COMPLETION_SUPPRESS_FLAG;
+ if (tx_cnt == burst)
+ break;
+
*tx_buf = (char)++tx_cnt;
cookie.as_64 = tx_cnt;
ret = dat_ep_post_rdma_write(h_ep, MSG_IOV_COUNT,
getpid(), DT_RetToStr(ret));
return (DAT_ABORT);
}
- LOGPRINTF("%d rdma_write # %d data sent\n", getpid(), tx_cnt);
if (!suppress) {
while (dat_evd_dequeue(h_dto_req_evd, &event));
if (dto_event->status) {
dto_event->user_cookie.as_64, tx_cnt);
return (DAT_ABORT);
}
- LOGPRINTF("%d rdma_write # %d data sent event\n", getpid(), tx_cnt);
}
}
stop = get_time();
ts.rtt = ((stop - start) * 1.0e6);
- if((unsigned char)*rx_buf != (unsigned char)rx_cnt) {
+ if ((unsigned char)*rx_buf != (unsigned char)rx_cnt) {
printf( "%d %s RW pingpong: %p, last *buf %d != cnt %d\n",
getpid(), server ? "SERVER:" : "CLIENT:",
rx_buf, (unsigned char)*rx_buf,