2004-03-26 14:15:20 +00:00
|
|
|
/*
|
2004-11-22 01:38:40 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 20:09:25 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-28 22:52:51 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2004-03-26 14:15:20 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*/
|
2004-01-28 22:52:51 +00:00
|
|
|
#ifndef MCA_PTL_TCP_PROC_H
|
|
|
|
#define MCA_PTL_TCP_PROC_H
|
|
|
|
|
2004-10-22 16:06:05 +00:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2004-01-28 22:52:51 +00:00
|
|
|
#include <sys/types.h>
|
2004-10-22 16:06:05 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
2004-01-28 22:52:51 +00:00
|
|
|
#include <sys/socket.h>
|
2004-10-22 16:06:05 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
2004-01-28 22:52:51 +00:00
|
|
|
#include <netinet/in.h>
|
2004-10-22 16:06:05 +00:00
|
|
|
#endif
|
2005-03-14 20:57:21 +00:00
|
|
|
#include "mca/ns/ns_types.h"
|
2005-07-03 16:06:07 +00:00
|
|
|
#include "opal/class/opal_object.h"
|
2004-03-17 18:45:16 +00:00
|
|
|
#include "proc/proc.h"
|
2004-02-05 17:12:59 +00:00
|
|
|
#include "ptl_tcp.h"
|
2004-01-28 22:52:51 +00:00
|
|
|
#include "ptl_tcp_peer.h"
|
2004-10-20 22:31:03 +00:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2004-01-28 22:52:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents the state of a remote process and the set of addresses
|
2004-03-26 14:15:20 +00:00
|
|
|
* that it exports. Also cache an instance of mca_ptl_base_peer_t for each
|
2004-01-28 22:52:51 +00:00
|
|
|
* PTL instance that attempts to open a connection to the process.
|
|
|
|
*/
|
|
|
|
struct mca_ptl_tcp_proc_t {
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_item_t super; /**< allow proc to be placed on a list */
|
2004-07-01 14:49:54 +00:00
|
|
|
ompi_proc_t *proc_ompi; /**< pointer to corresponding ompi_proc_t */
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_process_name_t proc_name; /**< globally unique identifier for the process */
|
2004-03-26 14:15:20 +00:00
|
|
|
struct mca_ptl_tcp_addr_t *proc_addrs; /**< array of addresses published by peer */
|
|
|
|
size_t proc_addr_count; /**< number of addresses published by peer */
|
|
|
|
struct mca_ptl_base_peer_t **proc_peers; /**< array of peers that have been created to access this proc */
|
|
|
|
size_t proc_peer_count; /**< number of peers */
|
2004-07-01 14:49:54 +00:00
|
|
|
ompi_mutex_t proc_lock; /**< lock to protect against concurrent access to proc state */
|
2004-01-28 22:52:51 +00:00
|
|
|
};
|
|
|
|
typedef struct mca_ptl_tcp_proc_t mca_ptl_tcp_proc_t;
|
|
|
|
|
|
|
|
|
2004-10-25 19:55:04 +00:00
|
|
|
OBJ_CLASS_DECLARATION(mca_ptl_tcp_proc_t);
|
|
|
|
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
mca_ptl_tcp_proc_t* mca_ptl_tcp_proc_create(ompi_proc_t* ompi_proc);
|
2005-03-14 20:57:21 +00:00
|
|
|
mca_ptl_tcp_proc_t* mca_ptl_tcp_proc_lookup(const orte_process_name_t*);
|
2004-01-29 15:34:47 +00:00
|
|
|
|
2004-02-05 17:12:59 +00:00
|
|
|
|
2004-06-03 22:13:01 +00:00
|
|
|
/**
|
|
|
|
* Inlined function to return local TCP proc instance.
|
|
|
|
*/
|
|
|
|
|
2004-01-29 15:34:47 +00:00
|
|
|
static inline mca_ptl_tcp_proc_t* mca_ptl_tcp_proc_local(void)
|
|
|
|
{
|
2004-08-02 00:24:22 +00:00
|
|
|
if(NULL == mca_ptl_tcp_component.tcp_local)
|
|
|
|
mca_ptl_tcp_component.tcp_local = mca_ptl_tcp_proc_create(ompi_proc_local());
|
|
|
|
return mca_ptl_tcp_component.tcp_local;
|
2004-01-29 15:34:47 +00:00
|
|
|
}
|
2004-01-28 22:52:51 +00:00
|
|
|
|
2004-10-14 07:07:05 +00:00
|
|
|
int mca_ptl_tcp_proc_insert(mca_ptl_tcp_proc_t*, struct mca_ptl_base_peer_t*);
|
|
|
|
int mca_ptl_tcp_proc_remove(mca_ptl_tcp_proc_t*, struct mca_ptl_base_peer_t*);
|
2004-01-28 22:52:51 +00:00
|
|
|
bool mca_ptl_tcp_proc_accept(mca_ptl_tcp_proc_t*, struct sockaddr_in*, int sd);
|
2004-10-20 22:31:03 +00:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2004-01-28 22:52:51 +00:00
|
|
|
#endif
|
|
|
|
|