소스 검색

make starpu_list_models take an output parameter instead of hardcoding stdout

Samuel Thibault 13 년 전
부모
커밋
3772ff2272
4개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 1
      include/starpu_perfmodel.h
  2. 2 2
      src/core/perfmodel/perfmodel_history.c
  3. 1 1
      tools/starpu_perfmodel_display.c
  4. 1 1
      tools/starpu_perfmodel_plot.c

+ 1 - 1
include/starpu_perfmodel.h

@@ -179,7 +179,7 @@ int starpu_load_history_debug(const char *symbol, struct starpu_perfmodel *model
 void starpu_perfmodel_debugfilepath(struct starpu_perfmodel *model,
 		enum starpu_perf_archtype arch, char *path, size_t maxlen, unsigned nimpl);
 void starpu_perfmodel_get_arch_name(enum starpu_perf_archtype arch,	char *archname, size_t maxlen, unsigned nimpl);
-int starpu_list_models(void);
+int starpu_list_models(FILE *output);
 
 void starpu_force_bus_sampling(void);
 void starpu_print_bus_bandwidth(FILE *f);

+ 2 - 2
src/core/perfmodel/perfmodel_history.c

@@ -742,7 +742,7 @@ void _starpu_load_history_based_model(struct starpu_perfmodel *model, unsigned s
 
 /* This function is intended to be used by external tools that should read
  * the performance model files */
-int starpu_list_models(void)
+int starpu_list_models(FILE *output)
 {
         char path[256];
         DIR *dp;
@@ -756,7 +756,7 @@ int starpu_list_models(void)
         if (dp != NULL) {
                 while ((ep = readdir(dp))) {
                         if (strcmp(ep->d_name, ".") && strcmp(ep->d_name, ".."))
-                                fprintf(stdout, "file: <%s>\n", ep->d_name);
+                                fprintf(output, "file: <%s>\n", ep->d_name);
                 }
                 closedir (dp);
                 return 0;

+ 1 - 1
tools/starpu_perfmodel_display.c

@@ -326,7 +326,7 @@ int main(int argc, char **argv)
 	parse_args(argc, argv);
 
         if (list) {
-                int ret = starpu_list_models();
+                int ret = starpu_list_models(stdout);
                 if (ret) {
                         fprintf(stderr, "The performance model directory is invalid\n");
                         return 1;

+ 1 - 1
tools/starpu_perfmodel_plot.c

@@ -387,7 +387,7 @@ int main(int argc, char **argv)
 	parse_args(argc, argv);
 
         if (list) {
-                int ret = starpu_list_models();
+                int ret = starpu_list_models(stdout);
                 if (ret) {
                         fprintf(stderr, "The performance model directory is invalid\n");
                         return 1;