Browse Source

task_submit: always call starpu_perfmodel_init when a power_model is defined, this ensures power_model->state will be allocated

Nathalie Furmento 11 years ago
parent
commit
b075e113b1
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/core/task.c

+ 6 - 2
src/core/task.c

@@ -492,8 +492,12 @@ int starpu_task_submit(struct starpu_task *task)
 				_starpu_load_perfmodel(task->cl->model);
 		}
 
-		if (task->cl->power_model && task->cl->power_model->symbol)
-			_starpu_load_perfmodel(task->cl->power_model);
+		if (task->cl->power_model)
+		{
+			starpu_perfmodel_init(NULL, task->cl->power_model);
+			if (task->cl->power_model->symbol)
+				_starpu_load_perfmodel(task->cl->power_model);
+		}
 	}
 
 	if (bundle)