void do_tinject(int len) { int ret; ssize_t sz; struct fi_cq_tagged_entry cqe; rdm_tagged_sr_init_data(source, len, 0x23); rdm_tagged_sr_init_data(target, len, 0); sz = fi_tinject(ep[0], source, len, gni_addr[1], len); cr_assert_eq(sz, 0); sz = fi_trecv(ep[1], target, len, rem_mr, gni_addr[0], len, 0, source); cr_assert_eq(sz, 0); while ((ret = fi_cq_read(msg_cq[1], &cqe, 1)) == -FI_EAGAIN) { pthread_yield(); } cr_assert_eq(ret, 1); cr_assert_eq((uint64_t)cqe.op_context, (uint64_t)source); dbg_printf("got recv context event!\n"); cr_assert(rdm_tagged_sr_check_data(source, target, len), "Data mismatch"); }
ssize_t ft_post_inject(size_t size) { ssize_t ret; if (hints->caps & FI_TAGGED) { ret = fi_tinject(ep, tx_buf, size + ft_tx_prefix_size(), remote_fi_addr, tx_seq); } else { ret = fi_inject(ep, tx_buf, size + ft_tx_prefix_size(), remote_fi_addr); } if (ret) { FT_PRINTERR("transmit", ret); return ret; } tx_seq++; tx_cq_cntr++; return 0; }