89 #define MAX_MSG_SIZE 1024
90 #define MAX_STACK_SIZE 20
113 sprintf (buf,
"logFile");
116 if (argc && argv != NULL)
119 for (j = 1; j < argc; ++j)
121 if (strcmp (argv[j],
"-logFile") == 0)
125 sprintf (buf,
"%s", argv[j + 1]);
133 if (strcmp (buf,
"none"))
139 if ((
logFile = fopen (buf,
"w")) == NULL)
141 fprintf (stderr,
"can't open >%s< for writing; continuing anyway\n",
154 fprintf (stderr,
"Error closing logFile\n");
165 fprintf (
logFile,
"INFO: %s;\n function= %s file=%s line=%i\n",
166 msg,
function, file, line);
171 fprintf (stderr,
"INFO: %s;\n function= %s file=%s line=%i\n",
172 msg,
function, file, line);
186 "[%i] %s file= %s line= %i",
myid_dh,
function, file,
194 "_____________ dh_StartFunc: OVERFLOW _____________________\n");
198 "_____________ dh_StartFunc: OVERFLOW _____________________\n");
216 "_____________ dh_EndFunc: UNDERFLOW _____________________\n");
220 "_____________ dh_EndFunc: UNDERFLOW _____________________\n");
231 if (!strcmp (msg,
""))
234 "[%i] called from: %s file= %s line= %i",
235 myid_dh,
function, file, line);
240 "[%i] ERROR: %s\n %s file= %s line= %i\n",
241 myid_dh, msg,
function, file, line);
258 fprintf (fp,
"errFlag_dh is not set; nothing to print!\n");
265 "\n============= error stack trace ====================\n");
292 #define MAX_ERROR_SPACES 200
320 fprintf (stderr,
"%s(%i) %s [file= %s line= %i]\n",
325 fprintf (
logFile,
"%s(%i) %s [file= %s line= %i]\n",
347 #define __FUNC__ "EuclidIsInitialized"
355 #define __FUNC__ "EuclidInitialize"
374 if (parser_dh == NULL)
389 printf (
"%s\n\n", help);
409 #define __FUNC__ "EuclidFinalize"
418 if (parser_dh != NULL)
454 #define __FUNC__ "printf_dh"
461 va_start (args, fmt);
462 vsprintf (buf, fmt, args);
465 fprintf (stdout,
"%s", buf);
471 #define __FUNC__ "fprintf_dh"
478 va_start (args, fmt);
479 vsprintf (buf, fmt, args);
482 fprintf (fp,
"%s", buf);
489 #define __FUNC__ "echoInvocation_dh"
495 MPI_Comm_rank (comm, &
id);
507 for (i = 0; i < argc; ++i)
void Parser_dhCreate(Parser_dh *p)
void Mem_dhDestroy(Mem_dh m)
void TimeLog_dhCreate(TimeLog_dh *t)
static char calling_stack[MAX_STACK_SIZE][MAX_MSG_SIZE]
void openLogfile_dh(int argc, char *argv[])
void dh_StartFunc(char *function, char *file, int line, int priority)
void TimeLog_dhDestroy(TimeLog_dh t)
bool Parser_dhHasSwitch(Parser_dh p, char *s)
static int calling_stack_count
void printFunctionStack(FILE *fp)
void printf_dh(char *fmt,...)
static bool EuclidIsActive
void echoInvocation_dh(MPI_Comm comm, char *prefix, int argc, char *argv[])
void Parser_dhDestroy(Parser_dh p)
static char spaces[MAX_ERROR_SPACES]
void fprintf_dh(FILE *fp, char *fmt,...)
void Error_dhEndFunc(char *function)
static int errCount_private
void dh_EndFunc(char *function, int priority)
void EuclidInitialize(int argc, char *argv[], char *help)
void setInfo_dh(char *msg, char *function, char *file, int line)
void Parser_dhInit(Parser_dh p, int argc, char *argv[])
void printErrorMsg(FILE *fp)
void Mem_dhCreate(Mem_dh *m)
bool EuclidIsInitialized()
static char errMsg_private[MAX_STACK_SIZE][MAX_MSG_SIZE]
void Mem_dhPrint(Mem_dh m, FILE *fp, bool allPrint)
void Error_dhStartFunc(char *function, char *file, int line)
char msgBuf_dh[MSG_BUF_SIZE_DH]
void setError_dh(char *msg, char *function, char *file, int line)