From 659aec735bd4b613a6aed186a0a0e54273275d12 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 3 Nov 2016 15:01:42 -0700 Subject: [PATCH] Set the registered/deregistered flags so we correctly detect exit without calling finalize Correctly use the returned server object Signed-off-by: Ralph Castain --- orte/mca/state/base/state_base_fns.c | 1 + orte/orted/pmix/pmix_server_gen.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/orte/mca/state/base/state_base_fns.c b/orte/mca/state/base/state_base_fns.c index 273b20d6dbf..0160373a6b0 100644 --- a/orte/mca/state/base/state_base_fns.c +++ b/orte/mca/state/base/state_base_fns.c @@ -491,6 +491,7 @@ void orte_state_base_track_procs(int fd, short argc, void *cbdata) } else if (ORTE_PROC_STATE_REGISTERED == state) { /* update the proc state */ pdata->state = state; + ORTE_FLAG_SET(pdata, ORTE_PROC_FLAG_REG); jdata->num_reported++; if (jdata->num_reported == jdata->num_procs) { ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_REGISTERED); diff --git a/orte/orted/pmix/pmix_server_gen.c b/orte/orted/pmix/pmix_server_gen.c index 1a63094fe55..c9b6b1ed980 100644 --- a/orte/orted/pmix/pmix_server_gen.c +++ b/orte/orted/pmix/pmix_server_gen.c @@ -13,7 +13,7 @@ * All rights reserved. * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2013-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2016 Intel, Inc. All rights reserved. * Copyright (c) 2014 Mellanox Technologies, Inc. * All rights reserved. * 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 if (NULL != cbdata) { /* we were passed back the orte_proc_t */ - p = (orte_proc_t*)cbdata; + p = (orte_proc_t*)server_object; } else { /* find the named process */ p = NULL; @@ -80,6 +80,7 @@ int pmix_server_client_finalized_fn(opal_process_name_t *proc, void *server_obje } if (NULL != p) { p->state = ORTE_PROC_STATE_TERMINATED; + ORTE_FLAG_SET(p, ORTE_PROC_FLAG_HAS_DEREG); /* release the caller */ if (NULL != cbfunc) { cbfunc(ORTE_SUCCESS, cbdata);