|
@@ -78,13 +78,14 @@ static void usage()
|
|
fprintf(stderr, " -i <Fxt files> input FxT files generated by StarPU\n");
|
|
fprintf(stderr, " -i <Fxt files> input FxT files generated by StarPU\n");
|
|
fprintf(stderr, " -lc display all combinations of a given model\n");
|
|
fprintf(stderr, " -lc display all combinations of a given model\n");
|
|
fprintf(stderr, " -c <combination> specify the combination (use the option -lc to list all combinations of a given model)\n");
|
|
fprintf(stderr, " -c <combination> specify the combination (use the option -lc to list all combinations of a given model)\n");
|
|
|
|
+ fprintf(stderr, " -o <directory> specify directory in which to create output files (current directory by default)\n");
|
|
fprintf(stderr, " -h, --help display this help and exit\n");
|
|
fprintf(stderr, " -h, --help display this help and exit\n");
|
|
fprintf(stderr, " -v, --version output version information and exit\n\n");
|
|
fprintf(stderr, " -v, --version output version information and exit\n\n");
|
|
fprintf(stderr, "Report bugs to <%s>.", PACKAGE_BUGREPORT);
|
|
fprintf(stderr, "Report bugs to <%s>.", PACKAGE_BUGREPORT);
|
|
fprintf(stderr, "\n");
|
|
fprintf(stderr, "\n");
|
|
}
|
|
}
|
|
|
|
|
|
-static void parse_args(int argc, char **argv, struct _perfmodel_plot_options *options)
|
|
|
|
|
|
+static void parse_args(int argc, char **argv, struct _perfmodel_plot_options *options, char **directory)
|
|
{
|
|
{
|
|
int correct_usage = 0;
|
|
int correct_usage = 0;
|
|
memset(options, 0, sizeof(struct _perfmodel_plot_options));
|
|
memset(options, 0, sizeof(struct _perfmodel_plot_options));
|
|
@@ -114,6 +115,17 @@ static void parse_args(int argc, char **argv, struct _perfmodel_plot_options *op
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (strcmp(argv[i], "-o") == 0)
|
|
|
|
+ {
|
|
|
|
+ free(*directory);
|
|
|
|
+ *directory = strdup(argv[++i]);
|
|
|
|
+#ifdef STARPU_USE_FXT
|
|
|
|
+ options->fxt_options.dir = strdup(*directory);
|
|
|
|
+#endif
|
|
|
|
+ correct_usage = 1;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (strcmp(argv[i], "-i") == 0)
|
|
if (strcmp(argv[i], "-i") == 0)
|
|
{
|
|
{
|
|
reading_input_filenames = 1;
|
|
reading_input_filenames = 1;
|
|
@@ -480,13 +492,14 @@ int main(int argc, char **argv)
|
|
struct starpu_perfmodel model = { .type = STARPU_PERFMODEL_INVALID };
|
|
struct starpu_perfmodel model = { .type = STARPU_PERFMODEL_INVALID };
|
|
char gnuplot_file_name[256];
|
|
char gnuplot_file_name[256];
|
|
struct _perfmodel_plot_options options;
|
|
struct _perfmodel_plot_options options;
|
|
|
|
+ char *directory = strdup("./");
|
|
|
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
WSADATA wsadata;
|
|
WSADATA wsadata;
|
|
WSAStartup(MAKEWORD(1,0), &wsadata);
|
|
WSAStartup(MAKEWORD(1,0), &wsadata);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- parse_args(argc, argv, &options);
|
|
|
|
|
|
+ parse_args(argc, argv, &options, &directory);
|
|
starpu_perfmodel_initialize();
|
|
starpu_perfmodel_initialize();
|
|
|
|
|
|
if (options.directory)
|
|
if (options.directory)
|
|
@@ -525,7 +538,7 @@ int main(int argc, char **argv)
|
|
{
|
|
{
|
|
starpu_fxt_generate_trace(&options.fxt_options);
|
|
starpu_fxt_generate_trace(&options.fxt_options);
|
|
|
|
|
|
- snprintf(options.data_file_name, sizeof(options.data_file_name), "starpu_%s.data", options.symbol);
|
|
|
|
|
|
+ snprintf(options.data_file_name, sizeof(options.data_file_name), "%s/starpu_%s.data", directory, options.symbol);
|
|
|
|
|
|
FILE *data_file = fopen(options.data_file_name, "w+");
|
|
FILE *data_file = fopen(options.data_file_name, "w+");
|
|
STARPU_ASSERT(data_file);
|
|
STARPU_ASSERT(data_file);
|
|
@@ -534,11 +547,11 @@ int main(int argc, char **argv)
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- snprintf(gnuplot_file_name, sizeof(gnuplot_file_name), "starpu_%s.gp", options.symbol);
|
|
|
|
- snprintf(options.avg_file_name, sizeof(options.avg_file_name), "starpu_%s_avg.data", options.symbol);
|
|
|
|
|
|
+ snprintf(gnuplot_file_name, sizeof(gnuplot_file_name), "%s/starpu_%s.gp", directory, options.symbol);
|
|
|
|
+ snprintf(options.avg_file_name, sizeof(options.avg_file_name), "%s/starpu_%s_avg.data", directory, options.symbol);
|
|
|
|
|
|
FILE *gnuplot_file = fopen(gnuplot_file_name, "w+");
|
|
FILE *gnuplot_file = fopen(gnuplot_file_name, "w+");
|
|
- STARPU_ASSERT(gnuplot_file);
|
|
|
|
|
|
+ STARPU_ASSERT_MSG(gnuplot_file, "Cannot create file <%s>\n", gnuplot_file_name);
|
|
display_selected_models(gnuplot_file, &model, &options);
|
|
display_selected_models(gnuplot_file, &model, &options);
|
|
fprintf(gnuplot_file,"\n");
|
|
fprintf(gnuplot_file,"\n");
|
|
fclose(gnuplot_file);
|
|
fclose(gnuplot_file);
|
|
@@ -563,5 +576,6 @@ int main(int argc, char **argv)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
starpu_perfmodel_free_sampling();
|
|
starpu_perfmodel_free_sampling();
|
|
|
|
+ free(directory);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|