OpenMPI  0.1.1
oob_tcp_peer.h File Reference

Contains the data structure which describes each connection. More...

#include "orte_config.h"
#include "orte/types.h"
#include <string.h>
#include "opal/class/opal_list.h"
#include "opal/threads/mutex.h"
#include "opal/mca/event/event.h"
#include "oob_tcp_msg.h"
#include "oob_tcp_addr.h"

Go to the source code of this file.

Data Structures

struct  mca_oob_tcp_peer_t
 This structure describes a peer. More...
 

Macros

#define MCA_OOB_TCP_PEER_ALLOC(peer, rc)
 Get a new peer data structure. More...
 
#define MCA_OOB_TCP_PEER_RETURN(peer)
 Return a peer data structure. More...
 

Typedefs

typedef struct mca_oob_tcp_peer_t mca_oob_tcp_peer_t
 Convenience Typedef.
 

Enumerations

enum  mca_oob_tcp_state_t {
  MCA_OOB_TCP_CLOSED, MCA_OOB_TCP_RESOLVE, MCA_OOB_TCP_CONNECTING, MCA_OOB_TCP_CONNECT_ACK,
  MCA_OOB_TCP_CONNECTED, MCA_OOB_TCP_FAILED
}
 the state of the connection
 

Functions

 OBJ_CLASS_DECLARATION (mca_oob_tcp_peer_t)
 
mca_oob_tcp_peer_tmca_oob_tcp_peer_lookup (const orte_process_name_t *peer_name)
 Lookup a peer in the cache - if it doesn't exists create one and cache it. More...
 
int mca_oob_tcp_peer_send (mca_oob_tcp_peer_t *peer, mca_oob_tcp_msg_t *msg)
 Start sending a message to the specified peer. More...
 
bool mca_oob_tcp_peer_accept (mca_oob_tcp_peer_t *peer, int sd)
 Connection request for this peer. More...
 
void mca_oob_tcp_peer_close (mca_oob_tcp_peer_t *peer)
 Cleanup/close the connection to the peer. More...
 
void mca_oob_tcp_peer_shutdown (mca_oob_tcp_peer_t *peer)
 
void mca_oob_tcp_peer_resolved (mca_oob_tcp_peer_t *peer, mca_oob_tcp_addr_t *addr)
 The peers address has been resolved.
 
int mca_oob_tcp_peer_send_ident (mca_oob_tcp_peer_t *peer)
 
void mca_oob_tcp_peer_dequeue_msg (mca_oob_tcp_peer_t *peer, mca_oob_tcp_msg_t *msg)
 
void mca_oob_tcp_peer_dump (mca_oob_tcp_peer_t *peer, const char *msg)
 

Detailed Description

Contains the data structure which describes each connection.

Macro Definition Documentation

#define MCA_OOB_TCP_PEER_ALLOC (   peer,
  rc 
)
Value:
{ \
opal_free_list_item_t* item; \
OPAL_FREE_LIST_GET(&mca_oob_tcp_component.tcp_peer_free, item, rc); \
peer = (mca_oob_tcp_peer_t*)item; \
}
opal_free_list_t tcp_peer_free
free list of peers
Definition: oob_tcp.h:203
This structure describes a peer.
Definition: oob_tcp_peer.h:59

Get a new peer data structure.

Referenced by mca_oob_tcp_peer_lookup().

#define MCA_OOB_TCP_PEER_RETURN (   peer)
Value:
{ \
mca_oob_tcp_peer_shutdown(peer); \
opal_hash_table_remove_value_uint64(&mca_oob_tcp_component.tcp_peers, orte_util_hash_name(&peer->peer_name)); \
OPAL_FREE_LIST_RETURN(&mca_oob_tcp_component.tcp_peer_free, \
&peer->super); \
}
opal_hash_table_t tcp_peers
peers sorted by name
Definition: oob_tcp.h:201
opal_free_list_t tcp_peer_free
free list of peers
Definition: oob_tcp.h:203
ORTE_DECLSPEC uint64_t orte_util_hash_name(const orte_process_name_t *name)
This funtion returns a guaranteed unique hash value for the passed process name.
Definition: name_fns.c:705
OPAL_DECLSPEC int opal_hash_table_remove_value_uint64(opal_hash_table_t *table, uint64_t key)
Remove value based on uint64_t key.
Definition: opal_hash_table.c:296

Return a peer data structure.

Referenced by mca_oob_tcp_fini(), and mca_oob_tcp_peer_lookup().

Function Documentation

bool mca_oob_tcp_peer_accept ( mca_oob_tcp_peer_t peer,
int  sd 
)

Connection request for this peer.

Check the status of our connection before accepting the peers.

Parameters
peerThe peer process.
sdIncoming connection request.

References mca_oob_tcp_peer_close(), opal_output(), OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, ORTE_PROC_MY_NAME, mca_oob_tcp_peer_t::peer_lock, mca_oob_tcp_peer_t::peer_name, mca_oob_tcp_peer_t::peer_recv_event, mca_oob_tcp_peer_t::peer_sd, mca_oob_tcp_peer_t::peer_state, and mca_oob_tcp_component_t::tcp_debug.

int mca_oob_tcp_peer_send ( mca_oob_tcp_peer_t peer,
mca_oob_tcp_msg_t msg 
)

Start sending a message to the specified peer.

The routine can return before the send completes.

Parameters
peerThe peer process.
msgThe message to send.
Return values
ORTE_SUCCESSor error code on failure.

References mca_oob_tcp_msg_complete(), mca_oob_tcp_msg_send_handler(), mca_oob_tcp_resolve(), opal_list_append, OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, mca_oob_tcp_peer_t::peer_lock, mca_oob_tcp_peer_t::peer_name, mca_oob_tcp_peer_t::peer_send_event, mca_oob_tcp_peer_t::peer_send_msg, mca_oob_tcp_peer_t::peer_send_queue, and mca_oob_tcp_peer_t::peer_state.