Kaynağa Gözat

permit to directly use names with hostname, as reported by starpu_perfmodel_display -l

Samuel Thibault 14 yıl önce
ebeveyn
işleme
e0f91f7d0c
1 değiştirilmiş dosya ile 10 ekleme ve 1 silme
  1. 10 1
      src/core/perfmodel/perfmodel_history.c

+ 10 - 1
src/core/perfmodel/perfmodel_history.c

@@ -519,7 +519,7 @@ int starpu_list_models(void)
  * performance model files */
 int starpu_load_history_debug(const char *symbol, struct starpu_perfmodel_t *model)
 {
-	model->symbol = symbol;
+	model->symbol = strdup(symbol);
 
 	/* where is the file if it exists ? */
 	char path[256];
@@ -531,6 +531,15 @@ int starpu_load_history_debug(const char *symbol, struct starpu_perfmodel_t *mod
 	int res;
 	res = access(path, F_OK);
 	if (res) {
+		char *dot = rindex(symbol, '.');
+		if (dot) {
+			char *symbol2 = strndup(symbol, dot-symbol);
+			int ret;
+			fprintf(stderr,"note: loading history from %s instead of %s\n", symbol2, symbol);
+			ret = starpu_load_history_debug(symbol2,model);
+			free(symbol2);
+			return ret;
+		}
 		_STARPU_DISP("There is no performance model for symbol %s\n", symbol);
 		return 1;
 	}