Browse Source

backport r 14006 from 1.1: Add support for tracing the number of submitted tasks, thanks Jean-Marie Couteyen for the patch

Samuel Thibault 10 years ago
parent
commit
5e26fe64f8
3 changed files with 31 additions and 8 deletions
  1. 1 0
      src/core/task.c
  2. 26 6
      src/debug/traces/starpu_fxt.c
  3. 4 2
      src/debug/traces/starpu_paje.c

+ 1 - 0
src/core/task.c

@@ -552,6 +552,7 @@ int starpu_task_submit(struct starpu_task *task)
 	{
 	{
 		unsigned i;
 		unsigned i;
 		unsigned nbuffers = STARPU_TASK_GET_NBUFFERS(task);
 		unsigned nbuffers = STARPU_TASK_GET_NBUFFERS(task);
+		_STARPU_TRACE_UPDATE_TASK_CNT(0);
 
 
 		/* Check buffers */
 		/* Check buffers */
 		if (task->dyn_handles == NULL)
 		if (task->dyn_handles == NULL)

+ 26 - 6
src/debug/traces/starpu_fxt.c

@@ -1176,6 +1176,7 @@ static void handle_memnode_event(struct fxt_ev_64 *ev, struct starpu_fxt_options
  *	Number of task submitted to the scheduler
  *	Number of task submitted to the scheduler
  */
  */
 static int curq_size = 0;
 static int curq_size = 0;
+static int nsubmitted = 0;
 
 
 static void handle_job_push(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 static void handle_job_push(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 {
@@ -1189,9 +1190,9 @@ static void handle_job_push(struct fxt_ev_64 *ev, struct starpu_fxt_options *opt
 		char container[STARPU_POTI_STR_LEN];
 		char container[STARPU_POTI_STR_LEN];
 
 
 		scheduler_container_alias(container, STARPU_POTI_STR_LEN, options->file_prefix);
 		scheduler_container_alias(container, STARPU_POTI_STR_LEN, options->file_prefix);
-		poti_SetVariable(current_timestamp, container, "ntask", (double)curq_size);
+		poti_SetVariable(current_timestamp, container, "nready", (double)curq_size);
 #else
 #else
-		fprintf(out_paje_file, "13	%.9f	%ssched	ntask	%f\n", current_timestamp, options->file_prefix, (float)curq_size);
+		fprintf(out_paje_file, "13	%.9f	%ssched	nready	%f\n", current_timestamp, options->file_prefix, (float)curq_size);
 #endif
 #endif
 	}
 	}
 
 
@@ -1204,29 +1205,48 @@ static void handle_job_pop(struct fxt_ev_64 *ev, struct starpu_fxt_options *opti
 	double current_timestamp = get_event_time_stamp(ev, options);
 	double current_timestamp = get_event_time_stamp(ev, options);
 
 
 	curq_size--;
 	curq_size--;
+	nsubmitted--;
 
 
 	if (!options->no_counter && out_paje_file)
 	if (!options->no_counter && out_paje_file)
 	{
 	{
 #ifdef STARPU_HAVE_POTI
 #ifdef STARPU_HAVE_POTI
 		char container[STARPU_POTI_STR_LEN];
 		char container[STARPU_POTI_STR_LEN];
 		scheduler_container_alias(container, STARPU_POTI_STR_LEN, options->file_prefix);
 		scheduler_container_alias(container, STARPU_POTI_STR_LEN, options->file_prefix);
-		poti_SetVariable(current_timestamp, container, "ntask", (double)curq_size);
+		poti_SetVariable(current_timestamp, container, "nready", (double)curq_size);
+	poti_SetVariable(current_timestamp, container, "nsubmitted", (double)nsubmitted);
 #else
 #else
-		fprintf(out_paje_file, "13	%.9f	%ssched	ntask	%f\n", current_timestamp, options->file_prefix, (float)curq_size);
+		fprintf(out_paje_file, "13	%.9f	%ssched	nready	%f\n", current_timestamp, options->file_prefix, (float)curq_size);
+		fprintf(out_paje_file, "13	%.9f	%ssched	nsubmitted	%f\n", current_timestamp, options->file_prefix, (float)nsubmitted);
 #endif
 #endif
 	}
 	}
 
 
 	if (activity_file)
 	if (activity_file)
+	{
 		fprintf(activity_file, "cnt_ready\t%.9f\t%d\n", current_timestamp, curq_size);
 		fprintf(activity_file, "cnt_ready\t%.9f\t%d\n", current_timestamp, curq_size);
+		fprintf(activity_file, "cnt_submitted\t%.9f\t%d\n", current_timestamp, nsubmitted);
+	}
 }
 }
 
 
 static
 static
 void handle_update_task_cnt(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 void handle_update_task_cnt(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 {
 	double current_timestamp = get_event_time_stamp(ev, options);
 	double current_timestamp = get_event_time_stamp(ev, options);
-	unsigned long nsubmitted = ev->param[0];
+
+	nsubmitted++;
+	if (!options->no_counter && out_paje_file)
+	{
+#ifdef STARPU_HAVE_POTI
+		char container[STARPU_POTI_STR_LEN];
+		scheduler_container_alias(container, STARPU_POTI_STR_LEN, options->file_prefix);
+		poti_SetVariable(current_timestamp, container, "nsubmitted", (double)nsubmitted);
+#else
+		fprintf(out_paje_file, "13	%.9f	%ssched nsubmitted	%f\n", current_timestamp, options->file_prefix, (float)nsubmitted);
+#endif
+	}
+
+
 	if (activity_file)
 	if (activity_file)
-	fprintf(activity_file, "cnt_submitted\t%.9f\t%lu\n", current_timestamp, nsubmitted);
+		fprintf(activity_file, "cnt_submitted\t%.9f\t%d\n", current_timestamp, nsubmitted);
 }
 }
 
 
 static void handle_tag(struct fxt_ev_64 *ev)
 static void handle_tag(struct fxt_ev_64 *ev)

+ 4 - 2
src/debug/traces/starpu_paje.c

@@ -219,7 +219,8 @@ void _starpu_fxt_write_paje_header(FILE *file)
 	}
 	}
 
 
 	/* Types for the Scheduler */
 	/* Types for the Scheduler */
-	poti_DefineVariableType("ntask", "Sc", "Number of tasks", "0 0 0");
+	poti_DefineVariableType("nsubmitted", "Sc", "Number of Submitted Uncompleted Tasks", "0 0 0");
+	poti_DefineVariableType("nready", "Sc", "Number of Ready Tasks", "0 0 0");
 
 
 	/* Link types */
 	/* Link types */
 	poti_DefineLinkType("MPIL", "P", "MPICt", "MPICt", "Links between two MPI Communication Threads");
 	poti_DefineLinkType("MPIL", "P", "MPICt", "MPICt", "Links between two MPI Communication Threads");
@@ -247,7 +248,8 @@ void _starpu_fxt_write_paje_header(FILE *file)
 		fprintf(file, "3       Ctx%u      T     \"InCtx%u\"         		\n", i, i);
 		fprintf(file, "3       Ctx%u      T     \"InCtx%u\"         		\n", i, i);
 	fprintf(file, "\
 	fprintf(file, "\
 3       MS       Mm       \"Memory Node State\"                        \n\
 3       MS       Mm       \"Memory Node State\"                        \n\
-4       ntask    Sc       \"Number of tasks\"                        \n\
+4       nsubmitted    Sc       \"Number of Submitted Uncompleted Tasks\"                        \n\
+4       nready    Sc       \"Number of Ready Tasks\"                        \n\
 4       bw      Mm       \"Bandwidth\"                        \n\
 4       bw      Mm       \"Bandwidth\"                        \n\
 6       I       S      Initializing       \"0.0 .7 1.0\"            \n\
 6       I       S      Initializing       \"0.0 .7 1.0\"            \n\
 6       D       S      Deinitializing       \"0.0 .1 .7\"            \n\
 6       D       S      Deinitializing       \"0.0 .1 .7\"            \n\