The FARGO_THORIN code developer's guide
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Macros
fpe.c
Go to the documentation of this file.
1
/** \file fpe.c
2
3
Contains two functions that specify how we handle floating point exceptions.
4
*/
5
6
#include "
fargo.h
"
7
8
void
handfpe
() {
9
fprintf (stdout,
"CPU #%d has been signaled with a floating point exception.\n"
,
10
CPU_Rank
);
11
fprintf (stdout,
"Run is aborted.\n"
);
12
prs_exit
(1);
13
}
14
15
void
setfpe
() {
16
#ifdef _TRAP_FPE
17
feenableexcept (FE_DIVBYZERO | FE_INVALID);
18
/* Can also be any of the value below:
19
FE_INEXACT inexact result
20
FE_DIVBYZERO division by zero
21
FE_UNDERFLOW result not representable due to underflow
22
FE_OVERFLOW result not representable due to overflow
23
FE_INVALID invalid operation
24
FE_ALL_EXCEPT bitwise OR of all supported exceptions
25
*/
26
signal (SIGFPE,
handfpe
);
27
#endif
28
}
29
handfpe
void handfpe()
Definition:
fpe.c:8
setfpe
void setfpe()
Definition:
fpe.c:15
fargo.h
Contains all the include directives requested by the code.
CPU_Rank
int CPU_Rank
Definition:
global.h:1
prs_exit
void prs_exit(int numb)
Definition:
LowTasks.c:33
Generated on Thu Jul 6 2017 10:19:42 for The FARGO_THORIN code developer's guide by
1.8.7