Skip to content

Commit 3b9abfc

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. Signed-off-by: Nathan Hjelm <[email protected]>
1 parent bfd443c commit 3b9abfc

File tree

7 files changed

+16
-31
lines changed

7 files changed

+16
-31
lines changed

ompi/mca/mtl/base/mtl_base_frame.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ mca_mtl_base_module_t *ompi_mtl = NULL;
4949
* need to reexamine this at a later time.
5050
*/
5151
int
52-
ompi_mtl_base_select(bool enable_progress_threads,
53-
bool enable_mpi_threads)
52+
ompi_mtl_base_select (bool enable_progress_threads,
53+
bool enable_mpi_threads,
54+
int *priority)
5455
{
5556
int ret = OMPI_ERR_NOT_FOUND;
5657
mca_mtl_base_component_t *best_component = NULL;
@@ -84,6 +85,7 @@ ompi_mtl_base_select(bool enable_progress_threads,
8485
"select: init returned success");
8586
ompi_mtl_base_selected_component = best_component;
8687
ompi_mtl = best_module;
88+
*priority = best_priority;
8789
ret = OMPI_SUCCESS;
8890
}
8991

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 & 23 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,26 +135,14 @@ mca_pml_cm_component_init(int* priority,
143135
{
144136
int ret;
145137

138+
*priority = -1;
139+
146140
opal_output_verbose( 10, 0,
147141
"in cm pml priority is %d\n", *priority);
148142
/* find a useable MTL */
149-
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads);
143+
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads, priority);
150144
if (OMPI_SUCCESS != ret) {
151-
*priority = -1;
152145
return NULL;
153-
} else if((strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm") == 0) ||
154-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm2") == 0) ||
155-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "mxm") == 0) ||
156-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "ofi") == 0) ||
157-
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "portals4") == 0)) {
158-
/*
159-
* If MTL is MXM or PSM then up our priority
160-
* For every other communication layer having MTLs and BTLs, the user/admin
161-
* may still select PML/ob1 (BTLs) or PML/cm (MTLs) if preferable for the app/site.
162-
*/
163-
*priority = 30;
164-
} else {
165-
*priority = ompi_pml_cm.default_priority;
166146
}
167147

168148
if (ompi_mtl->mtl_flags & MCA_MTL_BASE_FLAG_REQUIRE_WORLD) {

0 commit comments

Comments
 (0)