ASCOT5
|
Error module for ASCOT5. More...
Go to the source code of this file.
Functions | |
void | error_parse (a5err err, int *msg, int *line, int *file) |
Retrieve stored data from the error flag. | |
void | error_parse2str (a5err err, char *msg, char *line, char *file) |
Convert error flag in string format. | |
Error module for ASCOT5.
This modules handles marker simulation time errors, i.e., errors that arise when a marker is being simulated and which do not lead to termination of the whole program, just to the termination of that marker.
Error flag is stored in particle_state struct and care should be taken that no error flag overwriting occurs by ceasing the simulation of that marker. Error flag is represented by a5err which is a 64 bit integer. Zero means no error. When error occurs, an error is raised with error_raise() which uses a5err to store the following data as follows:
Whenever adding a new error type, include that type to error_type enum. These types should be generic as line and file are enough to locate what exactly went wrong. Then add description of that error type to error_parse2str().
Whenever adding a new file where error can arise, add that file to error_file enum and write the file name to error_parse2str().
Definition in file error.c.
void error_parse | ( | a5err | err, |
int * | msg, | ||
int * | line, | ||
int * | file ) |
Retrieve stored data from the error flag.
The values of type and file corresponds to the ones that were in error_type and error_file enums that were used when error was thrown with error_raise().
This function is host only.
err | the error flag |
msg | pointer for storing type of the error |
line | pointer for storing the line where error originated from |
file | pointer for storing the file where error originated from |
void error_parse2str | ( | a5err | err, |
char * | msg, | ||
char * | line, | ||
char * | file ) |