Skip to content

Commit ea12365

Browse files
authored
Merge pull request #2553 from rhc54/cmr2x/nosync
Set the registered/deregistered flags so we correctly detect exit without calling finalize
2 parents a7fd60b + d275fbf commit ea12365

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

orte/mca/state/base/state_base_fns.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
3-
* Copyright (c) 2014 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
44
* $COPYRIGHT$
55
*
66
* Additional copyrights may follow
@@ -491,6 +491,7 @@ void orte_state_base_track_procs(int fd, short argc, void *cbdata)
491491
} else if (ORTE_PROC_STATE_REGISTERED == state) {
492492
/* update the proc state */
493493
pdata->state = state;
494+
ORTE_FLAG_SET(pdata, ORTE_PROC_FLAG_REG);
494495
jdata->num_reported++;
495496
if (jdata->num_reported == jdata->num_procs) {
496497
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_REGISTERED);
@@ -521,13 +522,13 @@ void orte_state_base_track_procs(int fd, short argc, void *cbdata)
521522
/* update the proc state */
522523
ORTE_FLAG_UNSET(pdata, ORTE_PROC_FLAG_ALIVE);
523524
pdata->state = state;
524-
if (ORTE_FLAG_TEST(pdata, ORTE_PROC_FLAG_LOCAL)) {
525+
if (ORTE_FLAG_TEST(pdata, ORTE_PROC_FLAG_LOCAL)) {
525526
/* Clean up the session directory as if we were the process
526527
* itself. This covers the case where the process died abnormally
527528
* and didn't cleanup its own session directory.
528529
*/
529530
orte_session_dir_finalize(proc);
530-
}
531+
}
531532
/* if we are trying to terminate and our routes are
532533
* gone, then terminate ourselves IF no local procs
533534
* remain (might be some from another job)
@@ -550,11 +551,11 @@ void orte_state_base_track_procs(int fd, short argc, void *cbdata)
550551
}
551552
/* return the allocated slot for reuse */
552553
cleanup_node(pdata);
553-
/* track job status */
554-
jdata->num_terminated++;
555-
if (jdata->num_terminated == jdata->num_procs) {
554+
/* track job status */
555+
jdata->num_terminated++;
556+
if (jdata->num_terminated == jdata->num_procs) {
556557
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_TERMINATED);
557-
}
558+
}
558559
}
559560

560561
cleanup:
@@ -752,10 +753,10 @@ void orte_state_base_check_all_complete(int fd, short args, void *cbdata)
752753
* is maintained!
753754
*/
754755
if (1 < j) {
755-
if (ORTE_FLAG_TEST(jdata, ORTE_JOB_FLAG_DEBUGGER_DAEMON)) {
756-
/* this was a debugger daemon. notify that a debugger has detached */
757-
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_DEBUGGER_DETACH);
758-
}
756+
if (ORTE_FLAG_TEST(jdata, ORTE_JOB_FLAG_DEBUGGER_DAEMON)) {
757+
/* this was a debugger daemon. notify that a debugger has detached */
758+
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_DEBUGGER_DETACH);
759+
}
759760
opal_pointer_array_set_item(orte_job_data, j, NULL); /* ensure the array has a NULL */
760761
OBJ_RELEASE(jdata);
761762
}

orte/orted/pmix/pmix_server_gen.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* All rights reserved.
1414
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
1515
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
16-
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
16+
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
1717
* Copyright (c) 2014 Mellanox Technologies, Inc.
1818
* All rights reserved.
1919
* Copyright (c) 2014 Research Organization for Information Science
@@ -58,7 +58,7 @@ int pmix_server_client_finalized_fn(opal_process_name_t *proc, void *server_obje
5858

5959
if (NULL != cbdata) {
6060
/* we were passed back the orte_proc_t */
61-
p = (orte_proc_t*)cbdata;
61+
p = (orte_proc_t*)server_object;
6262
} else {
6363
/* find the named process */
6464
p = NULL;
@@ -80,6 +80,7 @@ int pmix_server_client_finalized_fn(opal_process_name_t *proc, void *server_obje
8080
}
8181
if (NULL != p) {
8282
p->state = ORTE_PROC_STATE_TERMINATED;
83+
ORTE_FLAG_SET(p, ORTE_PROC_FLAG_HAS_DEREG);
8384
/* release the caller */
8485
if (NULL != cbfunc) {
8586
cbfunc(ORTE_SUCCESS, cbdata);

0 commit comments

Comments
 (0)