Neko  0.9.0
A portable framework for high-order spectral element flow simulations
sighdl.c File Reference
#include <signal.h>
#include <stdint.h>
#include <time.h>
#include <sys/time.h>
Include dependency graph for sighdl.c:

Go to the source code of this file.

Macros

#define SIGHDL_XCPU   0x01
 
#define SIGHDL_ALRM   0x02
 
#define SIGHDL_USR1   0x01
 
#define SIGHDL_USR2   0x02
 

Functions

void sighdl (int sig_code)
 
int8_t sighdl_timeout ()
 
int8_t sighdl_usr ()
 
int sighdl_set_timeout (int *sec)
 
int sighdl_trap_cpulimit ()
 
int sighdl_trap_usr ()
 

Variables

volatile uint8_t TIMEOUT = 0
 
volatile uint8_t USR = 0
 

Macro Definition Documentation

◆ SIGHDL_ALRM

#define SIGHDL_ALRM   0x02

Definition at line 41 of file sighdl.c.

◆ SIGHDL_USR1

#define SIGHDL_USR1   0x01

Definition at line 43 of file sighdl.c.

◆ SIGHDL_USR2

#define SIGHDL_USR2   0x02

Definition at line 44 of file sighdl.c.

◆ SIGHDL_XCPU

#define SIGHDL_XCPU   0x01

Definition at line 40 of file sighdl.c.

Function Documentation

◆ sighdl()

void sighdl ( int  sig_code)

Generic signal handler

Definition at line 52 of file sighdl.c.

Here is the caller graph for this function:

◆ sighdl_set_timeout()

int sighdl_set_timeout ( int *  sec)

Set a timer

Definition at line 89 of file sighdl.c.

Here is the call graph for this function:

◆ sighdl_timeout()

int8_t sighdl_timeout ( )

Check if a timeout has occurred

Definition at line 74 of file sighdl.c.

◆ sighdl_trap_cpulimit()

int sighdl_trap_cpulimit ( )

Trap CPU time limit (SIGXCPU)

Definition at line 110 of file sighdl.c.

Here is the call graph for this function:

◆ sighdl_trap_usr()

int sighdl_trap_usr ( )

Trap user signals (SIGUSR1, SIGUSR2)

Definition at line 123 of file sighdl.c.

Here is the call graph for this function:

◆ sighdl_usr()

int8_t sighdl_usr ( )

Check if a user signal has been raised

Definition at line 81 of file sighdl.c.

Variable Documentation

◆ TIMEOUT

volatile uint8_t TIMEOUT = 0

Definition at line 46 of file sighdl.c.

◆ USR

volatile uint8_t USR = 0

Definition at line 47 of file sighdl.c.