瀏覽代碼

README.dev: add a section about error handling.

It explains the difference between STARPU_ABORT() and STARPU_ASSERT().
Cyril Roelandt 13 年之前
父節點
當前提交
9db5ddc0c2
共有 1 個文件被更改,包括 25 次插入0 次删除
  1. 25 0
      README.dev

+ 25 - 0
README.dev

@@ -20,6 +20,7 @@ Contents
 - Developer Warnings
 - Naming Conventions
 - Coding Style
+- Error handling
 
 Developer Warnings
 ------------------
@@ -51,3 +52,27 @@ Coding Style
 ------------
 
 * Curly braces always go on a new line
+
+
+
+Error handling
+--------------
+* Use STARPU_ABORT() for catastrophic errors, from which StarPU will never
+  recover.
+
+	switch (node_kind)
+	{
+		case STARPU_CPU_RAM:
+			do_stg();
+			break;
+		...
+		default:
+			/* We cannot be here */
+			STARPU_ABORT();
+	}
+
+* Use STARPU_ASSERT() to run checks that are very likely to succeed, but still
+  are useful for debugging purposes. It should be OK to disable them with
+  --enable-fast.
+
+	STARPU_ASSERT(j->terminated != 0)