1
1
openmpi/orte/mca/oob/tcp/oob_tcp_peer.h
Ralph Castain 649301a3a2 Revise the routed framework to be multi-select so it can support the new conduit system. Update all calls to rml.send* to the new syntax. Define an orte_mgmt_conduit for admin and IOF messages, and an orte_coll_conduit for all collective operations (e.g., xcast, modex, and barrier).
Still not completely done as we need a better way of tracking the routed module being used down in the OOB - e.g., when a peer drops connection, we want to remove that route from all conduits that (a) use the OOB and (b) are routed, but we don't want to remove it from an OFI conduit.
2016-10-23 21:52:39 -07:00

113 строки
5.0 KiB
C

/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef _MCA_OOB_TCP_PEER_H_
#define _MCA_OOB_TCP_PEER_H_
#include "orte_config.h"
#include "oob_tcp.h"
#include "oob_tcp_sendrecv.h"
typedef struct {
opal_list_item_t super;
struct sockaddr_storage addr; // an address where a peer can be found
int retries; // number of times we have tried to connect to this address
mca_oob_tcp_state_t state; // state of this address
} mca_oob_tcp_addr_t;
OBJ_CLASS_DECLARATION(mca_oob_tcp_addr_t);
/* object for tracking peers in the module */
typedef struct {
opal_list_item_t super;
/* although not required, there is enough debug
* value that retaining the name makes sense
*/
orte_process_name_t name;
char *auth_method; // method they used to authenticate
int sd;
opal_list_t addrs;
mca_oob_tcp_addr_t *active_addr;
mca_oob_tcp_state_t state;
int num_retries;
opal_event_t send_event; /**< registration with event thread for send events */
bool send_ev_active;
opal_event_t recv_event; /**< registration with event thread for recv events */
bool recv_ev_active;
opal_event_t timer_event; /**< timer for retrying connection failures */
bool timer_ev_active;
opal_list_t send_queue; /**< list of messages to send */
mca_oob_tcp_send_t *send_msg; /**< current send in progress */
mca_oob_tcp_recv_t *recv_msg; /**< current recv in progress */
} mca_oob_tcp_peer_t;
OBJ_CLASS_DECLARATION(mca_oob_tcp_peer_t);
/* state machine for processing peer data */
typedef struct {
opal_object_t super;
opal_event_t ev;
orte_process_name_t peer;
uint16_t af_family;
char *net;
char *port;
char *rtmod;
} mca_oob_tcp_peer_op_t;
OBJ_CLASS_DECLARATION(mca_oob_tcp_peer_op_t);
#define ORTE_ACTIVATE_TCP_PEER_OP(p, a, n, pts, cbfunc) \
do { \
mca_oob_tcp_peer_op_t *pop; \
pop = OBJ_NEW(mca_oob_tcp_peer_op_t); \
pop->peer.jobid = (p)->jobid; \
pop->peer.vpid = (p)->vpid; \
pop->af_family = (a); \
if (NULL != (n)) { \
pop->net = strdup((n)); \
} \
if (NULL != (pts)) { \
pop->port = strdup((pts)); \
} \
opal_event_set(mca_oob_tcp_module.ev_base, &pop->ev, -1, \
OPAL_EV_WRITE, (cbfunc), pop); \
opal_event_set_priority(&pop->ev, ORTE_MSG_PRI); \
opal_event_active(&pop->ev, OPAL_EV_WRITE, 1); \
} while(0);
#define ORTE_ACTIVATE_TCP_CMP_OP(p, r, cbfunc) \
do { \
mca_oob_tcp_peer_op_t *pop; \
char *proxy; \
pop = OBJ_NEW(mca_oob_tcp_peer_op_t); \
pop->peer.jobid = (p)->jobid; \
pop->peer.vpid = (p)->vpid; \
proxy = (r); \
if (NULL != proxy) { \
pop->rtmod = strdup(proxy); \
} \
opal_event_set(mca_oob_tcp_module.ev_base, &pop->ev, -1, \
OPAL_EV_WRITE, (cbfunc), pop); \
opal_event_set_priority(&pop->ev, ORTE_MSG_PRI); \
opal_event_active(&pop->ev, OPAL_EV_WRITE, 1); \
} while(0);
#endif /* _MCA_OOB_TCP_PEER_H_ */