OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

btl_tcp_endpoint.h
1 /*
2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2007 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * $COPYRIGHT$
13 *
14 * Additional copyrights may follow
15 *
16 * $HEADER$
17 */
18
19 #ifndef MCA_BTL_TCP_ENDPOINT_H
20 #define MCA_BTL_TCP_ENDPOINT_H
21
22 #include "opal/class/opal_list.h"
23 #include "opal/mca/event/event.h"
24 #include "btl_tcp_frag.h"
25 #include "btl_tcp.h"
26 BEGIN_C_DECLS
27
28 #define MCA_BTL_TCP_ENDPOINT_CACHE 1
29 #define WANT_PEER_DUMP 0
30
31 /**
32 * State of TCP endpoint connection.
33 */
34
35 typedef enum {
36 MCA_BTL_TCP_CONNECTING = 0,
37 MCA_BTL_TCP_CONNECT_ACK,
38 MCA_BTL_TCP_CLOSED,
39 MCA_BTL_TCP_FAILED,
40 MCA_BTL_TCP_CONNECTED
41 } mca_btl_tcp_state_t;
42
43 /**
44 * An abstraction that represents a connection to a endpoint process.
45 * An instance of mca_btl_base_endpoint_t is associated w/ each process
46 * and BTL pair at startup. However, connections to the endpoint
47 * are established dynamically on an as-needed basis:
48 */
49
50 struct mca_btl_base_endpoint_t {
51 opal_list_item_t super;
52 struct mca_btl_tcp_module_t* endpoint_btl; /**< BTL instance that created this connection */
53 struct mca_btl_tcp_proc_t* endpoint_proc; /**< proc structure corresponding to endpoint */
54 struct mca_btl_tcp_addr_t* endpoint_addr; /**< address of endpoint */
55 int endpoint_sd; /**< socket connection to endpoint */
56 #if MCA_BTL_TCP_ENDPOINT_CACHE
57 char* endpoint_cache; /**< cache for the recv (reduce the number of recv syscall) */
58 char* endpoint_cache_pos; /**< current position in the cache */
59 size_t endpoint_cache_length; /**< length of the data in the cache */
60 #endif /* MCA_BTL_TCP_ENDPOINT_CACHE */
61 struct mca_btl_tcp_frag_t* endpoint_send_frag; /**< current send frag being processed */
62 struct mca_btl_tcp_frag_t* endpoint_recv_frag; /**< current recv frag being processed */
63 mca_btl_tcp_state_t endpoint_state; /**< current state of the connection */
64 size_t endpoint_retries; /**< number of connection retries attempted */
65 opal_list_t endpoint_frags; /**< list of pending frags to send */
66 opal_mutex_t endpoint_send_lock; /**< lock for concurrent access to endpoint state */
67 opal_mutex_t endpoint_recv_lock; /**< lock for concurrent access to endpoint state */
68 opal_event_t endpoint_send_event; /**< event for async processing of send frags */
69 opal_event_t endpoint_recv_event; /**< event for async processing of recv frags */
70 bool endpoint_nbo; /**< convert headers to network byte order? */
71 };
72
73 typedef struct mca_btl_base_endpoint_t mca_btl_base_endpoint_t;
74 typedef mca_btl_base_endpoint_t mca_btl_tcp_endpoint_t;
75 OBJ_CLASS_DECLARATION(mca_btl_tcp_endpoint_t);
76
77 void mca_btl_tcp_set_socket_options(int sd);
78 void mca_btl_tcp_endpoint_close(mca_btl_base_endpoint_t*);
79 int mca_btl_tcp_endpoint_send(mca_btl_base_endpoint_t*, struct mca_btl_tcp_frag_t*);
80 bool mca_btl_tcp_endpoint_accept(mca_btl_base_endpoint_t*, struct sockaddr*, int);
81 void mca_btl_tcp_endpoint_shutdown(mca_btl_base_endpoint_t*);
82 void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, const char* msg);
83
84 END_C_DECLS
85 #endif
mca_btl_base_endpoint_t::endpoint_recv_frag
struct mca_btl_tcp_frag_t * endpoint_recv_frag
current recv frag being processed
Definition: btl_tcp_endpoint.h:62
mca_btl_base_endpoint_t::endpoint_proc
struct mca_btl_tcp_proc_t * endpoint_proc
proc structure corresponding to endpoint
Definition: btl_tcp_endpoint.h:53
mca_btl_base_endpoint_t::endpoint_btl
struct mca_btl_tcp_module_t * endpoint_btl
BTL instance that created this connection.
Definition: btl_tcp_endpoint.h:52
event
Structure to represent a single event.
Definition: event_struct.h:87
mca_btl_tcp_module_t
BTL Module Interface.
Definition: btl_tcp.h:107
opal_mutex_t
Definition: mutex_unix.h:53
mca_btl_tcp_proc_t
Represents the state of a remote process and the set of addresses that it exports.
Definition: btl_tcp_proc.h:38
mca_btl_tcp_addr_t
Structure used to publish TCP connection information to peers.
Definition: btl_tcp_addr.h:39
opal_list.h
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
mca_btl_base_endpoint_t::endpoint_cache
char * endpoint_cache
cache for the recv (reduce the number of recv syscall)
Definition: btl_sctp_endpoint.h:57
mca_btl_base_endpoint_t::endpoint_retries
size_t endpoint_retries
number of connection retries attempted
Definition: btl_openib_endpoint.h:192
opal_list_item_t
Definition: opal_list.h:98
mca_btl_base_endpoint_t::endpoint_recv_event
opal_event_t endpoint_recv_event
event for async processing of recv frags
Definition: btl_sctp_endpoint.h:69
btl_tcp.h
mca_btl_base_endpoint_t::endpoint_send_event
opal_event_t endpoint_send_event
event for async processing of send frags
Definition: btl_sctp_endpoint.h:68
mca_btl_base_endpoint_t::endpoint_state
mca_btl_tcp_state_t endpoint_state
current state of the connection
Definition: btl_tcp_endpoint.h:63
mca_btl_base_endpoint_t::endpoint_send_lock
opal_mutex_t endpoint_send_lock
lock for concurrent access to endpoint state
Definition: btl_sctp_endpoint.h:66
mca_btl_base_endpoint_t::endpoint_send_frag
struct mca_btl_tcp_frag_t * endpoint_send_frag
current send frag being processed
Definition: btl_tcp_endpoint.h:61
mca_btl_base_endpoint_t
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
mca_btl_tcp_frag_t
TCP fragment derived type.
Definition: btl_tcp_frag.h:46
opal_list_t
Definition: opal_list.h:147
mca_btl_base_endpoint_t::endpoint_sd
int endpoint_sd
socket connection to endpoint
Definition: btl_sctp_endpoint.h:55
mca_btl_base_endpoint_t::endpoint_cache_pos
char * endpoint_cache_pos
current position in the cache
Definition: btl_sctp_endpoint.h:58
mca_btl_base_endpoint_t::endpoint_cache_length
size_t endpoint_cache_length
length of the data in the cache
Definition: btl_sctp_endpoint.h:59
mca_btl_base_endpoint_t::endpoint_recv_lock
opal_mutex_t endpoint_recv_lock
lock for concurrent access to endpoint state
Definition: btl_sctp_endpoint.h:67
mca_btl_base_endpoint_t::endpoint_addr
struct mca_btl_tcp_addr_t * endpoint_addr
address of endpoint
Definition: btl_tcp_endpoint.h:54
mca_btl_base_endpoint_t::endpoint_frags
opal_list_t endpoint_frags
list of pending frags to send
Definition: btl_sctp_endpoint.h:65
mca_btl_base_endpoint_t::endpoint_nbo
bool endpoint_nbo
convert headers to network byte order?
Definition: btl_sctp_endpoint.h:70
OBJ_CLASS_DECLARATION
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236