Skip to content

Commit 9602484

Browse files
committed
Merge pull request #1040 from hjelmn/mtl_priority
Change how cm's priority is calculated
2 parents 71ec545 + 53f6b57 commit 9602484

31 files changed

+103
-74
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
@@ -131,7 +131,8 @@ static int ompi_mtl_mxm_component_register(void)
131131
free(runtime_version);
132132
#endif
133133

134-
param_priority = 100;
134+
/* set high enought to defeat ob1's default */
135+
param_priority = 30;
135136
(void) mca_base_component_var_register (c,
136137
"priority", "Priority of the MXM MTL component",
137138
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 = 10; /* for now give a lower priority than the psm mtl and ob1 */
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 );

opal/mca/base/base.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ OPAL_DECLSPEC int mca_base_close(void);
134134
OPAL_DECLSPEC int mca_base_select(const char *type_name, int output_id,
135135
opal_list_t *components_available,
136136
mca_base_module_t **best_module,
137-
mca_base_component_t **best_component);
137+
mca_base_component_t **best_component,
138+
int *priority_out);
138139

139140
/**
140141
* A function for component query functions to discover if they have

opal/mca/base/mca_base_components_select.c

Lines changed: 6 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-2008 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -33,7 +34,8 @@
3334
int mca_base_select(const char *type_name, int output_id,
3435
opal_list_t *components_available,
3536
mca_base_module_t **best_module,
36-
mca_base_component_t **best_component)
37+
mca_base_component_t **best_component,
38+
int *priority_out)
3739
{
3840
mca_base_component_list_item_t *cli = NULL;
3941
mca_base_component_t *component = NULL;
@@ -108,6 +110,9 @@ int mca_base_select(const char *type_name, int output_id,
108110
}
109111
}
110112

113+
if (priority_out) {
114+
*priority_out = best_priority;
115+
}
111116

112117
/*
113118
* Finished querying all components.

opal/mca/compress/base/compress_base_select.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2004-2010 The Trustees of Indiana University.
34
* All rights reserved.
45
* Copyright (c) 2015 Research Organization for Information Science
56
* and Technology (RIST). All rights reserved.
67
*
8+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
9+
* reserved.
710
* $COPYRIGHT$
811
*
912
* Additional copyrights may follow
@@ -43,7 +46,7 @@ int opal_compress_base_select(void)
4346
if( OPAL_SUCCESS != mca_base_select("compress", opal_compress_base_framework.framework_output,
4447
&opal_compress_base_framework.framework_components,
4548
(mca_base_module_t **) &best_module,
46-
(mca_base_component_t **) &best_component) ) {
49+
(mca_base_component_t **) &best_component, NULL) ) {
4750
/* This will only happen if no component was selected */
4851
exit_status = OPAL_ERROR;
4952
goto cleanup;

opal/mca/crs/base/crs_base_select.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int opal_crs_base_select(void)
5858
if( OPAL_SUCCESS != mca_base_select("crs", opal_crs_base_framework.framework_output,
5959
&opal_crs_base_framework.framework_components,
6060
(mca_base_module_t **) &best_module,
61-
(mca_base_component_t **) &best_component) ) {
61+
(mca_base_component_t **) &best_component, NULL) ) {
6262
/* This will only happen if no component was selected */
6363
return OPAL_ERROR;
6464
}

