浏览代码

Make sure early that the user didn't specify bogus memory nodes

Samuel Thibault 7 年之前
父节点
当前提交
e2265406f9
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/core/task.c

+ 3 - 0
src/core/task.c

@@ -585,10 +585,13 @@ static int _starpu_task_submit_head(struct starpu_task *task)
 		{
 			starpu_data_handle_t handle = STARPU_TASK_GET_HANDLE(task, i);
 			enum starpu_data_access_mode mode = STARPU_TASK_GET_MODE(task, i);
+			int node = task->cl->specific_nodes ? STARPU_CODELET_GET_NODE(task->cl, i) : -1;
 			/* Make sure handles are valid */
 			STARPU_ASSERT_MSG(handle->magic == _STARPU_TASK_MAGIC, "data %p is invalid (was it already unregistered?)", handle);
 			/* Make sure handles are not partitioned */
 			STARPU_ASSERT_MSG(handle->nchildren == 0, "only unpartitioned data (or the pieces of a partitioned data) can be used in a task");
+			/* Make sure the specified node exists */
+			STARPU_ASSERT_MSG(node == -1 || (node >= 0 && node < starpu_memory_nodes_get_count()), "The codelet-specified memory node does not exist");
 			/* Provide the home interface for now if any,
 			 * for can_execute hooks */
 			if (handle->home_node != -1)