Quellcode durchsuchen

tests/microbenchs/[a]sync_tasks_overhead.c: save results into files to be plotted

Nathalie Furmento vor 14 Jahren
Ursprung
Commit
20bf553462
2 geänderte Dateien mit 40 neuen und 0 gelöschten Zeilen
  1. 20 0
      tests/microbenchs/async_tasks_overhead.c
  2. 20 0
      tests/microbenchs/sync_tasks_overhead.c

+ 20 - 0
tests/microbenchs/async_tasks_overhead.c

@@ -161,6 +161,26 @@ int main(int argc, char **argv)
 	fprintf(stderr, "Total: %lf secs\n", timing/1000000);
 	fprintf(stderr, "Per task: %lf usecs\n", timing/ntasks);
 
+        {
+                char *output_dir = getenv("STARPU_BENCH_DIR");
+                char *bench_id = getenv("STARPU_BENCH_ID");
+
+                if (output_dir && bench_id) {
+                        char file[1024];
+                        FILE *f;
+
+                        sprintf(file, "%s/async_tasks_overhead_total.dat", output_dir);
+                        f = fopen(file, "a");
+                        fprintf(f, "%s\t%lf\n", bench_id, timing/1000000);
+                        fclose(f);
+
+                        sprintf(file, "%s/async_tasks_overhead_per_task.dat", output_dir);
+                        f = fopen(file, "a");
+                        fprintf(f, "%s\t%lf\n", bench_id, timing/ntasks);
+                        fclose(f);
+                }
+        }
+
 	starpu_shutdown();
 
 	return 0;

+ 20 - 0
tests/microbenchs/sync_tasks_overhead.c

@@ -108,6 +108,26 @@ int main(int argc, char **argv)
 	fprintf(stderr, "Total: %lf secs\n", timing/1000000);
 	fprintf(stderr, "Per task: %lf usecs\n", timing/ntasks);
 
+        {
+                char *output_dir = getenv("STARPU_BENCH_DIR");
+                char *bench_id = getenv("STARPU_BENCH_ID");
+
+                if (output_dir && bench_id) {
+                        char file[1024];
+                        FILE *f;
+
+                        sprintf(file, "%s/sync_tasks_overhead_total.dat", output_dir);
+                        f = fopen(file, "a");
+                        fprintf(f, "%s\t%lf\n", bench_id, timing/1000000);
+                        fclose(f);
+
+                        sprintf(file, "%s/sync_tasks_overhead_per_task.dat", output_dir);
+                        f = fopen(file, "a");
+                        fprintf(f, "%s\t%lf\n", bench_id, timing/ntasks);
+                        fclose(f);
+                }
+        }
+
 	starpu_shutdown();
 
 	return 0;