#define MAX_RDMA_RD 4
#define MAX_PROCS 1000
+#define min(a, b) ((a < b) ? (a) : (b))
+#define max(a, b) ((a > b) ? (a) : (b))
+
/* Header files needed for DAT/uDAPL */
#include "dat2/udat.h"
#include "dat2/dat_ib_extensions.h"
/* definitions */
#define SERVER_CONN_QUAL 45248
-#define DTO_TIMEOUT (1000*1000*5)
+#define DTO_TIMEOUT DAT_TIMEOUT_INFINITE
#define CNO_TIMEOUT (1000*1000*1)
#define DTO_FLUSH_TIMEOUT (1000*1000*2)
#define CONN_TIMEOUT (1000*1000*100)
if (align_data) {
/* allocate send and receive buffers */
- if (posix_memalign((void**)&rbuf, 4096, buf_len * (burst+1)) ||
- posix_memalign((void**)&sbuf, 4096, buf_len * (burst+1))) {
+ if (posix_memalign((void**)&rbuf, 4096, max(64, buf_len * (burst+1))) ||
+ posix_memalign((void**)&sbuf, 4096, max(64, buf_len * (burst+1)))) {
perror("malloc");
exit(1);
}
} else {
/* allocate send and receive buffers */
- if (((rbuf = malloc(buf_len * (burst+1))) == NULL) ||
- ((sbuf = malloc(buf_len * (burst+1))) == NULL)) {
+ if (((rbuf = malloc(max(64, buf_len * (burst+1)))) == NULL) ||
+ ((sbuf = malloc(max(64, buf_len * (burst+1)))) == NULL)) {
perror("malloc");
exit(1);
}
* Setup our remote memory and tell the other side about it
*/
p_rmr_snd->virtual_address = htonll((DAT_VADDR) (uintptr_t) rbuf);
- p_rmr_snd->segment_length = htonl(RDMA_BUFFER_SIZE);
+ p_rmr_snd->segment_length = htonl(buf_len);
p_rmr_snd->rmr_context = htonl(rmr_context_recv);
printf("%d Send RMR msg to remote: r_key_ctx=0x%x,va=%p,len=0x%x\n",
- getpid(), rmr_context_recv, rbuf, RDMA_BUFFER_SIZE);
+ getpid(), rmr_context_recv, rbuf, buf_len);
ret = send_msg(p_rmr_snd,
sizeof(DAT_RMR_TRIPLET),