int __ibv_resize_cq_1_0(struct ibv_cq_1_0 *cq, int cqe) { return ibv_resize_cq(cq->real_cq, cqe); }
int mca_btl_openib_size_queues( struct mca_btl_openib_module_t* openib_btl, size_t nprocs) { int min_cq_size; int first_time = (0 == openib_btl->num_peers); int rc; openib_btl->num_peers += nprocs; if(mca_btl_openib_component.use_srq) { openib_btl->rd_num = mca_btl_openib_component.rd_num + log2(nprocs) * mca_btl_openib_component.srq_rd_per_peer; if(openib_btl->rd_num > mca_btl_openib_component.srq_rd_max) openib_btl->rd_num = mca_btl_openib_component.srq_rd_max; openib_btl->rd_low = openib_btl->rd_num - 1; min_cq_size = openib_btl->rd_num * 2 * openib_btl->num_peers; if(!first_time) { struct ibv_srq_attr srq_attr; srq_attr.max_wr = openib_btl->rd_num; rc = ibv_modify_srq(openib_btl->srq[BTL_OPENIB_HP_QP], &srq_attr, IBV_SRQ_MAX_WR); if(rc) { BTL_ERROR(("cannot resize high priority shared receive queue, error: %d", rc)); return OMPI_ERROR; } rc = ibv_modify_srq(openib_btl->srq[BTL_OPENIB_LP_QP], &srq_attr, IBV_SRQ_MAX_WR); if(rc) { BTL_ERROR(("cannot resize low priority shared receive queue, error: %d", rc)); return OMPI_ERROR; } } } else { min_cq_size = ( mca_btl_openib_component.rd_num > (int32_t) mca_btl_openib_component.eager_rdma_num ? mca_btl_openib_component.rd_num : (int32_t) mca_btl_openib_component.eager_rdma_num ) * 2 * openib_btl->num_peers; } if(min_cq_size > (int32_t) mca_btl_openib_component.ib_cq_size) { mca_btl_openib_component.ib_cq_size = min_cq_size > openib_btl->hca->ib_dev_attr.max_cq ? openib_btl->hca->ib_dev_attr.max_cq : min_cq_size; #if OMPI_MCA_BTL_OPENIB_HAVE_RESIZE_CQ if(!first_time) { rc = ibv_resize_cq(openib_btl->ib_cq[BTL_OPENIB_LP_QP], mca_btl_openib_component.ib_cq_size); if(rc) { BTL_ERROR(("cannot resize low priority completion queue, error: %d", rc)); return OMPI_ERROR; } rc = ibv_resize_cq(openib_btl->ib_cq[BTL_OPENIB_HP_QP], mca_btl_openib_component.ib_cq_size); if(rc) { BTL_ERROR(("cannot resize high priority completion queue, error: %d", rc)); return OMPI_ERROR; } } #endif } if(first_time) { /* never been here before, setup cq and srq */ mca_btl_openib_component.ib_cq_size = (int) mca_btl_openib_component.ib_cq_size > openib_btl->hca->ib_dev_attr.max_cq ? openib_btl->hca->ib_dev_attr.max_cq : (int) mca_btl_openib_component.ib_cq_size; return mca_btl_openib_create_cq_srq(openib_btl); } return OMPI_SUCCESS; }
int __ibv_resize_cq_1_0(struct ibv_cq_1_0 *cq, int cqe) { fprintf(stderr, "%s:%s:%d \n", __func__, __FILE__, __LINE__); return ibv_resize_cq(cq->real_cq, cqe); }