From 9d5af5f926b34280fd913d27b3dacacc66f57053 Mon Sep 17 00:00:00 2001 From: Josh Hursey Date: Thu, 15 Sep 2005 17:13:13 +0000 Subject: [PATCH] As Tim pointed out we don't want to call orte_finalize in orte_abort. However we do want to do a bit of cleanup on the node before we exit, specificly clean out the session directory. I also had a couple of the subsystems that don't depend upon peers (which is key) clean up as well. Pedantic formatting issue in oob_tcp.h This commit was SVN r7387. --- orte/mca/oob/tcp/oob_tcp.h | 3 ++- orte/runtime/orte_abort.c | 27 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/orte/mca/oob/tcp/oob_tcp.h b/orte/mca/oob/tcp/oob_tcp.h index 8d0faad51b..16e04dddb9 100644 --- a/orte/mca/oob/tcp/oob_tcp.h +++ b/orte/mca/oob/tcp/oob_tcp.h @@ -153,7 +153,8 @@ static inline uint64_t ntoh64(uint64_t val) * when process names are used as indices. */ int mca_oob_tcp_process_name_compare(const orte_process_name_t* n1, const orte_process_name_t* n2); - /** + +/** * Obtain contact information for this host (e.g. :) */ diff --git a/orte/runtime/orte_abort.c b/orte/runtime/orte_abort.c index a55f7ad9d0..f5b4a25752 100644 --- a/orte/runtime/orte_abort.c +++ b/orte/runtime/orte_abort.c @@ -23,6 +23,10 @@ #include "include/constants.h" #include "runtime/runtime.h" #include "opal/util/output.h" +#include "opal/runtime/opal_progress.h" +#include "opal/event/event.h" +#include "orte/util/session_dir.h" +#include "orte/util/sys_info.h" int orte_abort(int status, char *fmt, ...) @@ -42,6 +46,27 @@ int orte_abort(int status, char *fmt, ...) /* Exit - do NOT do normal finalize as this will very likely * hang the process. We are aborting due to an abnormal condition - * that precludes normal cleanup */ + * that precludes normal cleanup + * + * We do need to do the following bits to make sure we leave a + * clean environment. Taken from orte_finalize(): + * - Assume errmgr cleans up child processes before we exit. + */ + + /* - Turn of progress engine */ + opal_progress_finalize(); + + /* - Turn off event loop */ + opal_event_fini(); + + /* - Clean up session directory */ + orte_session_dir_finalize(orte_process_info.my_name); + + /* - Clean out the global structures (no necessary, but good practice) */ + orte_sys_info_finalize(); + orte_proc_info_finalize(); + orte_univ_info_finalize(); + + /* Now Exit */ exit(status); }