CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
#include <exception>
#include "common/core/CepsFlags.hpp"
#include "common/core/CepsTypes.hpp"
#include "common/core/CepsParallelTools.hpp"
#include "common/core/CepsException.hpp"
Go to the source code of this file.
Macros | |
#define | NOARG |
Dummy macro. More... | |
#define | CEPS_IO_DECIMAL_PRECISION 8 |
Length of floats on std outputs and log files. More... | |
#define | CEPS_WARNING "WARNING" |
CepsString used as message for warnings. More... | |
#define | CEPS_ERROR "FATAL ERROR" |
CepsString used as message for errors. More... | |
#define | CEPS_COLORED_WARNING "\033[1m\033[34mWARNING\033[0m" |
CepsString used as colored message for warnings. More... | |
#define | CEPS_COLORED_ERROR "\033[1m\033[31mFATAL_ERROR\033[0m" |
CepsString used as colored message for errors. More... | |
#define | CEPS_SEPARATOR_LENGTH 77 |
#define | CEPS_STRING_SEPARATOR std::string (CEPS_SEPARATOR_LENGTH, '-') |
CepsString used as separator. More... | |
#define | CEPS_SEPARATOR CEPS_SAYS (CEPS_STRING_SEPARATOR) |
Writes a separator in the debug log and in the terminal. More... | |
#define | CEPS_SAYS_IN_PROGRESS(message) |
Writes a message in the debug log and in the terminal (stdio) without carriage return. More... | |
#define | CEPS_SAYS(message) |
Writes a message in the debug log and in the terminal (stdio). More... | |
#define | CEPS_SAYS_IN_GREEN(message) |
Writes a message in the debug log and in the terminal with color (stdio). More... | |
#define | CEPS_SAYS_NOENDL(message) |
Writes a message in the debug log and in the terminal (stdio). More... | |
#define | CEPS_SAYS_INLINE(message) |
Writes a message in the debug log and in the terminal (stdio). More... | |
#define | CEPS_SAYS_IF(condition, message) |
If condition is true, writes a message in the debug log and in the terminal (stdio) More... | |
#define | CEPS_WARNS(message) |
Writes a warning in the debug log and in the terminal (stderr). More... | |
#define | CEPS_WARNS_IF(condition, message) |
If condition is true, writes a warning in the debug log and in the terminal (stderr). More... | |
#define | CEPS_ABORT(message) |
Stops the execution with a message. If testing is enabled, only throws a runtime_error. More... | |
#define | CEPS_ABORT_IF(condition, message) |
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime_error. More... | |
#define | CEPS_CHECK_IS_NAN(value, message) |
Check if a value is nan or inf. More... | |
#define | CEPS_DVAL_1(_0, ...) "\"" << #_0 << "\" : " << _0 |
Displays the name and content of 1 variable. More... | |
#define | CEPS_DVAL_2(_0, ...) CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_1(__VA_ARGS__) |
Displays the name and content of 2 variables. More... | |
#define | CEPS_DVAL_3(_0, ...) CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_2(__VA_ARGS__) |
Displays the name and content of 3 variables. More... | |
#define | CEPS_DVAL_4(_0, ...) CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_3(__VA_ARGS__) |
Displays the name and content of 4 variables. More... | |
#define | CEPS_DVAL_5(_0, ...) CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_4(__VA_ARGS__) |
Displays the name and content of 5 variables. More... | |
#define | CEPS_DVAL_6(_0, ...) CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_5(__VA_ARGS__) |
Displays the name and content of 6 variables. More... | |
#define | CEPS_DVAL_7(_0, ...) CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_6(__VA_ARGS__) |
Displays the name and content of 7 variables. More... | |
#define | CEPS_DVAL_8(_0, ...) CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_7(__VA_ARGS__) |
Displays the name and content of 8 variables. More... | |
#define | CEPS_DVAL_9(_0, ...) CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_8(__VA_ARGS__) |
Displays the name and content of 9 variables. More... | |
#define | VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N |
Keeps the 12-th argument. More... | |
#define | VA_NARGS(...) VA_NARGS_IMPL(_, ##__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) |
Returns the number of arguments in the macro. More... | |
#define | CEPS_CONCAT_2(x, y) x##y |
Writes two strings next to each other in the code. We need this second CONCAT macro in case the arguments are also macros to be expanded. More... | |
#define | CEPS_CONCAT(x, y) CEPS_CONCAT_2(x, y) |
Writes two strings next to each other in the code. More... | |
#define | CEPS_DVAL_CALL(N, ...) CEPS_CONCAT(CEPS_DVAL_, N) (__VA_ARGS__) |
Selects which CEPS_DVAL_N to call. More... | |
#define | CEPS_DISPLAY_VAL(...) CEPS_DVAL_CALL(VA_NARGS (__VA_ARGS__), __VA_ARGS__) |
Generates a string with the names and values of the arguments of the macro, supports up to ten arguments. More... | |
#define | DISP(...) std::cout << CEPS_DISPLAY_VAL(__VA_ARGS__) << std::endl |
Displays the names and values of the arguments of the macro supports up to ten arguments. More... | |
#define | DISPR(...) std::cout << "proc" << ceps::getRank() << " " << CEPS_DISPLAY_VAL(__VA_ARGS__) << std::endl |
Displays the names and values of the arguments of the macro preceeded by rank supports up to ten arguments. More... | |
#define | SEQDISP(...) |
Sequential disp. Careful not to use this in a if(master) block... supports up to ten arguments. More... | |
#define | CEPS_UNIMPLEMENTED static_assert (true, "unimplemented function") |
#define | CEPS_UNUSED(X) (void) X |
A collection of functions and macros that controls the output of standard, warning, and error messages
Definition in file CepsIoMacros.hpp.
#define CEPS_ABORT | ( | message | ) |
Stops the execution with a message. If testing is enabled, only throws a runtime_error.
Definition at line 264 of file CepsIoMacros.hpp.
#define CEPS_ABORT_IF | ( | condition, | |
message | |||
) |
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime_error.
Definition at line 275 of file CepsIoMacros.hpp.
#define CEPS_CHECK_IS_NAN | ( | value, | |
message | |||
) |
Check if a value is nan or inf.
Definition at line 289 of file CepsIoMacros.hpp.
#define CEPS_COLORED_ERROR "\033[1m\033[31mFATAL_ERROR\033[0m" |
CepsString used as colored message for errors.
Definition at line 70 of file CepsIoMacros.hpp.
#define CEPS_COLORED_WARNING "\033[1m\033[34mWARNING\033[0m" |
CepsString used as colored message for warnings.
Definition at line 65 of file CepsIoMacros.hpp.
#define CEPS_CONCAT | ( | x, | |
y | |||
) | CEPS_CONCAT_2(x, y) |
Writes two strings next to each other in the code.
Definition at line 370 of file CepsIoMacros.hpp.
#define CEPS_CONCAT_2 | ( | x, | |
y | |||
) | x##y |
Writes two strings next to each other in the code. We need this second CONCAT macro in case the arguments are also macros to be expanded.
Definition at line 365 of file CepsIoMacros.hpp.
#define CEPS_DISPLAY_VAL | ( | ... | ) | CEPS_DVAL_CALL(VA_NARGS (__VA_ARGS__), __VA_ARGS__) |
Generates a string with the names and values of the arguments of the macro, supports up to ten arguments.
Definition at line 381 of file CepsIoMacros.hpp.
#define CEPS_DVAL_1 | ( | _0, | |
... | |||
) | "\"" << #_0 << "\" : " << _0 |
Displays the name and content of 1 variable.
Definition at line 308 of file CepsIoMacros.hpp.
#define CEPS_DVAL_2 | ( | _0, | |
... | |||
) | CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_1(__VA_ARGS__) |
Displays the name and content of 2 variables.
Definition at line 313 of file CepsIoMacros.hpp.
#define CEPS_DVAL_3 | ( | _0, | |
... | |||
) | CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_2(__VA_ARGS__) |
Displays the name and content of 3 variables.
Definition at line 318 of file CepsIoMacros.hpp.
#define CEPS_DVAL_4 | ( | _0, | |
... | |||
) | CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_3(__VA_ARGS__) |
Displays the name and content of 4 variables.
Definition at line 323 of file CepsIoMacros.hpp.
#define CEPS_DVAL_5 | ( | _0, | |
... | |||
) | CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_4(__VA_ARGS__) |
Displays the name and content of 5 variables.
Definition at line 328 of file CepsIoMacros.hpp.
#define CEPS_DVAL_6 | ( | _0, | |
... | |||
) | CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_5(__VA_ARGS__) |
Displays the name and content of 6 variables.
Definition at line 333 of file CepsIoMacros.hpp.
#define CEPS_DVAL_7 | ( | _0, | |
... | |||
) | CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_6(__VA_ARGS__) |
Displays the name and content of 7 variables.
Definition at line 338 of file CepsIoMacros.hpp.
#define CEPS_DVAL_8 | ( | _0, | |
... | |||
) | CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_7(__VA_ARGS__) |
Displays the name and content of 8 variables.
Definition at line 343 of file CepsIoMacros.hpp.
#define CEPS_DVAL_9 | ( | _0, | |
... | |||
) | CEPS_DVAL_1 (_0) << ", " << CEPS_DVAL_8(__VA_ARGS__) |
Displays the name and content of 9 variables.
Definition at line 348 of file CepsIoMacros.hpp.
#define CEPS_DVAL_CALL | ( | N, | |
... | |||
) | CEPS_CONCAT(CEPS_DVAL_, N) (__VA_ARGS__) |
Selects which CEPS_DVAL_N to call.
Definition at line 375 of file CepsIoMacros.hpp.
#define CEPS_ERROR "FATAL ERROR" |
CepsString used as message for errors.
Definition at line 60 of file CepsIoMacros.hpp.
#define CEPS_IO_DECIMAL_PRECISION 8 |
Length of floats on std outputs and log files.
Definition at line 49 of file CepsIoMacros.hpp.
#define CEPS_SAYS | ( | message | ) |
Writes a message in the debug log and in the terminal (stdio).
Definition at line 108 of file CepsIoMacros.hpp.
#define CEPS_SAYS_IF | ( | condition, | |
message | |||
) |
If condition is true, writes a message in the debug log and in the terminal (stdio)
Definition at line 177 of file CepsIoMacros.hpp.
#define CEPS_SAYS_IN_GREEN | ( | message | ) |
Writes a message in the debug log and in the terminal with color (stdio).
Definition at line 124 of file CepsIoMacros.hpp.
#define CEPS_SAYS_IN_PROGRESS | ( | message | ) |
Writes a message in the debug log and in the terminal (stdio) without carriage return.
Definition at line 91 of file CepsIoMacros.hpp.
#define CEPS_SAYS_INLINE | ( | message | ) |
Writes a message in the debug log and in the terminal (stdio).
Definition at line 160 of file CepsIoMacros.hpp.
#define CEPS_SAYS_NOENDL | ( | message | ) |
Writes a message in the debug log and in the terminal (stdio).
Definition at line 142 of file CepsIoMacros.hpp.
#define CEPS_SEPARATOR CEPS_SAYS (CEPS_STRING_SEPARATOR) |
Writes a separator in the debug log and in the terminal.
Definition at line 85 of file CepsIoMacros.hpp.
#define CEPS_SEPARATOR_LENGTH 77 |
Definition at line 75 of file CepsIoMacros.hpp.
#define CEPS_STRING_SEPARATOR std::string (CEPS_SEPARATOR_LENGTH, '-') |
CepsString used as separator.
Definition at line 80 of file CepsIoMacros.hpp.
#define CEPS_UNIMPLEMENTED static_assert (true, "unimplemented function") |
Definition at line 408 of file CepsIoMacros.hpp.
#define CEPS_UNUSED | ( | X | ) | (void) X |
Definition at line 410 of file CepsIoMacros.hpp.
#define CEPS_WARNING "WARNING" |
CepsString used as message for warnings.
Definition at line 55 of file CepsIoMacros.hpp.
#define CEPS_WARNS | ( | message | ) |
Writes a warning in the debug log and in the terminal (stderr).
Definition at line 226 of file CepsIoMacros.hpp.
#define CEPS_WARNS_IF | ( | condition, | |
message | |||
) |
If condition is true, writes a warning in the debug log and in the terminal (stderr).
Definition at line 243 of file CepsIoMacros.hpp.
#define DISP | ( | ... | ) | std::cout << CEPS_DISPLAY_VAL(__VA_ARGS__) << std::endl |
Displays the names and values of the arguments of the macro supports up to ten arguments.
Definition at line 387 of file CepsIoMacros.hpp.
#define DISPR | ( | ... | ) | std::cout << "proc" << ceps::getRank() << " " << CEPS_DISPLAY_VAL(__VA_ARGS__) << std::endl |
Displays the names and values of the arguments of the macro preceeded by rank supports up to ten arguments.
Definition at line 395 of file CepsIoMacros.hpp.
#define NOARG |
Dummy macro.
Definition at line 43 of file CepsIoMacros.hpp.
#define SEQDISP | ( | ... | ) |
Sequential disp. Careful not to use this in a if(master) block... supports up to ten arguments.
Definition at line 402 of file CepsIoMacros.hpp.
#define VA_NARGS | ( | ... | ) | VA_NARGS_IMPL(_, ##__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) |
Returns the number of arguments in the macro.
Definition at line 358 of file CepsIoMacros.hpp.
#define VA_NARGS_IMPL | ( | _0, | |
_1, | |||
_2, | |||
_3, | |||
_4, | |||
_5, | |||
_6, | |||
_7, | |||
_8, | |||
_9, | |||
_10, | |||
N, | |||
... | |||
) | N |
Keeps the 12-th argument.
Definition at line 353 of file CepsIoMacros.hpp.