Remove the tcp_local field from the TCP component.
Instead use the OPAL process name to get the name of the local process. Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
Этот коммит содержится в:
родитель
dc7d2f5b6a
Коммит
cfeeecd381
@ -156,10 +156,8 @@ int mca_btl_tcp_del_procs(struct mca_btl_base_module_t* btl,
|
|||||||
OPAL_THREAD_LOCK(&tcp_btl->tcp_endpoints_mutex);
|
OPAL_THREAD_LOCK(&tcp_btl->tcp_endpoints_mutex);
|
||||||
for( i = 0; i < nprocs; i++ ) {
|
for( i = 0; i < nprocs; i++ ) {
|
||||||
mca_btl_tcp_endpoint_t* tcp_endpoint = endpoints[i];
|
mca_btl_tcp_endpoint_t* tcp_endpoint = endpoints[i];
|
||||||
if(tcp_endpoint->endpoint_proc != mca_btl_tcp_proc_local()) {
|
opal_list_remove_item(&tcp_btl->tcp_endpoints, (opal_list_item_t*)tcp_endpoint);
|
||||||
opal_list_remove_item(&tcp_btl->tcp_endpoints, (opal_list_item_t*)tcp_endpoint);
|
OBJ_RELEASE(tcp_endpoint);
|
||||||
OBJ_RELEASE(tcp_endpoint);
|
|
||||||
}
|
|
||||||
opal_progress_event_users_decrement();
|
opal_progress_event_users_decrement();
|
||||||
}
|
}
|
||||||
OPAL_THREAD_UNLOCK(&tcp_btl->tcp_endpoints_mutex);
|
OPAL_THREAD_UNLOCK(&tcp_btl->tcp_endpoints_mutex);
|
||||||
|
@ -107,7 +107,6 @@ struct mca_btl_tcp_component_t {
|
|||||||
uint32_t tcp_num_btls; /**< number of interfaces available to the TCP component */
|
uint32_t tcp_num_btls; /**< number of interfaces available to the TCP component */
|
||||||
unsigned int tcp_num_links; /**< number of logical links per physical device */
|
unsigned int tcp_num_links; /**< number of logical links per physical device */
|
||||||
struct mca_btl_tcp_module_t **tcp_btls; /**< array of available BTL modules */
|
struct mca_btl_tcp_module_t **tcp_btls; /**< array of available BTL modules */
|
||||||
struct mca_btl_tcp_proc_t* tcp_local; /**< local proc struct */
|
|
||||||
int tcp_free_list_num; /**< initial size of free lists */
|
int tcp_free_list_num; /**< initial size of free lists */
|
||||||
int tcp_free_list_max; /**< maximum size of free lists */
|
int tcp_free_list_max; /**< maximum size of free lists */
|
||||||
int tcp_free_list_inc; /**< number of elements to alloc when growing free lists */
|
int tcp_free_list_inc; /**< number of elements to alloc when growing free lists */
|
||||||
|
@ -150,7 +150,6 @@ mca_btl_tcp_endpoint_dump(int level,
|
|||||||
opal_socklen_t obtlen;
|
opal_socklen_t obtlen;
|
||||||
opal_socklen_t addrlen = sizeof(inaddr);
|
opal_socklen_t addrlen = sizeof(inaddr);
|
||||||
mca_btl_tcp_frag_t* item;
|
mca_btl_tcp_frag_t* item;
|
||||||
mca_btl_tcp_proc_t* this_proc = mca_btl_tcp_proc_local();
|
|
||||||
|
|
||||||
used += snprintf(&outmsg[used], DEBUG_LENGTH - used, "%s: ", msg);
|
used += snprintf(&outmsg[used], DEBUG_LENGTH - used, "%s: ", msg);
|
||||||
if (used >= DEBUG_LENGTH) goto out;
|
if (used >= DEBUG_LENGTH) goto out;
|
||||||
@ -280,7 +279,7 @@ out:
|
|||||||
opal_output_verbose(level, opal_btl_base_framework.framework_output,
|
opal_output_verbose(level, opal_btl_base_framework.framework_output,
|
||||||
"[%s:%d:%s][%s -> %s] %s",
|
"[%s:%d:%s][%s -> %s] %s",
|
||||||
fname, lineno, funcname,
|
fname, lineno, funcname,
|
||||||
(NULL != this_proc ? OPAL_NAME_PRINT(mca_btl_tcp_proc_local()->proc_opal->proc_name) : "unknown"),
|
OPAL_NAME_PRINT(opal_proc_local_get()->proc_name),
|
||||||
(NULL != btl_endpoint->endpoint_proc ? OPAL_NAME_PRINT(btl_endpoint->endpoint_proc->proc_opal->proc_name) : "unknown remote"),
|
(NULL != btl_endpoint->endpoint_proc ? OPAL_NAME_PRINT(btl_endpoint->endpoint_proc->proc_opal->proc_name) : "unknown remote"),
|
||||||
outmsg);
|
outmsg);
|
||||||
}
|
}
|
||||||
@ -408,8 +407,7 @@ mca_btl_tcp_endpoint_send_blocking(mca_btl_base_endpoint_t* btl_endpoint,
|
|||||||
static int mca_btl_tcp_endpoint_send_connect_ack(mca_btl_base_endpoint_t* btl_endpoint)
|
static int mca_btl_tcp_endpoint_send_connect_ack(mca_btl_base_endpoint_t* btl_endpoint)
|
||||||
{
|
{
|
||||||
/* send process identifier to remote endpoint */
|
/* send process identifier to remote endpoint */
|
||||||
mca_btl_tcp_proc_t* btl_proc = mca_btl_tcp_proc_local();
|
opal_process_name_t guid = opal_proc_local_get()->proc_name;
|
||||||
opal_process_name_t guid = btl_proc->proc_opal->proc_name;
|
|
||||||
|
|
||||||
OPAL_PROCESS_NAME_HTON(guid);
|
OPAL_PROCESS_NAME_HTON(guid);
|
||||||
if(mca_btl_tcp_endpoint_send_blocking(btl_endpoint, &guid, sizeof(guid)) !=
|
if(mca_btl_tcp_endpoint_send_blocking(btl_endpoint, &guid, sizeof(guid)) !=
|
||||||
@ -422,7 +420,6 @@ static int mca_btl_tcp_endpoint_send_connect_ack(mca_btl_base_endpoint_t* btl_en
|
|||||||
static void *mca_btl_tcp_endpoint_complete_accept(int fd, int flags, void *context)
|
static void *mca_btl_tcp_endpoint_complete_accept(int fd, int flags, void *context)
|
||||||
{
|
{
|
||||||
mca_btl_base_endpoint_t* btl_endpoint = (mca_btl_base_endpoint_t*)context;
|
mca_btl_base_endpoint_t* btl_endpoint = (mca_btl_base_endpoint_t*)context;
|
||||||
mca_btl_tcp_proc_t* this_proc = mca_btl_tcp_proc_local();
|
|
||||||
struct timeval now = {0, 0};
|
struct timeval now = {0, 0};
|
||||||
int cmpval;
|
int cmpval;
|
||||||
|
|
||||||
@ -451,7 +448,7 @@ static void *mca_btl_tcp_endpoint_complete_accept(int fd, int flags, void *conte
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmpval = opal_compare_proc(btl_endpoint->endpoint_proc->proc_opal->proc_name,
|
cmpval = opal_compare_proc(btl_endpoint->endpoint_proc->proc_opal->proc_name,
|
||||||
this_proc->proc_opal->proc_name);
|
opal_proc_local_get()->proc_name);
|
||||||
if((btl_endpoint->endpoint_sd < 0) ||
|
if((btl_endpoint->endpoint_sd < 0) ||
|
||||||
(btl_endpoint->endpoint_state != MCA_BTL_TCP_CONNECTED &&
|
(btl_endpoint->endpoint_state != MCA_BTL_TCP_CONNECTED &&
|
||||||
cmpval < 0)) {
|
cmpval < 0)) {
|
||||||
|
@ -163,10 +163,6 @@ mca_btl_tcp_proc_t* mca_btl_tcp_proc_create(opal_proc_t* proc)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(NULL == mca_btl_tcp_component.tcp_local && (proc == opal_proc_local_get())) {
|
|
||||||
mca_btl_tcp_component.tcp_local = btl_proc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* convert the OPAL addr_family field to OS constants,
|
/* convert the OPAL addr_family field to OS constants,
|
||||||
* so we can check for AF_INET (or AF_INET6) and don't have
|
* so we can check for AF_INET (or AF_INET6) and don't have
|
||||||
* to deal with byte ordering anymore.
|
* to deal with byte ordering anymore.
|
||||||
@ -745,8 +741,8 @@ mca_btl_tcp_proc_t* mca_btl_tcp_proc_lookup(const opal_process_name_t *name)
|
|||||||
mca_btl_base_endpoint_t *endpoint;
|
mca_btl_base_endpoint_t *endpoint;
|
||||||
opal_proc_t *opal_proc;
|
opal_proc_t *opal_proc;
|
||||||
|
|
||||||
BTL_VERBOSE(("adding tcp proc for unknown peer {.jobid = 0x%x, .vpid = 0x%x}",
|
BTL_VERBOSE(("adding tcp proc for unknown peer {%s}",
|
||||||
name->jobid, name->vpid));
|
OPAL_NAME_PRINT(*name)));
|
||||||
|
|
||||||
opal_proc = opal_proc_for_name (*name);
|
opal_proc = opal_proc_for_name (*name);
|
||||||
if (NULL == opal_proc) {
|
if (NULL == opal_proc) {
|
||||||
@ -761,6 +757,7 @@ mca_btl_tcp_proc_t* mca_btl_tcp_proc_lookup(const opal_process_name_t *name)
|
|||||||
if (NULL != endpoint && NULL == proc) {
|
if (NULL != endpoint && NULL == proc) {
|
||||||
/* get the proc and continue on (could probably just break here) */
|
/* get the proc and continue on (could probably just break here) */
|
||||||
proc = endpoint->endpoint_proc;
|
proc = endpoint->endpoint_proc;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -808,6 +805,9 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
OPAL_THREAD_UNLOCK(&btl_proc->proc_lock);
|
OPAL_THREAD_UNLOCK(&btl_proc->proc_lock);
|
||||||
|
opal_output(0, "btl: tcp: Incoming connection from %s does not match known addresses for peer %s. Drop !\n",
|
||||||
|
opal_net_get_hostname((struct sockaddr*)addr),
|
||||||
|
OPAL_NAME_PRINT(btl_proc->proc_opal->proc_name));
|
||||||
/* No further use of this socket. Close it */
|
/* No further use of this socket. Close it */
|
||||||
CLOSE_THE_SOCKET(sd);
|
CLOSE_THE_SOCKET(sd);
|
||||||
}
|
}
|
||||||
|
@ -111,16 +111,5 @@ int mca_btl_tcp_proc_remove(mca_btl_tcp_proc_t*, mca_btl_base_endpoint_t*);
|
|||||||
void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t*, struct sockaddr*, int);
|
void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t*, struct sockaddr*, int);
|
||||||
bool mca_btl_tcp_proc_tosocks(mca_btl_tcp_addr_t*, struct sockaddr_storage*);
|
bool mca_btl_tcp_proc_tosocks(mca_btl_tcp_addr_t*, struct sockaddr_storage*);
|
||||||
|
|
||||||
/**
|
|
||||||
* Inlined function to return local TCP proc instance.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static inline mca_btl_tcp_proc_t* mca_btl_tcp_proc_local(void)
|
|
||||||
{
|
|
||||||
if(NULL == mca_btl_tcp_component.tcp_local)
|
|
||||||
mca_btl_tcp_component.tcp_local = mca_btl_tcp_proc_create(opal_proc_local_get());
|
|
||||||
return mca_btl_tcp_component.tcp_local;
|
|
||||||
}
|
|
||||||
|
|
||||||
END_C_DECLS
|
END_C_DECLS
|
||||||
#endif
|
#endif
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user