浏览代码

src/core/perfmodel/perfmodel_history.c: only append hostname if the symbol does not contain a dot character (very likely followed by a hostname)

Nathalie Furmento 11 年之前
父节点
当前提交
60c728d51e
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      src/core/perfmodel/perfmodel_history.c

+ 8 - 4
src/core/perfmodel/perfmodel_history.c

@@ -814,10 +814,14 @@ static void get_model_path(struct starpu_perfmodel *model, char *path, size_t ma
 	_starpu_get_perf_model_dir_codelets(path, maxlen);
 	strncat(path, model->symbol, maxlen);
 
-	char hostname[65];
-	_starpu_gethostname(hostname, sizeof(hostname));
-	strncat(path, ".", maxlen);
-	strncat(path, hostname, maxlen);
+	const char *dot = strrchr(model->symbol, '.');
+	if (dot == NULL)
+	{
+		char hostname[65];
+		_starpu_gethostname(hostname, sizeof(hostname));
+		strncat(path, ".", maxlen);
+		strncat(path, hostname, maxlen);
+	}
 }
 
 static void save_history_based_model(struct starpu_perfmodel *model)