Samuel Thibault лет назад: 14
Родитель
Сommit
4e1a48b0a2
1 измененных файлов с 17 добавлено и 9 удалено
  1. 17 9
      tools/starpu_perfmodel_display.c

+ 17 - 9
tools/starpu_perfmodel_display.c

@@ -111,10 +111,11 @@ static void display_history_based_perf_model(struct starpu_per_arch_perfmodel_t
 {
 	struct starpu_history_list_t *ptr;
 
-	if (!parameter)
+	ptr = per_arch_model->list;
+
+	if (!parameter && ptr)
 		fprintf(stderr, "# hash\t\tsize\t\tmean\t\tdev\t\tn\n");
 
-	ptr = per_arch_model->list;
 	while (ptr) {
 		struct starpu_history_entry_t *entry = ptr->entry;
 		if (!display_specific_footprint || (entry->footprint == specific_footprint))
@@ -145,12 +146,20 @@ static void display_history_based_perf_model(struct starpu_per_arch_perfmodel_t
 static void display_perf_model(struct starpu_perfmodel_t *model, enum starpu_perf_archtype arch)
 {
 	struct starpu_per_arch_perfmodel_t *arch_model = &model->per_arch[arch];
+	char archname[32];
+
+	if (arch_model->regression.nsample || arch_model->regression.valid || arch_model->regression.nl_valid || arch_model->list) {
+
+		starpu_perfmodel_get_arch_name(arch, archname, 32);
+		fprintf(stderr, "performance model for %s\n", archname);
+	}
 
 	if (parameter == NULL)
 	{
 		/* no specific parameter was requested, so we display everything */
-		fprintf(stderr, "\tRegression : #sample = %d\n",
-			arch_model->regression.nsample);
+		if (arch_model->regression.nsample)
+			fprintf(stderr, "\tRegression : #sample = %d\n",
+				arch_model->regression.nsample);
 
 		/* Only display the regression model if we could actually build a model */
 		if (arch_model->regression.valid)
@@ -160,7 +169,7 @@ static void display_perf_model(struct starpu_perfmodel_t *model, enum starpu_per
 			fprintf(stderr, "\t\tbeta = %le\n", arch_model->regression.beta);
 		}
 		else {
-			fprintf(stderr, "\tLinear model is INVALID\n");
+			//fprintf(stderr, "\tLinear model is INVALID\n");
 		}
 	
 		if (arch_model->regression.nl_valid)
@@ -171,14 +180,16 @@ static void display_perf_model(struct starpu_perfmodel_t *model, enum starpu_per
 			fprintf(stderr, "\t\tc = %le\n", arch_model->regression.c);
 		}
 		else {
-			fprintf(stderr, "\tNon-Linear model is INVALID\n");
+			//fprintf(stderr, "\tNon-Linear model is INVALID\n");
 		}
 
 		display_history_based_perf_model(arch_model);
 
+#if 0
 		char debugname[1024];
 		starpu_perfmodel_debugfilepath(model, arch, debugname, 1024);
 		printf("\t debug file path : %s\n", debugname);
+#endif
 	}
 	else {
 		/* only display the parameter that was specifically requested */
@@ -234,9 +245,6 @@ static void display_all_perf_models(struct starpu_perfmodel_t *model)
 		unsigned archid;
 		for (archid = 0; archid < STARPU_NARCH_VARIATIONS; archid++)
 		{
-			char archname[32];
-			starpu_perfmodel_get_arch_name(archid, archname, 32);
-			fprintf(stderr, "performance model for %s\n", archname);
 			display_perf_model(model, archid);
 		}
 	}