
/** @file  psAbort.c
 *
 *  @brief Contains the definition for abort function
 *
 *  The abort logging and handling shall be performed by psAbort function.
 *  This will allow for consistent handling of other software units
 *  needing to abort from program execution.
 *
 *  @author Eric Van Alst, MHPCC
 *   
 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
 *  @date $Date: 2005-11-15 20:10:32 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
 */

#include <stdarg.h>
#include <stdlib.h>
#include "psAbort.h"
#include "psLogMsg.h"

void psAbort(const char *name, const char *format, ...)
{
    va_list argPtr;             // variable list arguement pointer
    // Get the variable list parameters to pass to logging function
    va_start(argPtr, format);

    // Call logging function with PS_LOG_ABORT level
    psLogMsgV(name, PS_LOG_ABORT, format, argPtr);

    // Clean up stack after variable arguement has been used
    va_end(argPtr);

    // Call system abort function to terminate program execution
    abort();
}
