Sfoglia il codice sorgente

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

Nathalie Furmento 10 anni fa
parent
commit
66d8d4b640
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  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;
 		}