Add max_btls option
This commit was SVN r9263.
Этот коммит содержится в:
родитель
12b94972e2
Коммит
440417e92c
@ -52,6 +52,9 @@ extern "C" {
|
|||||||
|
|
||||||
struct mca_btl_openib_component_t {
|
struct mca_btl_openib_component_t {
|
||||||
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
|
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
|
||||||
|
|
||||||
|
int ib_max_btls;
|
||||||
|
/**< maximum number of hcas available to the IB component */
|
||||||
|
|
||||||
uint32_t ib_num_btls;
|
uint32_t ib_num_btls;
|
||||||
/**< number of hcas available to the IB component */
|
/**< number of hcas available to the IB component */
|
||||||
|
@ -128,6 +128,8 @@ int mca_btl_openib_component_open(void)
|
|||||||
OBJ_CONSTRUCT(&mca_btl_openib_component.ib_procs, opal_list_t);
|
OBJ_CONSTRUCT(&mca_btl_openib_component.ib_procs, opal_list_t);
|
||||||
|
|
||||||
/* register IB component parameters */
|
/* register IB component parameters */
|
||||||
|
mca_btl_openib_param_register_int ("max_btls", "maximum number of HCAs/ports to use",
|
||||||
|
4, &mca_btl_openib_component.ib_max_btls);
|
||||||
mca_btl_openib_param_register_int ("free_list_num", "intial size of free lists",
|
mca_btl_openib_param_register_int ("free_list_num", "intial size of free lists",
|
||||||
8, &mca_btl_openib_component.ib_free_list_num);
|
8, &mca_btl_openib_component.ib_free_list_num);
|
||||||
mca_btl_openib_param_register_int ("free_list_max", "maximum size of free lists",
|
mca_btl_openib_param_register_int ("free_list_max", "maximum size of free lists",
|
||||||
@ -352,7 +354,8 @@ mca_btl_base_module_t** mca_btl_openib_component_init(int *num_btl_modules,
|
|||||||
OBJ_CONSTRUCT(&mca_btl_openib_component.ib_lock, opal_mutex_t);
|
OBJ_CONSTRUCT(&mca_btl_openib_component.ib_lock, opal_mutex_t);
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i < num_devs; i++){
|
for(i = 0; i < num_devs
|
||||||
|
&& mca_btl_openib_component.ib_num_btls < mca_btl_openib_component.ib_max_btls; i++){
|
||||||
struct ibv_device_attr ib_dev_attr;
|
struct ibv_device_attr ib_dev_attr;
|
||||||
struct ibv_context* ib_dev_context;
|
struct ibv_context* ib_dev_context;
|
||||||
|
|
||||||
@ -397,7 +400,8 @@ mca_btl_base_module_t** mca_btl_openib_component_init(int *num_btl_modules,
|
|||||||
openib_btl->ib_reg[MCA_BTL_TAG_BTL].cbdata = NULL;
|
openib_btl->ib_reg[MCA_BTL_TAG_BTL].cbdata = NULL;
|
||||||
|
|
||||||
opal_list_append(&btl_list, (opal_list_item_t*) ib_selected);
|
opal_list_append(&btl_list, (opal_list_item_t*) ib_selected);
|
||||||
mca_btl_openib_component.ib_num_btls ++;
|
if(++mca_btl_openib_component.ib_num_btls >= mca_btl_openib_component.ib_max_btls)
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user