PULSAR  1.0.0
Parallel Ultra Light Systolic Array Runtime
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
prt_assert.h File Reference

PRT exception handling. More...

#include "prt.h"
Include dependency graph for prt_assert.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define prt_error(msg)   prt_error_line_file(msg, __LINE__, __FILE__)
 
#define prt_warning(msg)   prt_warning_line_file(msg, __LINE__, __FILE__)
 
#define prt_assert(cond, msg)   prt_assert_line_file(cond, msg, __LINE__, __FILE__)
 

Functions

void prt_error_line_file (char *msg, int line, char *file)
 Print an error message and exit. More...
 
void prt_warning_line_file (char *msg, int line, char *file)
 Print a warning and continue. More...
 
void prt_assert_line_file (int cond, char *msg, int line, char *file)
 Check an assertion and exit on error. Print an error message. More...
 

Detailed Description

PRT exception handling.

Author
Jakub Kurzak

PULSAR Runtime http://icl.eecs.utk.edu/pulsar/ Copyright (C) 2012-2013 University of Tennessee.

Definition in file prt_assert.h.

Macro Definition Documentation

#define prt_assert (   cond,
  msg 
)    prt_assert_line_file(cond, msg, __LINE__, __FILE__)

Definition at line 30 of file prt_assert.h.

#define prt_error (   msg)    prt_error_line_file(msg, __LINE__, __FILE__)

Definition at line 24 of file prt_assert.h.

#define prt_warning (   msg)    prt_warning_line_file(msg, __LINE__, __FILE__)

Definition at line 27 of file prt_assert.h.

Function Documentation

void prt_assert_line_file ( int  cond,
char *  msg,
int  line,
char *  file 
)

Check an assertion and exit on error. Print an error message.

Parameters
condcondition
msgerror message
lineline number
filesource file name

Definition at line 23 of file prt_assert.c.

References prt_error_line_file().

24 {
25  if (!cond)
26  prt_error_line_file(msg, line, file);
27 }
void prt_error_line_file(char *msg, int line, char *file)
Print an error message and exit.
Definition: prt_assert.c:37

Here is the call graph for this function:

void prt_error_line_file ( char *  msg,
int  line,
char *  file 
)

Print an error message and exit.

Parameters
msgerror message
lineline number
filesource file name

Definition at line 37 of file prt_assert.c.

38 {
39  fprintf(stderr, "\nPRT ERROR: %s (in %s at line %d)\n\n", msg, file, line);
40  fflush(stderr);
41  MPI_Abort(MPI_COMM_WORLD, 0);
42 }

Here is the caller graph for this function:

void prt_warning_line_file ( char *  msg,
int  line,
char *  file 
)

Print a warning and continue.

Parameters
msgwarning message
lineline number
filesource file name

Definition at line 52 of file prt_assert.c.

53 {
54  fprintf(stderr, "\nPRT WARNING: %s (in %s at line %d)\n\n", msg, file, line);
55  fflush(stderr);
56 }