select mxm ptl based on user preferences
This commit was SVN r25401.
Этот коммит содержится в:
родитель
96332a2859
Коммит
6b50ba22a6
@ -103,6 +103,7 @@ int ompi_mtl_mxm_module_init(void)
|
|||||||
uint64_t mxlr;
|
uint64_t mxlr;
|
||||||
int rc;
|
int rc;
|
||||||
ompi_proc_t *mp, **procs;
|
ompi_proc_t *mp, **procs;
|
||||||
|
unsigned ptl_bitmap;
|
||||||
size_t totps, proc;
|
size_t totps, proc;
|
||||||
int lr, nlps;
|
int lr, nlps;
|
||||||
|
|
||||||
@ -163,9 +164,14 @@ int ompi_mtl_mxm_module_init(void)
|
|||||||
sa_bind_shm.context_id = mxlr;
|
sa_bind_shm.context_id = mxlr;
|
||||||
sa_bind_shm.num_procs = nlps;
|
sa_bind_shm.num_procs = nlps;
|
||||||
|
|
||||||
ep_opt.ptl_bind_addr[MXM_PTL_SELF] = (struct sockaddr*)&sa_bind_self;
|
ptl_bitmap = ompi_mtl_mxm.mxm_opts.ptl_bitmap;
|
||||||
ep_opt.ptl_bind_addr[MXM_PTL_RDMA] = (struct sockaddr*)&sa_bind_rdma;
|
|
||||||
ep_opt.ptl_bind_addr[MXM_PTL_SHM] = (struct sockaddr*)&sa_bind_shm;
|
ep_opt.ptl_bind_addr[MXM_PTL_SELF] = (ptl_bitmap & MXM_BIT(MXM_PTL_SELF))?
|
||||||
|
(struct sockaddr*)&sa_bind_self:NULL;
|
||||||
|
ep_opt.ptl_bind_addr[MXM_PTL_RDMA] =(ptl_bitmap & MXM_BIT(MXM_PTL_RDMA))?
|
||||||
|
(struct sockaddr*)&sa_bind_rdma:NULL;
|
||||||
|
ep_opt.ptl_bind_addr[MXM_PTL_SHM] =(ptl_bitmap & MXM_BIT(MXM_PTL_SHM))?
|
||||||
|
(struct sockaddr*)&sa_bind_shm:NULL;
|
||||||
|
|
||||||
/* Open MXM endpoint */
|
/* Open MXM endpoint */
|
||||||
err = mxm_ep_create(ompi_mtl_mxm.mxm_context, &ep_opt, &ompi_mtl_mxm.ep);
|
err = mxm_ep_create(ompi_mtl_mxm.mxm_context, &ep_opt, &ompi_mtl_mxm.ep);
|
||||||
@ -178,13 +184,16 @@ int ompi_mtl_mxm_module_init(void)
|
|||||||
/*
|
/*
|
||||||
* Get address for each PTL on this endpoint, and share it with other ranks.
|
* Get address for each PTL on this endpoint, and share it with other ranks.
|
||||||
*/
|
*/
|
||||||
if (OMPI_SUCCESS != ompi_mtl_mxm_get_ep_address(&ep_info, MXM_PTL_SELF)) {
|
if ((ptl_bitmap & MXM_BIT(MXM_PTL_SELF)) &&
|
||||||
|
OMPI_SUCCESS != ompi_mtl_mxm_get_ep_address(&ep_info, MXM_PTL_SELF)) {
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
if (OMPI_SUCCESS != ompi_mtl_mxm_get_ep_address(&ep_info, MXM_PTL_RDMA)) {
|
if ((ptl_bitmap & MXM_BIT(MXM_PTL_RDMA)) &&
|
||||||
|
OMPI_SUCCESS != ompi_mtl_mxm_get_ep_address(&ep_info, MXM_PTL_RDMA)) {
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
if (OMPI_SUCCESS != ompi_mtl_mxm_get_ep_address(&ep_info, MXM_PTL_SHM)) {
|
if ((ptl_bitmap & MXM_BIT(MXM_PTL_SHM)) &&
|
||||||
|
OMPI_SUCCESS != ompi_mtl_mxm_get_ep_address(&ep_info, MXM_PTL_SHM)) {
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
if (OMPI_SUCCESS != ompi_modex_send(&mca_mtl_mxm_component.super.mtl_version,
|
if (OMPI_SUCCESS != ompi_modex_send(&mca_mtl_mxm_component.super.mtl_version,
|
||||||
|
@ -73,14 +73,13 @@ static int ompi_mtl_mxm_component_register(void)
|
|||||||
static int ompi_mtl_mxm_component_open(void)
|
static int ompi_mtl_mxm_component_open(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
mxm_context_opts_t mxm_opts;
|
|
||||||
mxm_error_t err;
|
mxm_error_t err;
|
||||||
|
|
||||||
mca_mtl_mxm_output = opal_output_open(NULL);
|
mca_mtl_mxm_output = opal_output_open(NULL);
|
||||||
opal_output_set_verbosity(mca_mtl_mxm_output, ompi_mtl_mxm.verbose);
|
opal_output_set_verbosity(mca_mtl_mxm_output, ompi_mtl_mxm.verbose);
|
||||||
|
|
||||||
mxm_fill_context_opts(&mxm_opts);
|
mxm_fill_context_opts(&ompi_mtl_mxm.mxm_opts);
|
||||||
err = mxm_init(&mxm_opts, &ompi_mtl_mxm.mxm_context);
|
err = mxm_init(&ompi_mtl_mxm.mxm_opts, &ompi_mtl_mxm.mxm_context);
|
||||||
if (MXM_OK != err) {
|
if (MXM_OK != err) {
|
||||||
if (MXM_ERR_NO_DEVICE == err) {
|
if (MXM_ERR_NO_DEVICE == err) {
|
||||||
MXM_VERBOSE(1, "No supported device found, disqualifying mxm");
|
MXM_VERBOSE(1, "No supported device found, disqualifying mxm");
|
||||||
|
@ -26,8 +26,9 @@ BEGIN_C_DECLS
|
|||||||
*/
|
*/
|
||||||
typedef struct mca_mtl_mxm_module_t {
|
typedef struct mca_mtl_mxm_module_t {
|
||||||
mca_mtl_base_module_t super; /**< base MTL interface */
|
mca_mtl_base_module_t super; /**< base MTL interface */
|
||||||
int verbose;
|
int verbose;
|
||||||
mxm_h mxm_context;
|
mxm_h mxm_context;
|
||||||
|
mxm_context_opts_t mxm_opts;
|
||||||
mxm_ep_h ep;
|
mxm_ep_h ep;
|
||||||
} mca_mtl_mxm_module_t;
|
} mca_mtl_mxm_module_t;
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user