Skip to content

Commit

Permalink
Merge pull request #981 from rhc54/topic/trm
Browse files Browse the repository at this point in the history
Only order DVM termination once
  • Loading branch information
rhc54 authored May 26, 2021
2 parents eb65348 + a89f650 commit eeb72a4
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/mca/state/dvm/state_dvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ static void force_quit(int fd, short args, void *cbdata)
PRTE_RELEASE(caddy);
}

/************************
* Local variables
************************/
static bool terminate_dvm = false;
static bool dvm_terminated = false;


/************************
* API Definitions
************************/
Expand Down Expand Up @@ -603,10 +610,6 @@ static void check_complete(int fd, short args, void *cbdata)
++num_tools_attached;
continue;
}
/* if the job is flagged to not be monitored, skip it */
if (PRTE_FLAG_TEST(jptr, PRTE_JOB_FLAG_DO_NOT_MONITOR)) {
continue;
}
if (jptr->state < PRTE_JOB_STATE_TERMINATED) {
/* still alive - finish processing this job's termination */
goto release;
Expand All @@ -618,7 +621,7 @@ static void check_complete(int fd, short args, void *cbdata)
PRTE_OUTPUT_VERBOSE((2, prte_state_base_framework.framework_output,
"%s state:dvm:check_job_completed state is terminated - activating notify",
PRTE_NAME_PRINT(PRTE_PROC_MY_NAME)));
prte_job_term_ordered = true; // flag that the DVM is to terminate
terminate_dvm = true; // flag that the DVM is to terminate
PRTE_ACTIVATE_JOB_STATE(jdata, PRTE_JOB_STATE_NOTIFY_COMPLETED);
return;
}
Expand Down Expand Up @@ -769,7 +772,8 @@ static void cleanup_job(int sd, short args, void *cbdata)

PRTE_ACQUIRE_OBJECT(caddy);

if (prte_job_term_ordered) {
if (terminate_dvm && !dvm_terminated) {
dvm_terminated = true;
prte_plm.terminate_orteds();
}

Expand Down

0 comments on commit eeb72a4

Please sign in to comment.