in src/nccl_ofi_rdma.cpp [1846:1894]
static int receive_progress(nccl_net_ofi_rdma_req_t *req, bool add_to_pending)
{
int rc = 0;
switch (req->type) {
case NCCL_OFI_RDMA_EAGER_COPY:
rc = post_eager_copy(req);
break;
case NCCL_OFI_RDMA_SEND_CTRL:
rc = post_rdma_ctrl(req);
break;
case NCCL_OFI_RDMA_SEND_CLOSE:
rc = post_close_msg(req);
break;
case NCCL_OFI_RDMA_FLUSH:
rc = post_flush_req(req);
break;
case NCCL_OFI_RDMA_READ: // Post RMA read
rc = post_rma_read(req);
break;
case NCCL_OFI_RDMA_WRITE:
case NCCL_OFI_RDMA_RECV:
case NCCL_OFI_RDMA_SEND:
case NCCL_OFI_RDMA_RECV_SEGMS:
case NCCL_OFI_RDMA_CTRL_RX_BUFF:
case NCCL_OFI_RDMA_EAGER_RX_BUFF:
case NCCL_OFI_RDMA_SEND_CONN:
case NCCL_OFI_RDMA_RECV_CONN:
case NCCL_OFI_RDMA_RECV_CONN_RESP:
case NCCL_OFI_RDMA_SEND_CONN_RESP:
case NCCL_OFI_RDMA_INVALID_TYPE:
default:
NCCL_OFI_WARN("Unexpected type: %d", req->type);
return -EINVAL;
}
if (rc == -FI_EAGAIN && add_to_pending) {
nccl_net_ofi_rdma_recv_comm_t *r_comm = (nccl_net_ofi_rdma_recv_comm_t *)req->comm;
/* Extract ep */
nccl_net_ofi_rdma_ep_t *ep = (nccl_net_ofi_rdma_ep_t *)r_comm->base.base.ep;
/* Place in pending requests queue for next try */
nccl_net_ofi_mutex_lock(&ep->pending_reqs_lock);
ep->pending_reqs_queue->push_back(req);
nccl_net_ofi_mutex_unlock(&ep->pending_reqs_lock);
rc = 0;
NCCL_OFI_TRACE_PENDING_INSERT(req);
}
return rc;
}