示例#1
0
static int ack_open (void *qos_channel, opal_buffer_t * buf)  {
    int32_t rc = ORTE_SUCCESS;
    uint32_t eviction_timeout;
    orte_qos_ack_channel_t *ack_chan;
    ack_chan = (orte_qos_ack_channel_t*) (qos_channel);
    /* TO DO - need to adjust eviction timeout according to window size
       lets keep max time out for the first pass */
    eviction_timeout = (ack_chan->timeout_secs + QOS_ACK_WINDOW_TIMEOUT_IN_SECS) * 100000;
    /* init outstanding msg hotel */
    opal_hotel_init (&ack_chan->outstanding_msgs, QOS_ACK_MAX_OUTSTANDING_MSGS,
                       orte_event_base, eviction_timeout, 0,
                       orte_qos_ack_msg_ack_timeout_callback);
    OPAL_OUTPUT_VERBOSE((1, orte_qos_base_framework.framework_output,
                         "%s ack_open channel = %p init hotel timeout =%d",
                         ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
                         (void*)ack_chan, eviction_timeout));
    /* set the message window timer event, but don't activate it */
    /*opal_event_set(opal_event_base,
                   &ack_chan->msg_window_timer_event,
                   -1, 0, orte_qos_ack_msg_window_timeout_callback,
                   ack_chan);
    opal_event_set_priority(&ack_chan->msg_window_timer_event, ORTE_MSG_PRI);*/
    /* the Qos module puts the non local attributes  to be sent to the peer in a list at the time of create.
      pack those attributes into the buffer.*/
    if (ORTE_SUCCESS != (rc =  orte_qos_base_pack_attributes(buf, &ack_chan->attributes)))
        ORTE_ERROR_LOG(rc);
    return rc;
}
int orte_qos_base_open_channel ( void * qos_channel,
                                 opal_buffer_t *buffer)
{
    int32_t rc = ORTE_SUCCESS;
    orte_qos_base_channel_t *base_chan;
    base_chan = (orte_qos_base_channel_t*) (qos_channel);
    // the Qos module puts the non local attributes  to be sent to the peer in a list at the time of create.
    // pack those attributes into the buffer.
    if (ORTE_SUCCESS != (rc =  orte_qos_base_pack_attributes(buffer, &base_chan->attributes)))
        ORTE_ERROR_LOG(rc);
    return rc;
}