1
1

Allow the PSM component to return ERR_NOT_AVAIL so it can be unloaded silently if executed on a node with no QLogic IB hardware. Also minor modifications to have the CM PML allow itself to be unloaded if no MTL components are available. The component selection logic can then continue to use other PMLs.

This commit was SVN r22410.
Этот коммит содержится в:
Avneesh Pant 2010-01-14 19:39:35 +00:00
родитель bdd1db8864
Коммит 8bdd334d95
2 изменённых файлов: 24 добавлений и 4 удалений

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

@ -31,6 +31,10 @@
#include "psm.h" #include "psm.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
static int ompi_mtl_psm_component_open(void); static int ompi_mtl_psm_component_open(void);
static int ompi_mtl_psm_component_close(void); static int ompi_mtl_psm_component_close(void);
static int ompi_mtl_psm_component_register(void); static int ompi_mtl_psm_component_register(void);
@ -152,7 +156,15 @@ ompi_mtl_psm_component_register(void)
static int static int
ompi_mtl_psm_component_open(void) ompi_mtl_psm_component_open(void)
{ {
return OMPI_SUCCESS; struct stat st;
/* Component available only if Truescale hardware is present */
if (0 == stat("/dev/ipath", &st)) {
return OMPI_SUCCESS;
}
else {
return OPAL_ERR_NOT_AVAILABLE;
}
} }
static int static int

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

@ -115,9 +115,17 @@ mca_pml_cm_component_register(void)
static int static int
mca_pml_cm_component_open(void) mca_pml_cm_component_open(void)
{ {
/* Avneesh -- might want to check the return code here with int ret;
respect to r22391 (i.e., OPAL_ERR_NOT_AVAILABLE issues) */
return ompi_mtl_base_open(); ret = ompi_mtl_base_open();
if (OMPI_SUCCESS == ret) {
/* If no MTL components initialized CM component can be unloaded */
if (0 == opal_list_get_size(&ompi_mtl_base_components_opened)) {
ret = OPAL_ERR_NOT_AVAILABLE;
}
}
return ret;
} }