Skip to content

Commit 93c8799

Browse files
authored
Merge pull request #7168 from wbailey2/pr/fix-yield_when_idle
v4.0.x: schizo/ompi: correctly handle the yield_when_idle option
2 parents e561f2a + b004f4c commit 93c8799

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

ompi/runtime/ompi_mpi_params.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
1818
* Copyright (c) 2015 Mellanox Technologies, Inc.
1919
* All rights reserved.
20-
* Copyright (c) 2016 Research Organization for Information Science
20+
* Copyright (c) 2016-2019 Research Organization for Information Science
2121
* and Technology (RIST). All rights reserved.
2222
* $COPYRIGHT$
2323
*
@@ -82,6 +82,7 @@ static bool show_default_mca_params = false;
8282
static bool show_file_mca_params = false;
8383
static bool show_enviro_mca_params = false;
8484
static bool show_override_mca_params = false;
85+
static bool ompi_mpi_oversubscribe = false;
8586

8687
int ompi_mpi_register_params(void)
8788
{
@@ -108,13 +109,18 @@ int ompi_mpi_register_params(void)
108109
* opal_progress: decide whether to yield and the event library
109110
* tick rate
110111
*/
111-
/* JMS: Need ORTE data here -- set this to 0 when
112-
exactly/under-subscribed, or 1 when oversubscribed */
113-
ompi_mpi_yield_when_idle = false;
112+
ompi_mpi_oversubscribe = false;
113+
(void) mca_base_var_register("ompi", "mpi", NULL, "oversubscribe",
114+
"Internal MCA parameter set by the runtime environment when oversubscribing nodes",
115+
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
116+
OPAL_INFO_LVL_9,
117+
MCA_BASE_VAR_SCOPE_READONLY,
118+
&ompi_mpi_oversubscribe);
119+
ompi_mpi_yield_when_idle = ompi_mpi_oversubscribe;
114120
(void) mca_base_var_register("ompi", "mpi", NULL, "yield_when_idle",
115121
"Yield the processor when waiting for MPI communication (for MPI processes, will default to 1 when oversubscribing nodes)",
116122
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
117-
OPAL_INFO_LVL_9,
123+
OPAL_INFO_LVL_5,
118124
MCA_BASE_VAR_SCOPE_READONLY,
119125
&ompi_mpi_yield_when_idle);
120126

orte/mca/schizo/ompi/schizo_ompi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* Copyright (c) 2011-2017 Oak Ridge National Labs. All rights reserved.
1616
* Copyright (c) 2017 UT-Battelle, LLC. All rights reserved.
1717
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
18-
* Copyright (c) 2015 Research Organization for Information Science
19-
* and Technology (RIST). All rights reserved.
18+
* Copyright (c) 2015-2019 Research Organization for Information Science
19+
* and Technology (RIST). All rights reserved.
2020
* Copyright (c) 2018 IBM Corporation. All rights reserved.
2121
* $COPYRIGHT$
2222
*
@@ -914,9 +914,9 @@ static int setup_fork(orte_job_t *jdata,
914914

915915
/* setup yield schedule - do not override any user-supplied directive! */
916916
if (oversubscribed) {
917-
opal_setenv("OMPI_MCA_mpi_yield_when_idle", "1", false, &app->env);
917+
opal_setenv("OMPI_MCA_mpi_oversubscribe", "1", true, &app->env);
918918
} else {
919-
opal_setenv("OMPI_MCA_mpi_yield_when_idle", "0", false, &app->env);
919+
opal_setenv("OMPI_MCA_mpi_oversubscribe", "0", true, &app->env);
920920
}
921921

922922
/* set the app_context number into the environment */

0 commit comments

Comments
 (0)