浏览代码

src/core/perfmodel/perfmodel_history.c: fix call to _starpu_perfmodel_realloc(), thanks Terry for pointing out the bug

Nathalie Furmento 10 年之前
父节点
当前提交
66d8d4b640
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/core/perfmodel/perfmodel_history.c

+ 3 - 2
src/core/perfmodel/perfmodel_history.c

@@ -1284,8 +1284,9 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 		{
 			if (model->state->ncombs + 1 >= model->state->ncombs_set)
 			{
-				// The number of combinations is bigger than the one which was initially allocated, we need to reallocate
-				_starpu_perfmodel_realloc(model, nb_arch_combs);
+				// The number of combinations is bigger than the one which was initially allocated, we need to reallocate,
+				// do not only reallocate 1 extra comb, rather reallocate 5 to avoid too frequent calls to _starpu_perfmodel_realloc
+				_starpu_perfmodel_realloc(model, model->state->ncombs_set+5);
 			}
 			model->state->combs[model->state->ncombs++] = comb;
 		}