Skip to content

Commit 0cecbbd

Browse files
committed
pml/cm: use the priority of the mtl component
This commit changes the priority of mtl components to be relative to pml/ob1 and updates the mtl interface to expose this priority. cm now sets its own priority based on the priority of the selected mtl component. (cherry picked from open-mpi/ompi@53f6b57) Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 4eaefed commit 0cecbbd

File tree

8 files changed

+24
-32
lines changed

8 files changed

+24
-32
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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ mca_mtl_base_module_t *ompi_mtl = NULL;
4747
* need to reexamine this at a later time.
4848
*/
4949
int
50-
ompi_mtl_base_select(bool enable_progress_threads,
51-
bool enable_mpi_threads)
50+
ompi_mtl_base_select (bool enable_progress_threads,
51+
bool enable_mpi_threads,
52+
int *priority)
5253
{
5354
int ret = OMPI_ERR_NOT_FOUND;
5455
mca_mtl_base_component_t *best_component = NULL;
@@ -82,6 +83,7 @@ ompi_mtl_base_select(bool enable_progress_threads,
8283
"select: init returned success");
8384
ompi_mtl_base_selected_component = best_component;
8485
ompi_mtl = best_module;
86+
*priority = best_priority;
8587
ret = OMPI_SUCCESS;
8688
}
8789

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 = 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$
@@ -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: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ mca_pml_cm_component_register(void)
104104
MCA_BASE_VAR_SCOPE_READONLY,
105105
&ompi_pml_cm.free_list_inc);
106106

107-
ompi_pml_cm.default_priority = 10;
108-
(void) mca_base_component_var_register(&mca_pml_cm_component.pmlm_version, "priority",
109-
"CM PML selection priority",
110-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
111-
OPAL_INFO_LVL_9,
112-
MCA_BASE_VAR_SCOPE_READONLY,
113-
&ompi_pml_cm.default_priority);
114-
115107
return OPAL_SUCCESS;
116108
}
117109

@@ -146,26 +138,14 @@ mca_pml_cm_component_init(int* priority,
146138
{
147139
int ret;
148140

141+
*priority = -1;
142+
149143
opal_output_verbose( 10, 0,
150144
"in cm pml priority is %d\n", *priority);
151145
/* find a useable MTL */
152-
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads);
146+
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads, priority);
153147
if (OMPI_SUCCESS != ret) {
154-
*priority = -1;
155148
return NULL;
156-
} else if((strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm") == 0) ||
157-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm2") == 0) ||
158-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "mxm") == 0) ||
159-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "ofi") == 0) ||
160-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "portals4") == 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;
167-
} else {
168-
*priority = ompi_pml_cm.default_priority;
169149
}
170150

171151

0 commit comments

Comments
 (0)