Skip to content

Commit c4245d6

Browse files
committed
Merge pull request open-mpi#703 from hjelmn/v2.x_cm_priority
Adjust the way cm's priority is set
2 parents dc0bb79 + 1b5637d commit c4245d6

File tree

28 files changed

+91
-70
lines changed

28 files changed

+91
-70
lines changed

ompi/mca/crcp/base/crcp_base_select.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ int ompi_crcp_base_select(void)
162162
if( OPAL_SUCCESS != mca_base_select("crcp", ompi_crcp_base_framework.framework_output,
163163
&ompi_crcp_base_framework.framework_components,
164164
(mca_base_module_t **) &best_module,
165-
(mca_base_component_t **) &best_component) ) {
165+
(mca_base_component_t **) &best_component, NULL) ) {
166166
/* This will only happen if no component was selected */
167167
return OMPI_ERROR;
168168
}

ompi/mca/mtl/base/base.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -9,6 +10,8 @@
910
* University of Stuttgart. All rights reserved.
1011
* Copyright (c) 2004-2006 The Regents of the University of California.
1112
* All rights reserved.
13+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
14+
* reserved.
1215
* $COPYRIGHT$
1316
*
1417
* Additional copyrights may follow
@@ -34,7 +37,8 @@ BEGIN_C_DECLS
3437
OMPI_DECLSPEC extern mca_mtl_base_component_t* ompi_mtl_base_selected_component;
3538

3639
OMPI_DECLSPEC int ompi_mtl_base_select(bool enable_progress_threads,
37-
bool enable_mpi_threads);
40+
bool enable_mpi_threads,
41+
int *priority);
3842

3943
OMPI_DECLSPEC extern mca_base_framework_t ompi_mtl_base_framework;
4044

ompi/mca/mtl/base/mtl_base_frame.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -48,20 +49,23 @@ mca_mtl_base_module_t *ompi_mtl = NULL;
4849
* need to reexamine this at a later time.
4950
*/
5051
int
51-
ompi_mtl_base_select(bool enable_progress_threads,
52-
bool enable_mpi_threads)
52+
ompi_mtl_base_select (bool enable_progress_threads,
53+
bool enable_mpi_threads,
54+
int *priority)
5355
{
5456
int ret = OMPI_ERR_NOT_FOUND;
5557
mca_mtl_base_component_t *best_component = NULL;
5658
mca_mtl_base_module_t *best_module = NULL;
59+
int best_priority;
5760

5861
/*
5962
* Select the best component
6063
*/
6164
if( OPAL_SUCCESS != mca_base_select("mtl", ompi_mtl_base_framework.framework_output,
6265
&ompi_mtl_base_framework.framework_components,
6366
(mca_base_module_t **) &best_module,
64-
(mca_base_component_t **) &best_component) ) {
67+
(mca_base_component_t **) &best_component,
68+
&best_priority) ) {
6569
/* notify caller that no available component found */
6670
return ret;
6771
}
@@ -81,6 +85,7 @@ ompi_mtl_base_select(bool enable_progress_threads,
8185
"select: init returned success");
8286
ompi_mtl_base_selected_component = best_component;
8387
ompi_mtl = best_module;
88+
*priority = best_priority;
8489
ret = OMPI_SUCCESS;
8590
}
8691

ompi/mca/mtl/mxm/mtl_mxm_component.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ static int ompi_mtl_mxm_component_register(void)
130130
free(runtime_version);
131131
#endif
132132

