瀏覽代碼

Rename STARPU_TASK_INVALID to STARPU_TASK_INIT

Having a task in that state is completely normal, so better not scare the
user.
Samuel Thibault 4 年之前
父節點
當前提交
8efb1173b0
共有 4 個文件被更改,包括 12 次插入11 次删除
  1. 4 3
      include/starpu_task.h
  2. 6 6
      src/core/task.c
  3. 1 1
      src/core/task_bundle.c
  4. 1 1
      tools/gdbinit

+ 4 - 3
include/starpu_task.h

@@ -144,8 +144,9 @@ enum starpu_codelet_type
 
 enum starpu_task_status
 {
-	STARPU_TASK_INVALID,     /**< The task has just been initialized. */
-#define STARPU_TASK_INVALID 0
+	STARPU_TASK_INIT,        /**< The task has just been initialized. */
+#define STARPU_TASK_INIT 0
+#define STARPU_TASK_INVALID STARPU_TASK_INIT  /**< old name for STARPU_TASK_INIT */
 	STARPU_TASK_BLOCKED,     /**< The task has just been
 				    submitted, and its dependencies has not been checked yet. */
 	STARPU_TASK_READY,       /**< The task is ready for execution. */
@@ -1245,7 +1246,7 @@ struct starpu_task
 	.detach = 1,					\
 	.destroy = 0,					\
 	.regenerate = 0,				\
-	.status = STARPU_TASK_INVALID,			\
+	.status = STARPU_TASK_INIT,			\
 	.profiling_info = NULL,				\
 	.predicted = NAN,				\
 	.predicted_transfer = NAN,			\

+ 6 - 6
src/core/task.c

@@ -288,8 +288,8 @@ void starpu_task_init(struct starpu_task *task)
 
 	task->detach = 1;
 
-#if STARPU_TASK_INVALID != 0
-	task->status = STARPU_TASK_INVALID;
+#if STARPU_TASK_INIT != 0
+	task->status = STARPU_TASK_INIT;
 #endif
 
 	task->predicted = NAN;
@@ -737,9 +737,9 @@ static int _starpu_task_submit_head(struct starpu_task *task)
 	struct _starpu_job *j = _starpu_get_job_associated_to_task(task);
 
 	if (task->status == STARPU_TASK_STOPPED || task->status == STARPU_TASK_FINISHED)
-		task->status = STARPU_TASK_INVALID;
+		task->status = STARPU_TASK_INIT;
 	else
-		STARPU_ASSERT(task->status == STARPU_TASK_INVALID);
+		STARPU_ASSERT(task->status == STARPU_TASK_INIT);
 
 	if (j->internal)
 	{
@@ -1038,7 +1038,7 @@ int _starpu_task_submit_conversion_task(struct starpu_task *task,
 	_starpu_increment_nready_tasks_of_sched_ctx(j->task->sched_ctx, j->task->flops, j->task);
 	_starpu_job_set_ordered_buffers(j);
 
-	STARPU_ASSERT(task->status == STARPU_TASK_INVALID);
+	STARPU_ASSERT(task->status == STARPU_TASK_INIT);
 	task->status = STARPU_TASK_READY;
 	_starpu_profiling_set_task_push_start_time(task);
 
@@ -1639,7 +1639,7 @@ struct starpu_task *starpu_task_ft_create_retry
 	new_task->failed = 0;
 	new_task->scheduled = 0;
 	new_task->prefetched = 0;
-	new_task->status = STARPU_TASK_INVALID;
+	new_task->status = STARPU_TASK_INIT;
 	new_task->profiling_info = NULL;
 	new_task->prev = NULL;
 	new_task->next = NULL;

+ 1 - 1
src/core/task_bundle.c

@@ -50,7 +50,7 @@ int starpu_task_bundle_insert(starpu_task_bundle_t bundle, struct starpu_task *t
 		return -EPERM;
 	}
 
-	if (task->status != STARPU_TASK_INVALID)
+	if (task->status != STARPU_TASK_INIT)
 	{
 		/* The task has already been submitted, it's too late to put it
 		 * into a bundle now. */

+ 1 - 1
tools/gdbinit

@@ -40,7 +40,7 @@ define starpu-print-task
   set $job = (struct _starpu_job *)$task->starpu_private
   set $status=0
   if $task->status == 0
-    set $status="STARPU_TASK_INVALID"
+    set $status="STARPU_TASK_INIT"
   end
   if $task->status == 1
     set $status="STARPU_TASK_BLOCKED"