2016-11-23 02:03:20 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "pml_ucx.h"
|
|
|
|
|
2018-06-16 01:04:33 +03:00
|
|
|
#include "opal/mca/memory/base/base.h"
|
|
|
|
|
2016-11-23 02:03:20 +03:00
|
|
|
|
|
|
|
static int mca_pml_ucx_component_register(void);
|
|
|
|
static int mca_pml_ucx_component_open(void);
|
|
|
|
static int mca_pml_ucx_component_close(void);
|
|
|
|
|
|
|
|
static mca_pml_base_module_t*
|
|
|
|
mca_pml_ucx_component_init(int* priority, bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads);
|
|
|
|
static int mca_pml_ucx_component_fini(void);
|
|
|
|
|
|
|
|
|
|
|
|
mca_pml_base_component_2_0_0_t mca_pml_ucx_component = {
|
|
|
|
|
|
|
|
/* First, the mca_base_component_t struct containing meta
|
|
|
|
* information about the component itself */
|
2018-07-25 14:52:45 +03:00
|
|
|
.pmlm_version = {
|
2016-11-23 02:03:20 +03:00
|
|
|
MCA_PML_BASE_VERSION_2_0_0,
|
|
|
|
|
2018-07-25 14:52:45 +03:00
|
|
|
.mca_component_name = "ucx",
|
|
|
|
.mca_component_major_version = OMPI_MAJOR_VERSION,
|
|
|
|
.mca_component_minor_version = OMPI_MINOR_VERSION,
|
|
|
|
.mca_component_release_version = OMPI_RELEASE_VERSION,
|
|
|
|
.mca_open_component = mca_pml_ucx_component_open,
|
|
|
|
.mca_close_component = mca_pml_ucx_component_close,
|
|
|
|
.mca_query_component = NULL,
|
|
|
|
.mca_register_component_params = mca_pml_ucx_component_register,
|
2016-11-23 02:03:20 +03:00
|
|
|
},
|
2018-07-25 14:52:45 +03:00
|
|
|
.pmlm_data = {
|
2016-11-23 02:03:20 +03:00
|
|
|
/* This component is not checkpoint ready */
|
2018-07-25 14:52:45 +03:00
|
|
|
.param_field = MCA_BASE_METADATA_PARAM_NONE
|
2016-11-23 02:03:20 +03:00
|
|
|
},
|
|
|
|
|
2018-07-25 14:52:45 +03:00
|
|
|
.pmlm_init = mca_pml_ucx_component_init,
|
|
|
|
.pmlm_finalize = mca_pml_ucx_component_fini
|
2016-11-23 02:03:20 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static int mca_pml_ucx_component_register(void)
|
|
|
|
{
|
2018-01-17 16:08:04 +03:00
|
|
|
ompi_pml_ucx.priority = 51;
|
2016-11-23 02:03:20 +03:00
|
|
|
(void) mca_base_component_var_register(&mca_pml_ucx_component.pmlm_version, "priority",
|
|
|
|
"Priority of the UCX component",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
|
|
|
OPAL_INFO_LVL_3,
|
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&ompi_pml_ucx.priority);
|
|
|
|
|
|
|
|
ompi_pml_ucx.num_disconnect = 1;
|
|
|
|
(void) mca_base_component_var_register(&mca_pml_ucx_component.pmlm_version, "num_disconnect",
|
|
|
|
"How may disconnects go in parallel",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
|
|
|
OPAL_INFO_LVL_3,
|
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&ompi_pml_ucx.num_disconnect);
|
2018-08-21 15:05:12 +03:00
|
|
|
opal_common_ucx_mca_var_register(&mca_pml_ucx_component.pmlm_version);
|
2016-11-23 02:03:20 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int mca_pml_ucx_component_open(void)
|
|
|
|
{
|
2018-07-05 15:04:37 +03:00
|
|
|
opal_common_ucx_mca_register();
|
2018-06-16 01:04:33 +03:00
|
|
|
|
2016-11-23 02:03:20 +03:00
|
|
|
return mca_pml_ucx_open();
|
|
|
|
}
|
|
|
|
|
|
|
|
static int mca_pml_ucx_component_close(void)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
rc = mca_pml_ucx_close();
|
|
|
|
if (rc != 0) {
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2018-07-05 15:04:37 +03:00
|
|
|
opal_common_ucx_mca_deregister();
|
2016-11-23 02:03:20 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static mca_pml_base_module_t*
|
|
|
|
mca_pml_ucx_component_init(int* priority, bool enable_progress_threads,
|
2019-05-17 11:25:23 +03:00
|
|
|
bool enable_mpi_threads)
|
2016-11-23 02:03:20 +03:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
2019-05-17 11:25:23 +03:00
|
|
|
if ( (ret = mca_pml_ucx_init(enable_mpi_threads)) != 0) {
|
2016-11-23 02:03:20 +03:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*priority = ompi_pml_ucx.priority;
|
|
|
|
return &ompi_pml_ucx.super;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int mca_pml_ucx_component_fini(void)
|
|
|
|
{
|
|
|
|
return mca_pml_ucx_cleanup();
|
|
|
|
}
|
|
|
|
|