OpenMPI 0.1.1

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

- File List
- Globals

Data Structures | Macros | Typedefs | Enumerations | Functions
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_t * | mca_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; \
}
mca_oob_tcp_component_t::tcp_peer_free
opal_free_list_t tcp_peer_free
free list of peers
Definition: oob_tcp.h:203
mca_oob_tcp_peer_t
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); \
}
mca_oob_tcp_component_t::tcp_peers
opal_hash_table_t tcp_peers
peers sorted by name
Definition: oob_tcp.h:201
mca_oob_tcp_component_t::tcp_peer_free
opal_free_list_t tcp_peer_free
free list of peers
Definition: oob_tcp.h:203
orte_util_hash_name
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_hash_table_remove_value_uint64
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

  peer | The peer process.
  sd | Incoming 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.

void mca_oob_tcp_peer_close | ( | mca_oob_tcp_peer_t * | peer | ) |

Cleanup/close the connection to the peer.

Parameters

  peer | The peer process.

References orte_process_name_t::jobid, opal_output(), OPAL_OUTPUT_VERBOSE, 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_sd, mca_oob_tcp_peer_t::peer_state, mca_oob_tcp_component_t::tcp_debug, and orte_errmgr_base_module_2_3_0_t::update_state.

Referenced by mca_oob_tcp_msg_recv_handler(), mca_oob_tcp_msg_send_handler(), and mca_oob_tcp_peer_accept().

mca_oob_tcp_peer_t* mca_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.

Parameters

  peer_name | the name of the peer

Return values

  pointer | to the peer's (possibly newly created) struture
  NULL | if there was a problem

References MCA_OOB_TCP_PEER_ALLOC, MCA_OOB_TCP_PEER_RETURN, opal_hash_table_get_value_uint64(), opal_hash_table_set_value_uint64(), opal_list_get_begin(), opal_list_get_last(), opal_list_get_prev, opal_list_get_size(), opal_list_prepend(), opal_list_remove_item(), OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, orte_util_hash_name(), mca_oob_tcp_peer_t::peer_addr, mca_oob_tcp_peer_t::peer_current_af, mca_oob_tcp_peer_t::peer_name, mca_oob_tcp_peer_t::peer_recv_msg, mca_oob_tcp_peer_t::peer_retries, mca_oob_tcp_peer_t::peer_sd, mca_oob_tcp_peer_t::peer_send_msg, mca_oob_tcp_peer_t::peer_state, mca_oob_tcp_component_t::tcp_lock, mca_oob_tcp_component_t::tcp_peer_limit, mca_oob_tcp_component_t::tcp_peer_list, and mca_oob_tcp_component_t::tcp_peers.

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

  peer | The peer process.
  msg | The message to send.

Return values

  ORTE_SUCCESS | or 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.