static void process_resend(int fd, short args, void *cbdata) { mca_oob_tcp_msg_error_t *op = (mca_oob_tcp_msg_error_t*)cbdata; mca_oob_tcp_peer_t *peer; opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:tcp processing resend to peer %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(&op->hop)); /* do we know this peer? */ if (NULL == (peer = mca_oob_tcp_peer_lookup(&op->hop))) { /* push this back to the component so it can try * another module within this transport. If no * module can be found, the component can push back * to the framework so another component can try */ opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] peer %s unknown", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(&op->hop)); ORTE_ACTIVATE_TCP_MSG_ERROR(op->snd, NULL, &op->hop, mca_oob_tcp_component_hop_unknown); goto cleanup; } /* add the msg to this peer's send queue */ if (MCA_OOB_TCP_CONNECTED == peer->state) { opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s tcp:resend: already connected to %s - queueing for send", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(&peer->name)); MCA_OOB_TCP_QUEUE_MSG(peer, op->snd, true); goto cleanup; } if (MCA_OOB_TCP_CONNECTING != peer->state && MCA_OOB_TCP_CONNECT_ACK != peer->state) { /* add the message to the queue for sending after the * connection is formed */ MCA_OOB_TCP_QUEUE_MSG(peer, op->snd, false); /* we have to initiate the connection - again, we do not * want to block while the connection is created. * So throw us into an event that will create * the connection via a mini-state-machine :-) */ opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s tcp:send_nb: initiating connection to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(&peer->name)); peer->state = MCA_OOB_TCP_CONNECTING; ORTE_ACTIVATE_TCP_CONN_STATE(peer, mca_oob_tcp_peer_try_connect); } cleanup: OBJ_RELEASE(op); }
/* API functions */ static void ping(const orte_process_name_t *proc) { mca_oob_tcp_peer_t *peer; opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] processing ping to peer %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(proc)); /* do we know this peer? */ if (NULL == (peer = mca_oob_tcp_peer_lookup(proc))) { /* push this back to the component so it can try * another module within this transport. If no * module can be found, the component can push back * to the framework so another component can try */ opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] hop %s unknown", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(proc)); ORTE_ACTIVATE_TCP_MSG_ERROR(NULL, NULL, proc, mca_oob_tcp_component_hop_unknown); return; } /* has this peer had a progress thread assigned yet? */ if (NULL == peer->ev_base) { /* nope - assign one */ ORTE_OOB_TCP_NEXT_BASE(peer); } /* if we are already connected, there is nothing to do */ if (MCA_OOB_TCP_CONNECTED == peer->state) { opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] already connected to peer %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(proc)); return; } /* if we are already connecting, there is nothing to do */ if (MCA_OOB_TCP_CONNECTING == peer->state || MCA_OOB_TCP_CONNECT_ACK == peer->state) { opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] already connecting to peer %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(proc)); return; } /* attempt the connection */ peer->state = MCA_OOB_TCP_CONNECTING; ORTE_ACTIVATE_TCP_CONN_STATE(peer, mca_oob_tcp_peer_try_connect); }
/* API functions */ static void process_ping(int fd, short args, void *cbdata) { mca_oob_tcp_ping_t *op = (mca_oob_tcp_ping_t*)cbdata; mca_oob_tcp_peer_t *peer; opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] processing ping to peer %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(&op->peer)); /* do we know this peer? */ if (NULL == (peer = mca_oob_tcp_peer_lookup(&op->peer))) { /* push this back to the component so it can try * another module within this transport. If no * module can be found, the component can push back * to the framework so another component can try */ opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] hop %s unknown", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(&op->peer)); ORTE_ACTIVATE_TCP_MSG_ERROR(NULL, NULL, &op->peer, mca_oob_tcp_component_hop_unknown); goto cleanup; } /* if we are already connected, there is nothing to do */ if (MCA_OOB_TCP_CONNECTED == peer->state) { opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] already connected to peer %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(&op->peer)); goto cleanup; } /* if we are already connecting, there is nothing to do */ if (MCA_OOB_TCP_CONNECTING == peer->state && MCA_OOB_TCP_CONNECT_ACK == peer->state) { opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] already connecting to peer %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(&op->peer)); goto cleanup; } /* attempt the connection */ peer->state = MCA_OOB_TCP_CONNECTING; ORTE_ACTIVATE_TCP_CONN_STATE(peer, mca_oob_tcp_peer_try_connect); cleanup: OBJ_RELEASE(op); }
static void process_send(int fd, short args, void *cbdata) { mca_oob_tcp_msg_op_t *op = (mca_oob_tcp_msg_op_t*)cbdata; mca_oob_tcp_peer_t *peer; orte_process_name_t hop; opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] processing send to peer %s:%d to channel =%d seq_num = %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(&op->msg->dst), op->msg->tag, op->msg->dst_channel, op->msg->seq_num); /* do we have a route to this peer (could be direct)? */ hop = orte_routed.get_route(&op->msg->dst); /* do we know this hop? */ if (NULL == (peer = mca_oob_tcp_peer_lookup(&hop))) { /* push this back to the component so it can try * another module within this transport. If no * module can be found, the component can push back * to the framework so another component can try */ opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] hop %s unknown", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(&hop)); ORTE_ACTIVATE_TCP_NO_ROUTE(op->msg, &hop, mca_oob_tcp_component_no_route); goto cleanup; } /* add the msg to the hop's send queue */ if (MCA_OOB_TCP_CONNECTED == peer->state) { opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s tcp:send_nb: already connected to %s - queueing for send", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(&peer->name)); MCA_OOB_TCP_QUEUE_SEND(op->msg, peer); goto cleanup; } /* add the message to the queue for sending after the * connection is formed */ MCA_OOB_TCP_QUEUE_PENDING(op->msg, peer); if (MCA_OOB_TCP_CONNECTING != peer->state && MCA_OOB_TCP_CONNECT_ACK != peer->state) { /* we have to initiate the connection - again, we do not * want to block while the connection is created. * So throw us into an event that will create * the connection via a mini-state-machine :-) */ opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s tcp:send_nb: initiating connection to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(&peer->name)); peer->state = MCA_OOB_TCP_CONNECTING; ORTE_ACTIVATE_TCP_CONN_STATE(peer, mca_oob_tcp_peer_try_connect); } cleanup: OBJ_RELEASE(op); }
static void send_nb(orte_rml_send_t *msg) { mca_oob_tcp_peer_t *peer; orte_process_name_t hop; /* do we have a route to this peer (could be direct)? */ hop = orte_routed.get_route(&msg->dst); /* do we know this hop? */ if (NULL == (peer = mca_oob_tcp_peer_lookup(&hop))) { /* push this back to the component so it can try * another module within this transport. If no * module can be found, the component can push back * to the framework so another component can try */ opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] processing send to peer %s:%d seq_num = %d hop %s unknown", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(&msg->dst), msg->tag, msg->seq_num, ORTE_NAME_PRINT(&hop)); ORTE_ACTIVATE_TCP_NO_ROUTE(msg, &hop, mca_oob_tcp_component_no_route); return; } opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s:[%s:%d] processing send to peer %s:%d seq_num = %d via %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), __FILE__, __LINE__, ORTE_NAME_PRINT(&msg->dst), msg->tag, msg->seq_num, ORTE_NAME_PRINT(&peer->name)); /* has this peer had a progress thread assigned yet? */ if (NULL == peer->ev_base) { /* nope - assign one */ ORTE_OOB_TCP_NEXT_BASE(peer); } /* add the msg to the hop's send queue */ if (MCA_OOB_TCP_CONNECTED == peer->state) { opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s tcp:send_nb: already connected to %s - queueing for send", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(&peer->name)); MCA_OOB_TCP_QUEUE_SEND(msg, peer); return; } /* add the message to the queue for sending after the * connection is formed */ MCA_OOB_TCP_QUEUE_PENDING(msg, peer); if (MCA_OOB_TCP_CONNECTING != peer->state && MCA_OOB_TCP_CONNECT_ACK != peer->state) { /* we have to initiate the connection - again, we do not * want to block while the connection is created. * So throw us into an event that will create * the connection via a mini-state-machine :-) */ opal_output_verbose(2, orte_oob_base_framework.framework_output, "%s tcp:send_nb: initiating connection to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(&peer->name)); peer->state = MCA_OOB_TCP_CONNECTING; ORTE_ACTIVATE_TCP_CONN_STATE(peer, mca_oob_tcp_peer_try_connect); } }