1
1

- 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.
Этот коммит содержится в:
Tim Woodall 2004-09-30 21:23:10 +00:00
родитель 5452038f99
Коммит da4b57d6cf
3 изменённых файлов: 21 добавлений и 12 удалений

Просмотреть файл

@ -382,6 +382,10 @@ mca_oob_t* mca_oob_tcp_component_init(int* priority, bool *allow_multi_user_thre
*allow_multi_user_threads = true;
*have_hidden_threads = OMPI_HAVE_THREADS;
/* are there any interfaces? */
if(ompi_ifcount() == 0)
return NULL;
/* 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_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)) {
struct sockaddr_in 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;
if(ptr != contact_info) {
ptr += sprintf(ptr, ";");

Просмотреть файл

@ -38,19 +38,20 @@ void mca_oob_tcp_addr_pack(ompi_buffer_t buffer)
int i;
ompi_pack(buffer, &mca_oob_name_self, 1, OMPI_NAME);
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
struct sockaddr_in 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;
count++;
}
}
ompi_pack(buffer, &count, 1, OMPI_INT32);
for(i=ompi_ifbegin(); i>0; i=ompi_ifnext(i)) {
struct sockaddr_in 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;
inaddr.sin_port = mca_oob_tcp_component.tcp_listen_port;
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));
/* check to see if this interface exists in the exclude list */
argv = exclude;
while(argv && *argv) {
if(strncmp(*argv,if_name,strlen(*argv)) == 0)
break;
argv++;
}
/* if this interface was not found in the excluded list - create a PTL */
if(argv == 0 || *argv == 0) {
if(ompi_ifcount() > 1) {
argv = exclude;
while(argv && *argv) {
if(strncmp(*argv,if_name,strlen(*argv)) == 0)
break;
argv++;
}
/* 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);
}
}