Преглед изворни кода

Add dependencies between tags and tasks

Samuel Thibault пре 13 година
родитељ
комит
52520c51c2
3 измењених фајлова са 23 додато и 4 уклоњено
  1. 13 2
      src/debug/traces/starpu_fxt.c
  2. 2 1
      src/debug/traces/starpu_fxt.h
  3. 8 1
      src/debug/traces/starpu_fxt_dag.c

+ 13 - 2
src/debug/traces/starpu_fxt.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
+ * Copyright (C) 2009-2012  Université de Bordeaux 1
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -646,6 +646,17 @@ void handle_update_task_cnt(struct fxt_ev_64 *ev, struct starpu_fxt_options *opt
 	fprintf(activity_file, "cnt_submitted\t%f\t%lu\n", current_timestamp, nsubmitted);
 }
 
+static void handle_codelet_tag(struct fxt_ev_64 *ev)
+{
+	uint64_t tag;
+	unsigned long job;
+
+	tag = ev->param[0];
+	job = ev->param[1];
+
+	_starpu_fxt_dag_add_tag(tag, job);
+}
+
 static void handle_codelet_tag_deps(struct fxt_ev_64 *ev)
 {
 	uint64_t child;
@@ -920,7 +931,7 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 				break;
 
 			case _STARPU_FUT_TAG:
-				/* XXX */
+				handle_codelet_tag(&ev);
 				break;
 
 			case _STARPU_FUT_TAG_DEPS:

+ 2 - 1
src/debug/traces/starpu_fxt.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
+ * Copyright (C) 2009-2012  Université de Bordeaux 1
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -40,6 +40,7 @@
 
 void _starpu_fxt_dag_init(char *dag_filename);
 void _starpu_fxt_dag_terminate(void);
+void _starpu_fxt_dag_add_tag(uint64_t tag, unsigned long job_id);
 void _starpu_fxt_dag_add_tag_deps(uint64_t child, uint64_t father);
 void _starpu_fxt_dag_set_tag_done(uint64_t tag, const char *color);
 void _starpu_fxt_dag_add_task_deps(unsigned long dep_prev, unsigned long dep_succ);

+ 8 - 1
src/debug/traces/starpu_fxt_dag.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011  Université de Bordeaux 1
+ * Copyright (C) 2010-2012  Université de Bordeaux 1
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -64,6 +64,13 @@ void _starpu_fxt_dag_terminate(void)
 	fclose(out_file);
 }
 
+void _starpu_fxt_dag_add_tag(uint64_t tag, unsigned long job_id)
+{
+	if (out_file)
+		fprintf(out_file, "\t \"tag_%llx\"->\"task_%llx\"->\"tag_%llx\"\n",
+			(unsigned long long)tag, (unsigned long long)job_id, (unsigned long long) tag);
+}
+
 void _starpu_fxt_dag_add_tag_deps(uint64_t child, uint64_t father)
 {
 	if (out_file)