瀏覽代碼

Drop 'do_not_increment_nsubmitted' parameter of _starpu_submit_job: simply decrement after task regeneration

Samuel Thibault 13 年之前
父節點
當前提交
de31919c9c
共有 3 個文件被更改,包括 7 次插入10 次删除
  1. 2 4
      src/core/jobs.c
  2. 3 4
      src/core/task.c
  3. 2 2
      src/core/task.h

+ 2 - 4
src/core/jobs.c

@@ -228,12 +228,10 @@ void _starpu_handle_job_termination(starpu_job_t j, unsigned job_is_already_lock
 		STARPU_ASSERT(detach && !destroy && !task->synchronous);
 
 		/* We reuse the same job structure */
-		int ret = _starpu_submit_job(j, 1);
+		int ret = _starpu_submit_job(j);
 		STARPU_ASSERT(!ret);
-	}	
-	else {
-		_starpu_decrement_nsubmitted_tasks();
 	}
+	_starpu_decrement_nsubmitted_tasks();
 }
 
 /* This function is called when a new task is submitted to StarPU 

+ 3 - 4
src/core/task.c

@@ -197,7 +197,7 @@ starpu_job_t _starpu_get_job_associated_to_task(struct starpu_task *task)
 
 /* NB in case we have a regenerable task, it is possible that the job was
  * already counted. */
-int _starpu_submit_job(starpu_job_t j, unsigned do_not_increment_nsubmitted)
+int _starpu_submit_job(starpu_job_t j)
 {
         _STARPU_LOG_IN();
 	/* notify bound computation of a new task */
@@ -205,8 +205,7 @@ int _starpu_submit_job(starpu_job_t j, unsigned do_not_increment_nsubmitted)
 
 	j->terminated = 0;
 
-	if (!do_not_increment_nsubmitted)
-		_starpu_increment_nsubmitted_tasks();
+	_starpu_increment_nsubmitted_tasks();
 
 	PTHREAD_MUTEX_LOCK(&j->sync_mutex);
 	
@@ -297,7 +296,7 @@ int starpu_task_submit(struct starpu_task *task)
 	* allocated, for instance to enforce task depenencies. */
 	starpu_job_t j = _starpu_get_job_associated_to_task(task);
 
-	ret = _starpu_submit_job(j, 0);
+	ret = _starpu_submit_job(j);
 
 	if (is_sync)
 		_starpu_wait_job(j);

+ 2 - 2
src/core/task.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
  * Copyright (C) 2010  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -34,7 +34,7 @@ void _starpu_set_current_task(struct starpu_task *task);
 
 /* NB the second argument makes it possible to count regenerable tasks only
  * once. */
-int _starpu_submit_job(starpu_job_t j, unsigned do_not_increment_nsubmitted);
+int _starpu_submit_job(starpu_job_t j);
 
 /* Returns the job structure (which is the internal data structure associated
  * to a task). */