2004-01-15 07:47:20 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-15 07:47:20 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte_config.h"
|
2004-01-15 07:47:20 +03:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2004-10-14 23:39:21 +04:00
|
|
|
#include <stdarg.h>
|
2004-01-15 07:47:20 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/orte_constants.h"
|
|
|
|
#include "orte/runtime/runtime.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2005-09-15 21:13:13 +04:00
|
|
|
#include "opal/runtime/opal_progress.h"
|
|
|
|
#include "opal/event/event.h"
|
|
|
|
#include "orte/util/session_dir.h"
|
|
|
|
#include "orte/util/sys_info.h"
|
2004-01-15 07:47:20 +03:00
|
|
|
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
int orte_abort(int status, char *fmt, ...)
|
2004-01-15 07:47:20 +03:00
|
|
|
{
|
2005-07-12 23:33:37 +04:00
|
|
|
va_list arglist;
|
2004-01-19 20:46:34 +03:00
|
|
|
|
2005-07-12 23:33:37 +04:00
|
|
|
/* If there was a message, output it */
|
2004-01-19 20:46:34 +03:00
|
|
|
|
2005-07-12 23:33:37 +04:00
|
|
|
va_start(arglist, fmt);
|
|
|
|
if( NULL != fmt ) {
|
|
|
|
char* buffer = NULL;
|
|
|
|
vasprintf( &buffer, fmt, arglist );
|
|
|
|
opal_output( 0, buffer );
|
|
|
|
free( buffer );
|
|
|
|
}
|
|
|
|
va_end(arglist);
|
2004-01-15 07:47:20 +03:00
|
|
|
|
2005-09-15 18:06:03 +04:00
|
|
|
/* Exit - do NOT do normal finalize as this will very likely
|
|
|
|
* hang the process. We are aborting due to an abnormal condition
|
2005-09-15 21:13:13 +04:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* - Clean up session directory */
|
|
|
|
orte_session_dir_finalize(orte_process_info.my_name);
|
|
|
|
|
2005-09-15 21:18:35 +04:00
|
|
|
/* - Clean out the global structures
|
|
|
|
* (not really necessary, but good practice) */
|
2005-09-15 21:13:13 +04:00
|
|
|
orte_sys_info_finalize();
|
|
|
|
orte_proc_info_finalize();
|
|
|
|
orte_univ_info_finalize();
|
|
|
|
|
|
|
|
/* Now Exit */
|
2005-07-12 23:33:37 +04:00
|
|
|
exit(status);
|
2004-01-15 07:47:20 +03:00
|
|
|
}
|