Fixes trac:1305: check to see if $sysfsdir/class/infiniband exists and is
non-empty. If not, then exit the openib btl silently. This addresses the case where libibverbs is installed (which is getting more common) and therefore the openib BTL was built/installed, but the kernel drivers are not loaded (assumedly because there is no RDMA hardware present). In this case, "mpirun a.out" will not issue a warning. There appears to be no good way to definitely tell if there are no RDMA hardware devices present. For example, if libibverbs/the openib BTL is installed, there are no RDMA devices present, but the RDMA hardware kernel drivers ''are'' loaded, OMPI will warn that it was unable to find suitable devices. This warning is easily eliminated by unloading the kernel drivers. This commit was SVN r18530. The following Trac tickets were found above: Ticket 1305 --> https://svn.open-mpi.org/trac/ompi/ticket/1305
Этот коммит содержится в:
родитель
4ac7016200
Коммит
e5ea9d08ca
@ -25,9 +25,11 @@
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <infiniband/verbs.h>
|
||||
#include <infiniband/driver.h>
|
||||
#include <errno.h>
|
||||
#include <string.h> /* for strerror()*/
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#include "ompi/constants.h"
|
||||
#include "opal/event/event.h"
|
||||
@ -161,6 +163,40 @@ static int btl_openib_component_close(void)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
static bool check_basics(void)
|
||||
{
|
||||
int rc;
|
||||
char *file;
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
|
||||
/* Check to see if $sysfsdir/class/infiniband exists */
|
||||
asprintf(&file, "%s/class/infiniband", ibv_get_sysfs_path());
|
||||
if (NULL == file) {
|
||||
return false;
|
||||
}
|
||||
dir = opendir(file);
|
||||
free(file);
|
||||
if (NULL == dir) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Now check to see if it is non-empty */
|
||||
while (1) {
|
||||
if (NULL == (entry = readdir(dir))) {
|
||||
closedir(dir);
|
||||
return false;
|
||||
} else if (0 != strcmp(entry->d_name, ".") &&
|
||||
0 != strcmp(entry->d_name, "..")) {
|
||||
/* The directory is not empty -- happy */
|
||||
closedir(dir);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Never get here */
|
||||
}
|
||||
|
||||
static void inline pack8(char **dest, uint8_t value)
|
||||
{
|
||||
/* Copy one character */
|
||||
@ -1702,6 +1738,16 @@ btl_openib_component_init(int *num_btl_modules,
|
||||
*num_btl_modules = 0;
|
||||
num_devs = 0;
|
||||
|
||||
/* Per https://svn.open-mpi.org/trac/ompi/ticket/1305, check to
|
||||
see if $sysfsdir/class/infiniband exists. If it does not,
|
||||
assume that the RDMA hardware drivers are not loaded, and
|
||||
therefore we don't want OpenFabrics verbs support in this OMPI
|
||||
job. No need to print a warning. */
|
||||
if (!check_basics()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
seedv[0] = ORTE_PROC_MY_NAME->vpid;
|
||||
seedv[1] = opal_sys_timer_get_cycles();
|
||||
seedv[2] = opal_sys_timer_get_cycles();
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user