1
1

Merge pull request #1661 from matcabral/master

PSM and PSM2 MTLs to detect drivers and link
Этот коммит содержится в:
rhc54 2016-05-11 17:43:17 -07:00
родитель f8facb177d 40717198c6
Коммит 4d026e223c
4 изменённых файлов: 88 добавлений и 10 удалений

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

@ -16,6 +16,8 @@ dnl Copyright (c) 2015 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2016 Intel Corporation. All rights reserved.
dnl
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -68,6 +70,13 @@ AC_DEFUN([OMPI_CHECK_PSM],[
[AC_MSG_WARN([PSM driver does not currently support progress threads. Disabling BTL.])
ompi_check_psm_happy="no"])
AS_IF([test "$ompi_check_psm_happy" = "yes"],
[AC_CHECK_HEADERS(
glob.h,
[],
[AC_MSG_WARN([glob.h not found. Can not build component.])
ompi_check_psm_happy="no"])])
OPAL_SUMMARY_ADD([[Transports]],[[Intel TrueScale (PSM)]],[$1],[$ompi_check_psm_happy])
fi

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

@ -12,7 +12,7 @@
# All rights reserved.
# Copyright (c) 2006 QLogic Corp. All rights reserved.
# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014 Intel Corporation. All rights reserved.
# Copyright (c) 2016 Intel Corporation. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
@ -69,6 +69,13 @@ AC_DEFUN([OMPI_CHECK_PSM2],[
[AC_MSG_WARN([PSM2 driver does not currently support progress threads. Disabling MTL.])
ompi_check_psm2_happy="no"])
AS_IF([test "$ompi_check_psm2_happy" = "yes"],
[AC_CHECK_HEADERS(
glob.h,
[],
[AC_MSG_WARN([glob.h not found. Can not build component.])
ompi_check_psm2_happy="no"])])
OPAL_SUMMARY_ADD([[Transports]],[[Intel Omnipath (PSM2)]],[$1],[$ompi_check_psm2_happy])
fi

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

@ -37,6 +37,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <glob.h>
static int param_priority;
@ -185,12 +186,41 @@ ompi_mtl_psm_component_open(void)
}
/* Component available only if Truescale hardware is present */
if (0 == stat("/dev/ipath", &st)) {
return OMPI_SUCCESS;
}
else {
if (0 != stat("/dev/ipath", &st)) {
return OPAL_ERR_NOT_AVAILABLE;
}
/* Component available only if at least one qib port is ACTIVE */
bool foundOnlineQibPort = false;
size_t i;
char portState[128];
FILE *devFile;
glob_t globbuf;
globbuf.gl_offs = 0;
if (glob("/sys/class/infiniband/qib*/ports/*/state",
GLOB_DOOFFS, NULL, &globbuf) != 0) {
return OPAL_ERR_NOT_AVAILABLE;
}
for (i=0;i < globbuf.gl_pathc; i++) {
devFile = fopen(globbuf.gl_pathv[i], "r");
fgets(portState, sizeof(portState), devFile);
fclose(devFile);
if (strstr(portState, "ACTIVE") != NULL) {
/* Found at least one ACTIVE port */
foundOnlineQibPort = true;
break;
}
}
globfree(&globbuf);
if (!foundOnlineQibPort) {
return OPAL_ERR_NOT_AVAILABLE;
}
return OMPI_SUCCESS;
}
static int

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

@ -37,6 +37,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <glob.h>
static int param_priority;
@ -101,15 +102,46 @@ ompi_mtl_psm2_component_register(void)
static int
ompi_mtl_psm2_component_open(void)
{
struct stat st;
glob_t globbuf;
globbuf.gl_offs = 0;
/* Component available only if Omni-Path hardware is present */
if (0 == stat("/dev/hfi1", &st)) {
return OMPI_SUCCESS;
}
else {
if ((glob("/dev/hfi1_[0-9]", GLOB_DOOFFS, NULL, &globbuf) != 0) &&
(glob("/dev/hfi1_[0-9][0-9]", GLOB_APPEND, NULL, &globbuf) != 0)) {
return OPAL_ERR_NOT_AVAILABLE;
}
globfree(&globbuf);
/* Component available only if at least one hfi1 port is ACTIVE */
bool foundOnlineHfi1Port = false;
size_t i;
char portState[128];
FILE *devFile;
if (glob("/sys/class/infiniband/hfi1_*/ports/*/state",
GLOB_DOOFFS, NULL, &globbuf) != 0) {
return OPAL_ERR_NOT_AVAILABLE;
}
for (i=0;i < globbuf.gl_pathc; i++) {
devFile = fopen(globbuf.gl_pathv[i], "r");
fgets(portState, sizeof(portState), devFile);
fclose(devFile);
if (strstr(portState, "ACTIVE") != NULL) {
/* Found at least one ACTIVE port */
foundOnlineHfi1Port = true;
break;
}
}
globfree(&globbuf);
if (!foundOnlineHfi1Port) {
return OPAL_ERR_NOT_AVAILABLE;
}
return OMPI_SUCCESS;
}
static int