示例#1
0
ucs_status_t uct_ugni_ep_flush(uct_ep_h tl_ep, unsigned flags,
                               uct_completion_t *comp)
{
    uct_ugni_ep_t *ep = ucs_derived_of(tl_ep, uct_ugni_ep_t);
    uct_ugni_iface_t *iface = ucs_derived_of(tl_ep->iface,
                                           uct_ugni_iface_t);

    if (uct_ugni_can_flush(ep)) {
        UCT_TL_EP_STAT_FLUSH(ucs_derived_of(tl_ep, uct_base_ep_t));
        return UCS_OK;
    }

    ep->flush_flag = 1;
    ep->arb_flush = ep->arb_size;
    uct_ugni_progress(iface);
    UCT_TL_EP_STAT_FLUSH_WAIT(ucs_derived_of(tl_ep, uct_base_ep_t));
    return UCS_ERR_NO_RESOURCE;
}
示例#2
0
static ucs_status_t uct_ugni_smsg_ep_flush(uct_ep_h tl_ep, unsigned flags,
                                           uct_completion_t *comp)
{
    uct_ugni_smsg_ep_t *ep = ucs_derived_of(tl_ep, uct_ugni_smsg_ep_t);
    ucs_status_t status;

    /* Even if we have no outstanding requests we can still get back send credits */
    status = progress_local_cq(ucs_derived_of(tl_ep->iface, uct_ugni_smsg_iface_t));

    if((0 == ep->super.outstanding) && (ep->super.arb_size == 0)) {
        ep->super.flush_flag = 0;
    }
    
    if(uct_ugni_can_flush(&ep->super)) {
        UCT_TL_EP_STAT_FLUSH(ucs_derived_of(tl_ep, uct_base_ep_t));
        status = UCS_OK;
    } else {
        ep->super.flush_flag = 1;
        UCT_TL_EP_STAT_FLUSH_WAIT(ucs_derived_of(tl_ep, uct_base_ep_t));
        status = UCS_ERR_NO_RESOURCE;
    }

    return status;
}