SIONlib  1.7.4
Scalable I/O library for parallel access to task-local files
Macros | Functions
sion_debug.c File Reference

Debugging output. More...

#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "sion_lock.h"
#include "sion_debug.h"
#include "sion_internal.h"
Include dependency graph for sion_debug.c:

Go to the source code of this file.

Macros

#define _XOPEN_SOURCE   700
 
#define SIONDEBFUNCNAMELEN   50
 
#define MAXOMPTHREADS   300
 
#define _DEBUG_INIT_THREAD
 

Functions

int _sion_get_thread_num_default (void)
 
int _sion_debug_set_query_thread_num_function (int(*get_thread_num)(void))
 
int sion_dprintf (int mask, const char *format,...)
 Print debugging info formating the message like printf. More...
 
int sion_dprintfp (int mask, const char *callfunction, int rank, const char *format,...)
 Print debugging info formating the message like printf and including the name of the calling function. More...
 
FILE * sion_get_dfile (void)
 
void sion_dclose (void)
 
int sion_isdebug (void)
 
void sion_debug_on (int mask, const char *filename)
 sets debug mode. More...
 
void sion_debug_off (void)
 
int _sion_debug_init (void)
 initialize the debug environment More...
 

Detailed Description

Debugging output.

Author
Th.Eickermann & W.Frings (January 2001)

Print debugging info according to the following environment variables:

The value for the mask can be calculated by adding the following values:

Definition in file sion_debug.c.

Macro Definition Documentation

◆ _DEBUG_INIT_THREAD

#define _DEBUG_INIT_THREAD
Value:
int threadid=0; \
threadid = _sion_my_get_thread_num(); \
if(threadid>MAXOMPTHREADS) threadid=(MAXOMPTHREADS-1);

Definition at line 156 of file sion_debug.c.

Function Documentation

◆ _sion_debug_init()

int _sion_debug_init ( void  )

initialize the debug environment

evaluate the debug environment variables set _sion_debug_isdebug and out

Definition at line 371 of file sion_debug.c.

◆ sion_dclose()

void sion_dclose ( void  )

close the debug-file

Definition at line 289 of file sion_debug.c.

◆ sion_debug_on()

void sion_debug_on ( int  mask,
const char *  filename 
)

sets debug mode.

Parameters
maskdebug mask
filenameif not NULL, output file for debug output (default is stderr)

Definition at line 315 of file sion_debug.c.

◆ sion_dprintf()

int sion_dprintf ( int  mask,
const char *  format,
  ... 
)

Print debugging info formating the message like printf.

Definition at line 179 of file sion_debug.c.

◆ sion_dprintfp()

int sion_dprintfp ( int  mask,
const char *  callfunction,
int  rank,
const char *  format,
  ... 
)

Print debugging info formating the message like printf and including the name of the calling function.

Definition at line 205 of file sion_debug.c.

◆ sion_get_dfile()

FILE* sion_get_dfile ( void  )

return the file pointer of the debug file

Definition at line 277 of file sion_debug.c.