Skip to content

Commit db12c3a

Browse files
author
rhc54
committed
Merge pull request open-mpi#693 from hjelmn/v1.10_cm_priority
v1.10 cm priority
2 parents b8f214f + a619941 commit db12c3a

File tree

11 files changed

+71
-53
lines changed

11 files changed

+71
-53
lines changed

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: 11 additions & 6 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
@@ -46,20 +47,23 @@ mca_mtl_base_module_t *ompi_mtl = NULL;
4647
* need to reexamine this at a later time.
4748
*/
4849
int
49-
ompi_mtl_base_select(bool enable_progress_threads,
50-
bool enable_mpi_threads)
50+
ompi_mtl_base_select (bool enable_progress_threads,
51+
bool enable_mpi_threads,
52+
int *priority)
5153
{
5254
int ret = OMPI_ERR_NOT_FOUND;
5355
mca_mtl_base_component_t *best_component = NULL;
5456
mca_mtl_base_module_t *best_module = NULL;
57+
int best_priority;
5558

5659
/*
5760
* Select the best component
5861
*/
59-
if( OPAL_SUCCESS != mca_base_select("mtl", ompi_mtl_base_framework.framework_output,
60-
&ompi_mtl_base_framework.framework_components,
61-
(mca_base_module_t **) &best_module,
62-
(mca_base_component_t **) &best_component) ) {
62+
if( OPAL_SUCCESS != mca_base_select_new ("mtl", ompi_mtl_base_framework.framework_output,
63+
&ompi_mtl_base_framework.framework_components,
64+
(mca_base_module_t **) &best_module,
65+
(mca_base_component_t **) &best_component,
66+
&best_priority) ) {
6367
/* notify caller that no available component found */
6468
return ret;
6569
}
@@ -79,6 +83,7 @@ ompi_mtl_base_select(bool enable_progress_threads,
7983
"select: init returned success");
8084
ompi_mtl_base_selected_component = best_component;
8185
ompi_mtl = best_module;
86+
*priority = best_priority;
8287
ret = OMPI_SUCCESS;
8388
}
8489

ompi/mca/mtl/mxm/mtl_mxm_component.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED.
4+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
5+
* reserved.
6+
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
37
* $COPYRIGHT$
48
*
59
* Additional copyrights may follow
@@ -89,7 +93,7 @@ static int ompi_mtl_mxm_component_register(void)
8993
MCA_BASE_VAR_SCOPE_READONLY,
9094
&ompi_mtl_mxm.mxm_np);
9195

92-
param_priority = 100;
96+
param_priority = 30;
9397
(void) mca_base_component_var_register (c,
9498
"priority", "Priority of the MXM MTL component",
9599
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$
@@ -86,7 +87,8 @@ ompi_mtl_psm2_component_register(void)
8687
MCA_BASE_VAR_SCOPE_READONLY,
8788
&ompi_mtl_psm2.connect_timeout);
8889

89-
param_priority = 120;
90+
/* set priority high enough to beat ob1's default (also set higher than psm) */
91+
param_priority = 40;
9092
(void) mca_base_component_var_register (&mca_mtl_psm2_component.super.mtl_version,
9193
"priority", "Priority of the PSM2 MTL component",
9294
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
@@ -49,7 +49,6 @@ struct ompi_pml_cm_t {
4949
int free_list_num;
5050
int free_list_max;
5151
int free_list_inc;
52-
int default_priority;
5352
};
5453
typedef struct ompi_pml_cm_t ompi_pml_cm_t;
5554
extern ompi_pml_cm_t ompi_pml_cm;

ompi/mca/pml/cm/pml_cm_component.c

Lines changed: 8 additions & 26 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) 2006-2007 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -9,6 +10,8 @@
910
* All rights reserved.
1011
* Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
1112
* Copyright (c) 2013 Sandia National Laboratories. All rights reserved.
13+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
14+
* reserved.
1215
* $COPYRIGHT$
1316
*
1417
* Additional copyrights may follow
@@ -101,14 +104,6 @@ mca_pml_cm_component_register(void)
101104
MCA_BASE_VAR_SCOPE_READONLY,
102105
&ompi_pml_cm.free_list_inc);
103106

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-
112107
return OPAL_SUCCESS;
113108
}
114109

@@ -143,27 +138,14 @@ mca_pml_cm_component_init(int* priority,
143138
{
144139
int ret;
145140

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;
151-
opal_output_verbose( 10, 0,
141+
*priority = -1;
142+
143+
opal_output_verbose( 10, 0,
152144
"in cm pml priority is %d\n", *priority);
153145
/* find a useable MTL */
154-
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads);
155-
if (OMPI_SUCCESS != ret) {
156-
*priority = -1;
146+
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads, priority);
147+
if (OMPI_SUCCESS != ret) {
157148
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-
/*
162-
* If MTL is MXM or PSM then up our priority
163-
* For every other communication layer having MTLs and BTLs, the user/admin
164-
* may still select PML/ob1 (BTLs) or PML/cm (MTLs) if preferable for the app/site.
165-
*/
166-
*priority = 30;
167149
}
168150

169151

ompi/mca/pml/ob1/pml_ob1_component.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* All rights reserved.
1313
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
1414
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved
15-
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
15+
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* $COPYRIGHT$
1818
*
@@ -248,10 +248,6 @@ mca_pml_ob1_component_init( int* priority,
248248
opal_output_verbose( 10, mca_pml_ob1_output,
249249
"in ob1, my priority is %d\n", mca_pml_ob1.priority);
250250

251-
if((*priority) > mca_pml_ob1.priority) {
252-
*priority = mca_pml_ob1.priority;
253-
return NULL;
254-
}
255251
*priority = mca_pml_ob1.priority;
256252

257253
allocator_component = mca_allocator_component_lookup( mca_pml_ob1.allocator_name );

opal/mca/base/base.h

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
1313
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
14-
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
14+
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
1515
* reserved.
1616
* $COPYRIGHT$
1717
*
@@ -108,11 +108,20 @@ OPAL_DECLSPEC int mca_base_close(void);
108108
/**
109109
* A generic select function
110110
*
111+
* The _new version is a 1.10.x only function. It is the version available
112+
* 2.0.0 and beyond. The old version calls the new version with NULL for
113+
* priority_out.
111114
*/
112-
OPAL_DECLSPEC int mca_base_select(const char *type_name, int output_id,
113-
opal_list_t *components_available,
114-
mca_base_module_t **best_module,
115-
mca_base_component_t **best_component);
115+
OPAL_DECLSPEC int mca_base_select_new (const char *type_name, int output_id,
116+
opal_list_t *components_available,
117+
mca_base_module_t **best_module,
118+
mca_base_component_t **best_component,
119+
int *priority_out);
120+
121+
OPAL_DECLSPEC int mca_base_select (const char *type_name, int output_id,
122+
opal_list_t *components_available,
123+
mca_base_module_t **best_module,
124+
mca_base_component_t **best_component);
116125

117126
/**
118127
* A function for component query functions to discover if they have

0 commit comments

Comments
 (0)