opal/mca/dl/base/dl_base_select.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2004-2010 The Trustees of Indiana University.
34
* All rights reserved.
45
*
56
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
67
* $COPYRIGHT$
8+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
9+
* reserved.
710
*
811
* Additional copyrights may follow
912
*
@@ -37,7 +40,7 @@ int opal_dl_base_select(void)
3740
opal_dl_base_framework.framework_output,
3841
&opal_dl_base_framework.framework_components,
3942
(mca_base_module_t **) &best_module,
40-
(mca_base_component_t **) &best_component) ) {
43+
(mca_base_component_t **) &best_component, NULL) ) {
4144
/* This will only happen if no component was selected */
4245
exit_status = OPAL_ERROR;
4346
goto cleanup;

opal/mca/memchecker/base/memchecker_base_select.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
34
* University of Stuttgart. All rights reserved.
45
* Copyright (c) 2004-2008 The Trustees of Indiana University.
56
* All rights reserved.
7+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
8+
* reserved.
69
* $COPYRIGHT$
710
*
811
* Additional copyrights may follow
@@ -40,7 +43,7 @@ int opal_memchecker_base_select(void)
4043
if( OPAL_SUCCESS != mca_base_select("memchecker", opal_memchecker_base_framework.framework_output,
4144
&opal_memchecker_base_framework.framework_components,
4245
(mca_base_module_t **) &best_module,
43-
(mca_base_component_t **) &best_component) ) {
46+
(mca_base_component_t **) &best_component, NULL) ) {
4447
/* This will only happen if no component was selected */
4548
exit_status = OPAL_ERR_NOT_FOUND;
4649
goto cleanup;

opal/mca/pmix/base/pmix_base_select.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
4+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
5+
* reserved.
36
* $COPYRIGHT$
47
*
58
* Additional copyrights may follow
@@ -31,7 +34,7 @@ int opal_pmix_base_select(void)
3134
if( OPAL_SUCCESS != mca_base_select("pmix", opal_pmix_base_framework.framework_output,
3235
&opal_pmix_base_framework.framework_components,
3336
(mca_base_module_t **) &best_module,
34-
(mca_base_component_t **) &best_component) ) {
37+
(mca_base_component_t **) &best_component, NULL) ) {
3538
/* notify caller that no available component found */
3639
return OPAL_ERR_NOT_FOUND;
3740
}

opal/mca/pstat/base/pstat_base_select.c

Lines changed: 4 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-2008 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -10,6 +11,8 @@
1011
* Copyright (c) 2004-2005 The Regents of the University of California.
1112
* All rights reserved.
1213
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
14+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
15+
* reserved.
1316
* $COPYRIGHT$
1417
*
1518
* Additional copyrights may follow
@@ -42,7 +45,7 @@ int opal_pstat_base_select(void)
4245
if( OPAL_SUCCESS != mca_base_select("pstat", opal_pstat_base_framework.framework_output,
4346
&opal_pstat_base_framework.framework_components,
4447
(mca_base_module_t **) &best_module,
45-
(mca_base_component_t **) &best_component) ) {
48+
(mca_base_component_t **) &best_component, NULL) ) {
4649
/* It is okay if we don't find a runnable component - default
4750
* to the unsupported default.
4851
*/

opal/mca/reachable/base/reachable_base_select.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2014 Intel, Inc. All rights reserved.
4+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
5+
* reserved.
36
* $COPYRIGHT$
47
*
58
* Additional copyrights may follow
@@ -32,7 +35,7 @@ int opal_reachable_base_select(void)
3235
if( OPAL_SUCCESS != mca_base_select("reachable", opal_reachable_base_framework.framework_output,
3336
&opal_reachable_base_framework.framework_components,
3437
(mca_base_module_t **) &best_module,
35-
(mca_base_component_t **) &best_component) ) {
38+
(mca_base_component_t **) &best_component, NULL) ) {
3639
/* notify caller that no available component found */
3740
return OPAL_ERR_NOT_FOUND;
3841
}

orte/mca/dfs/base/dfs_base_select.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
2-
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
3+
* Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights
4+
* reserved.
35
* $COPYRIGHT$
46
*
57
* Additional copyrights may follow
@@ -31,7 +33,7 @@ int orte_dfs_base_select(void)
3133
if (OPAL_SUCCESS != mca_base_select("dfs", orte_dfs_base_framework.framework_output,
3234
&orte_dfs_base_framework.framework_components,
3335
(mca_base_module_t **) &best_module,
34-
(mca_base_component_t **) &best_component)) {
36+
(mca_base_component_t **) &best_component, NULL)) {
3537
/* This will only happen if no component was selected, which
3638
* is okay - we don't have to select anything
3739
*/

0 commit comments

Comments
 (0)