|
@@ -29,6 +29,10 @@
|
|
|
#include <execinfo.h>
|
|
|
#endif
|
|
|
|
|
|
+#ifdef STARPU_SIMGRID_MC
|
|
|
+#include <simgrid/modelchecker.h>
|
|
|
+#endif
|
|
|
+
|
|
|
#ifdef __cplusplus
|
|
|
extern "C"
|
|
|
{
|
|
@@ -111,17 +115,23 @@ extern "C"
|
|
|
# define STARPU_DUMP_BACKTRACE() do { } while (0)
|
|
|
#endif
|
|
|
|
|
|
+#ifdef STARPU_SIMGRID_MC
|
|
|
+#define STARPU_SIMGRID_ASSERT(x) MC_assert(!!(x))
|
|
|
+#else
|
|
|
+#define STARPU_SIMGRID_ASSERT(x)
|
|
|
+#endif
|
|
|
+
|
|
|
#ifdef STARPU_NO_ASSERT
|
|
|
#define STARPU_ASSERT(x) do { if (0) { (void) (x); } } while(0)
|
|
|
#define STARPU_ASSERT_ACCESSIBLE(x) do { if (0) { (void) (x); } } while(0)
|
|
|
#define STARPU_ASSERT_MSG(x, msg, ...) do { if (0) { (void) (x); (void) msg; } } while(0)
|
|
|
#else
|
|
|
# if defined(__CUDACC__) || defined(STARPU_HAVE_WINDOWS)
|
|
|
-# define STARPU_ASSERT(x) do { if (STARPU_UNLIKELY(!(x))) { STARPU_DUMP_BACKTRACE(); *(int*)NULL = 0; } } while(0)
|
|
|
-# define STARPU_ASSERT_MSG(x, msg, ...) do { if (STARPU_UNLIKELY(!(x))) { STARPU_DUMP_BACKTRACE(); fprintf(stderr, "\n[starpu][%s][assert failure] " msg "\n\n", __starpu_func__, ## __VA_ARGS__); *(int*)NULL = 0; }} while(0)
|
|
|
+# define STARPU_ASSERT(x) do { if (STARPU_UNLIKELY(!(x))) { STARPU_DUMP_BACKTRACE(); STARPU_SIMGRID_ASSERT(x); *(int*)NULL = 0; } } while(0)
|
|
|
+# define STARPU_ASSERT_MSG(x, msg, ...) do { if (STARPU_UNLIKELY(!(x))) { STARPU_DUMP_BACKTRACE(); fprintf(stderr, "\n[starpu][%s][assert failure] " msg "\n\n", __starpu_func__, ## __VA_ARGS__); STARPU_SIMGRID_ASSERT(x); *(int*)NULL = 0; }} while(0)
|
|
|
# else
|
|
|
-# define STARPU_ASSERT(x) do { if (STARPU_UNLIKELY(!(x))) { STARPU_DUMP_BACKTRACE(); assert(x); } } while (0)
|
|
|
-# define STARPU_ASSERT_MSG(x, msg, ...) do { if (STARPU_UNLIKELY(!(x))) { STARPU_DUMP_BACKTRACE(); fprintf(stderr, "\n[starpu][%s][assert failure] " msg "\n\n", __starpu_func__, ## __VA_ARGS__); assert(x); } } while(0)
|
|
|
+# define STARPU_ASSERT(x) do { if (STARPU_UNLIKELY(!(x))) { STARPU_DUMP_BACKTRACE(); STARPU_SIMGRID_ASSERT(x); assert(x); } } while (0)
|
|
|
+# define STARPU_ASSERT_MSG(x, msg, ...) do { if (STARPU_UNLIKELY(!(x))) { STARPU_DUMP_BACKTRACE(); fprintf(stderr, "\n[starpu][%s][assert failure] " msg "\n\n", __starpu_func__, ## __VA_ARGS__); STARPU_SIMGRID_ASSERT(x); assert(x); } } while(0)
|
|
|
|
|
|
# endif
|
|
|
# define STARPU_ASSERT_ACCESSIBLE(ptr) do { \
|