- use loopback for oob/ptl if no other i/fs are present
- force init to fail if no i/fs are available This commit was SVN r2898.
Этот коммит содержится в:
родитель
5452038f99
Коммит
da4b57d6cf
@ -382,6 +382,10 @@ mca_oob_t* mca_oob_tcp_component_init(int* priority, bool *allow_multi_user_thre
|
|||||||
*allow_multi_user_threads = true;
|
*allow_multi_user_threads = true;
|
||||||
*have_hidden_threads = OMPI_HAVE_THREADS;
|
*have_hidden_threads = OMPI_HAVE_THREADS;
|
||||||
|
|
||||||
|
/* are there any interfaces? */
|
||||||
|
if(ompi_ifcount() == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/* initialize data structures */
|
/* initialize data structures */
|
||||||
ompi_rb_tree_init(&mca_oob_tcp_component.tcp_peer_tree, (ompi_rb_tree_comp_fn_t)mca_oob_tcp_process_name_compare);
|
ompi_rb_tree_init(&mca_oob_tcp_component.tcp_peer_tree, (ompi_rb_tree_comp_fn_t)mca_oob_tcp_process_name_compare);
|
||||||
ompi_rb_tree_init(&mca_oob_tcp_component.tcp_peer_names, (ompi_rb_tree_comp_fn_t)mca_oob_tcp_process_name_compare);
|
ompi_rb_tree_init(&mca_oob_tcp_component.tcp_peer_names, (ompi_rb_tree_comp_fn_t)mca_oob_tcp_process_name_compare);
|
||||||
@ -704,7 +708,7 @@ char* mca_oob_tcp_get_addr(void)
|
|||||||
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
|
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
|
||||||
struct sockaddr_in addr;
|
struct sockaddr_in addr;
|
||||||
ompi_ifindextoaddr(i, (struct sockaddr*)&addr, sizeof(addr));
|
ompi_ifindextoaddr(i, (struct sockaddr*)&addr, sizeof(addr));
|
||||||
if(addr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
if(ompi_ifcount() > 1 && addr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
||||||
continue;
|
continue;
|
||||||
if(ptr != contact_info) {
|
if(ptr != contact_info) {
|
||||||
ptr += sprintf(ptr, ";");
|
ptr += sprintf(ptr, ";");
|
||||||
|
@ -38,10 +38,11 @@ void mca_oob_tcp_addr_pack(ompi_buffer_t buffer)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
ompi_pack(buffer, &mca_oob_name_self, 1, OMPI_NAME);
|
ompi_pack(buffer, &mca_oob_name_self, 1, OMPI_NAME);
|
||||||
|
|
||||||
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
|
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
|
||||||
struct sockaddr_in inaddr;
|
struct sockaddr_in inaddr;
|
||||||
ompi_ifindextoaddr(i, (struct sockaddr*)&inaddr, sizeof(inaddr));
|
ompi_ifindextoaddr(i, (struct sockaddr*)&inaddr, sizeof(inaddr));
|
||||||
if(inaddr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
if(ompi_ifcount() > 1 && inaddr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
||||||
continue;
|
continue;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -50,7 +51,7 @@ void mca_oob_tcp_addr_pack(ompi_buffer_t buffer)
|
|||||||
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
|
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
|
||||||
struct sockaddr_in inaddr;
|
struct sockaddr_in inaddr;
|
||||||
ompi_ifindextoaddr(i, (struct sockaddr*)&inaddr, sizeof(inaddr));
|
ompi_ifindextoaddr(i, (struct sockaddr*)&inaddr, sizeof(inaddr));
|
||||||
if(inaddr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
if(ompi_ifcount() > 1 && inaddr.sin_addr.s_addr == inet_addr("127.0.0.1"))
|
||||||
continue;
|
continue;
|
||||||
inaddr.sin_port = mca_oob_tcp_component.tcp_listen_port;
|
inaddr.sin_port = mca_oob_tcp_component.tcp_listen_port;
|
||||||
ompi_pack(buffer,&inaddr,sizeof(inaddr),OMPI_BYTE);
|
ompi_pack(buffer,&inaddr,sizeof(inaddr),OMPI_BYTE);
|
||||||
|
@ -317,14 +317,18 @@ static int mca_ptl_tcp_component_create_instances(void)
|
|||||||
ompi_ifindextoname(if_index, if_name, sizeof(if_name));
|
ompi_ifindextoname(if_index, if_name, sizeof(if_name));
|
||||||
|
|
||||||
/* check to see if this interface exists in the exclude list */
|
/* check to see if this interface exists in the exclude list */
|
||||||
argv = exclude;
|
if(ompi_ifcount() > 1) {
|
||||||
while(argv && *argv) {
|
argv = exclude;
|
||||||
if(strncmp(*argv,if_name,strlen(*argv)) == 0)
|
while(argv && *argv) {
|
||||||
break;
|
if(strncmp(*argv,if_name,strlen(*argv)) == 0)
|
||||||
argv++;
|
break;
|
||||||
}
|
argv++;
|
||||||
/* if this interface was not found in the excluded list - create a PTL */
|
}
|
||||||
if(argv == 0 || *argv == 0) {
|
/* if this interface was not found in the excluded list - create a PTL */
|
||||||
|
if(argv == 0 || *argv == 0) {
|
||||||
|
mca_ptl_tcp_create(if_index, if_name);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
mca_ptl_tcp_create(if_index, if_name);
|
mca_ptl_tcp_create(if_index, if_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user