From ccd33a17b82240f53ac595ad78b30acc19f52347 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Fri, 2 May 2014 10:46:25 +0000 Subject: [PATCH] Since we cannot block when calling abort, and we want to ensure any "show_help" message at least has a chance to get out before we exit, introduce a slight delay into the abort procedure. Refs trac:4576 This commit was SVN r31601. The following Trac tickets were found above: Ticket 4576 --> https://svn.open-mpi.org/trac/ompi/ticket/4576 --- orte/mca/ess/base/ess_base_std_app.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/orte/mca/ess/base/ess_base_std_app.c b/orte/mca/ess/base/ess_base_std_app.c index 04001f7fd1..7606ef63de 100644 --- a/orte/mca/ess/base/ess_base_std_app.c +++ b/orte/mca/ess/base/ess_base_std_app.c @@ -430,6 +430,7 @@ void orte_ess_base_app_abort(int status, bool report) { int fd; char *myfile; + struct timespec tp = {0, 100000}; \ /* Exit - do NOT do a normal finalize as this will very likely * hang the process. We are aborting due to an abnormal condition @@ -453,6 +454,10 @@ void orte_ess_base_app_abort(int status, bool report) myfile = opal_os_path(false, orte_process_info.proc_session_dir, "aborted", NULL); fd = open(myfile, O_CREAT); close(fd); + /* now introduce a short delay to allow any pending + * messages (e.g., from a call to "show_help") to + * have a chance to be sent */ + nanosleep(&tp, NULL); \ } /* - Clean out the global structures