瀏覽代碼

Do not load a perfmodel if its field symbol is not set

- src/core/task.c: check value of symbol before loading the model
- doc/chapters/basic-api.texi: document the feature
   (the field is already marked as mandatory when defining the
   structure starpu_perfmodel).
Nathalie Furmento 13 年之前
父節點
當前提交
5362831fe1
共有 2 個文件被更改,包括 8 次插入5 次删除
  1. 6 3
      doc/chapters/basic-api.texi
  2. 2 2
      src/core/task.c

+ 6 - 3
doc/chapters/basic-api.texi

@@ -1343,11 +1343,13 @@ option when configuring StarPU.
 
 @item @code{struct starpu_perfmodel *model} (optional)
 This is a pointer to the task duration performance model associated to this
-codelet. This optional field is ignored when set to @code{NULL}.
+codelet. This optional field is ignored when set to @code{NULL} or
+when its @code{symbol} field is not set.
 
 @item @code{struct starpu_perfmodel *power_model} (optional)
 This is a pointer to the task power consumption performance model associated
-to this codelet. This optional field is ignored when set to @code{NULL}.
+to this codelet. This optional field is ignored when set to
+@code{NULL} or when its @code{symbol} field is not set.
 In the case of parallel codelets, this has to account for all processing units
 involved in the parallel execution.
 
@@ -1825,7 +1827,8 @@ archs will be determined by multiplying by an arch-specific factor.
 
 @item @code{const char *symbol}
 is the symbol name for the performance model, which will be used as
-file name to store the model.
+file name to store the model. It must be set otherwise the model will
+be ignored.
 
 @item @code{double (*cost_model)(struct starpu_buffer_descr *)}
 This field is deprecated. Use instead the @code{cost_function} field.

+ 2 - 2
src/core/task.c

@@ -390,10 +390,10 @@ int starpu_task_submit(struct starpu_task *task)
 
 		_starpu_detect_implicit_data_deps(task);
 
-		if (task->cl->model)
+		if (task->cl->model && task->cl->model->symbol)
 			_starpu_load_perfmodel(task->cl->model);
 
-		if (task->cl->power_model)
+		if (task->cl->power_model && task->cl->power_model->symbol)
 			_starpu_load_perfmodel(task->cl->power_model);
 	}