133-
param_priority = 100;
133+
/* set high enought to defeat ob1's default */
134+
param_priority = 30;
134135
(void) mca_base_component_var_register (c,
135136
"priority", "Priority of the MXM MTL component",
136137
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,

ompi/mca/mtl/ofi/mtl_ofi_component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mca_mtl_ofi_component_t mca_mtl_ofi_component = {
5656
static int
5757
ompi_mtl_ofi_component_register(void)
5858
{
59-
param_priority = 10; /* for now give a lower priority than the psm mtl */
59+
param_priority = 25; /* for now give a lower priority than the psm mtl */
6060
mca_base_component_var_register(&mca_mtl_ofi_component.super.mtl_version,
6161
"priority", "Priority of the OFI MTL component",
6262
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,

ompi/mca/mtl/psm/mtl_psm_component.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ ompi_mtl_psm_component_register(void)
9090
#endif
9191

9292

93-
param_priority = 100;
93+
/* set priority high enough to beat ob1's default */
94+
param_priority = 30;
9495
(void) mca_base_component_var_register (&mca_mtl_psm_component.super.mtl_version,
9596
"priority", "Priority of the PSM MTL component",
9697
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,

ompi/mca/mtl/psm2/mtl_psm2_component.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -10,7 +11,7 @@
1011
* Copyright (c) 2004-2005 The Regents of the University of California.
1112
* All rights reserved.
1213
* Copyright (c) 2006-2010 QLogic Corporation. All rights reserved.
13-
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
14+
* Copyright (c) 2012-2015 Los Alamos National Security, LLC.
1415
* All rights reserved.
1516
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
1617
* $COPYRIGHT$
@@ -85,7 +86,8 @@ ompi_mtl_psm2_component_register(void)
8586
MCA_BASE_VAR_SCOPE_READONLY,
8687
&ompi_mtl_psm2.connect_timeout);
8788

88-
param_priority = 120;
89+
/* set priority high enough to beat ob1's default (also set higher than psm) */
90+
param_priority = 40;
8991
(void) mca_base_component_var_register (&mca_mtl_psm2_component.super.mtl_version,
9092
"priority", "Priority of the PSM2 MTL component",
9193
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,

ompi/mca/pml/cm/pml_cm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ struct ompi_pml_cm_t {
5050
int free_list_num;
5151
int free_list_max;
5252
int free_list_inc;
53-
int default_priority;
5453
};
5554
typedef struct ompi_pml_cm_t ompi_pml_cm_t;
5655
extern ompi_pml_cm_t ompi_pml_cm;

ompi/mca/pml/cm/pml_cm_component.c

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ mca_pml_cm_component_register(void)
101101
MCA_BASE_VAR_SCOPE_READONLY,
102102
&ompi_pml_cm.free_list_inc);
103103

104-
ompi_pml_cm.default_priority = 10;
105-
(void) mca_base_component_var_register(&mca_pml_cm_component.pmlm_version, "priority",
106-
"CM PML selection priority",
107-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
108-
OPAL_INFO_LVL_9,
109-
MCA_BASE_VAR_SCOPE_READONLY,
110-
&ompi_pml_cm.default_priority);
111-
112104
return OPAL_SUCCESS;
113105
}
114106

@@ -143,32 +135,16 @@ mca_pml_cm_component_init(int* priority,
143135
{
144136
int ret;
145137

146-
if((*priority) > ompi_pml_cm.default_priority) {
147-
*priority = ompi_pml_cm.default_priority;
148-
return NULL;
149-
}
150-
*priority = ompi_pml_cm.default_priority;
138+
*priority = -1;
139+
151140
opal_output_verbose( 10, 0,
152141
"in cm pml priority is %d\n", *priority);
153142
/* find a useable MTL */
154-
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads);
143+
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads, priority);
155144
if (OMPI_SUCCESS != ret) {
156-
*priority = -1;
157145
return NULL;
158-
} else if((strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm") == 0) ||
159-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm2") == 0) ||
160-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "mxm") == 0) ||
161-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "ofi") == 0) ||
162-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "portals4") == 0)) {
163-
/*
164-
* If MTL is MXM or PSM then up our priority
165-
* For every other communication layer having MTLs and BTLs, the user/admin
166-
* may still select PML/ob1 (BTLs) or PML/cm (MTLs) if preferable for the app/site.
167-
*/
168-
*priority = 30;
169146
}
170147

171-
172148
if (ompi_mtl->mtl_flags & MCA_MTL_BASE_FLAG_REQUIRE_WORLD) {
173149
ompi_pml_cm.super.pml_flags |= MCA_PML_BASE_FLAG_REQUIRE_WORLD;
174150
}

ompi/mca/pml/ob1/pml_ob1_component.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,6 @@ mca_pml_ob1_component_init( int* priority,
254254
opal_output_verbose( 10, mca_pml_ob1_output,
255255
"in ob1, my priority is %d\n", mca_pml_ob1.priority);
256256

257-
if((*priority) > mca_pml_ob1.priority) {
258-
*priority = mca_pml_ob1.priority;
259-
return NULL;
260-
}
261257
*priority = mca_pml_ob1.priority;
262258

263259
allocator_component = mca_allocator_component_lookup( mca_pml_ob1.allocator_name );

0 commit comments

Comments
 (0)