Skip to content

Commit e58c543

Browse files
Ralph Castainjsquyres
authored andcommitted
There is no reason for tools to have an async progress thread as they can loop the event library themselves. This has the added benefit of causing the tool to "block" while waiting for events so they don't use cpu.
Also, fix orte-submit so it appropriately handles --help option For v2.0.0: fixes open-mpi#805 (cherry picked from commit open-mpi/ompi@836f495)
1 parent b3b1224 commit e58c543

File tree

2 files changed

+10
-26
lines changed

2 files changed

+10
-26
lines changed

orte/mca/ess/base/ess_base_std_tool.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858

5959
#include "orte/mca/ess/base/base.h"
6060

61-
static bool progress_thread_running = false;
62-
6361
int orte_ess_base_tool_setup(void)
6462
{
6563
int ret;
@@ -72,19 +70,6 @@ int orte_ess_base_tool_setup(void)
7270
orte_process_info.super.proc_arch = opal_local_arch;
7371
opal_proc_local_set(&orte_process_info.super);
7472

75-
if (NULL != orte_process_info.my_hnp_uri) {
76-
/* if we were given an HNP, then we want
77-
* to look like an application as well as being a tool.
78-
* Need to do this before opening the routed framework
79-
* so it will do the right things.
80-
*/
81-
orte_process_info.proc_type |= ORTE_PROC_NON_MPI;
82-
/* get a separate orte event base */
83-
orte_event_base = opal_start_progress_thread("orte", true);
84-
progress_thread_running = true;
85-
orte_event_base_active = true;
86-
}
87-
8873
/* open and setup the state machine */
8974
if (ORTE_SUCCESS != (ret = mca_base_framework_open(&orte_state_base_framework, 0))) {
9075
ORTE_ERROR_LOG(ret);
@@ -242,10 +227,5 @@ int orte_ess_base_tool_finalize(void)
242227
(void) mca_base_framework_close(&orte_schizo_base_framework);
243228
(void) mca_base_framework_close(&orte_errmgr_base_framework);
244229

245-
/* release the event base */
246-
if (progress_thread_running) {
247-
opal_progress_thread_finalize("orte");
248-
progress_thread_running = false;
249-
}
250230
return ORTE_SUCCESS;
251231
}

orte/tools/orte-submit/orte-submit.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ static opal_cmd_line_init_t cmd_line_init[] = {
317317
&myglobals.run_as_root, OPAL_CMD_LINE_TYPE_BOOL,
318318
"Allow execution as root (STRONGLY DISCOURAGED)" },
319319

320-
/* End of list */
320+
/* End of list */
321321
{ NULL, '\0', NULL, NULL, 0,
322322
NULL, OPAL_CMD_LINE_TYPE_NULL, NULL }
323323
};
@@ -408,8 +408,8 @@ int main(int argc, char *argv[])
408408
fprintf(stderr, "--------------------------------------------------------------------------\n");
409409
exit(1);
410410
}
411-
412-
/*
411+
412+
/*
413413
* Since this process can now handle MCA/GMCA parameters, make sure to
414414
* process them.
415415
*/
@@ -714,12 +714,16 @@ int main(int argc, char *argv[])
714714
orte_rml.send_buffer_nb(ORTE_PROC_MY_HNP, req, ORTE_RML_TAG_DAEMON, orte_rml_send_callback, NULL);
715715

716716
// wait for response and unpack the status, jobid
717-
ORTE_WAIT_FOR_COMPLETION(myspawn);
717+
while (myspawn) {
718+
opal_event_loop(orte_event_base, OPAL_EVLOOP_ONCE);
719+
}
718720
opal_output(0, "Job %s has launched", ORTE_JOBID_PRINT(jdata->jobid));
719721

720722
waiting:
721-
ORTE_WAIT_FOR_COMPLETION(mywait);
722-
723+
while (mywait) {
724+
opal_event_loop(orte_event_base, OPAL_EVLOOP_ONCE);
725+
}
726+
723727
DONE:
724728
/* cleanup and leave */
725729
orte_finalize();

0 commit comments

Comments
 (0)