
/** @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.9 $ $Name: not supported by cvs2svn $
 *  @date $Date: 2004-09-07 19:05:07 $
 *
 *  Copyright 2004 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 *fmt, ...)
{
    va_list argPtr;             // variable list arguement pointer

    // Get the variable list parameters to pass to logging function
    va_start(argPtr, fmt);

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

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

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