Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
5c519908
Commit
5c519908
authored
Dec 19, 2017
by
Peter W. Draper
Browse files
Add a SWIFT_DEVELOP_MODE flag to enable development code options
Just uses abort() instead of exit() in non-MPI code
parent
a96e0f2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
5c519908
...
...
@@ -41,6 +41,12 @@ AX_CHECK_ENABLE_DEBUG
AC_PROG_CC
AM_PROG_CC_C_O
# If debug is selected then we also define SWIFT_DEVELOP_MODE to control
# and developer code options.
if test "x$ax_enable_debug" != "xno"; then
AC_DEFINE([SWIFT_DEVELOP_MODE],1,[Enable developer code options])
fi
# Enable POSIX and platform extension preprocessor macros.
AC_USE_SYSTEM_EXTENSIONS
...
...
src/error.h
View file @
5c519908
...
...
@@ -36,6 +36,12 @@
/* Local headers. */
#include
"clocks.h"
#ifdef SWIFT_DEVELOP_MODE
#define swift_abort(errcode) abort()
#else
#define swift_abort(errcode) exit(errcode)
#endif
/**
* @brief Error macro. Prints the message given in argument and aborts.
*
...
...
@@ -54,7 +60,7 @@ extern int engine_rank;
({ \
fprintf(stderr, "%s %s:%s():%i: " s "\n", clocks_get_timesincestart(), \
__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
abort();
\
swift_
abort(
1
); \
})
#endif
...
...
@@ -130,7 +136,7 @@ extern int engine_rank;
fprintf(stderr, "%s %s:%s():%i: FAILED ASSERTION: " #expr " \n", \
clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__); \
fflush(stderr); \
abort();
\
swift_
abort(
1
); \
} \
})
#endif
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment