Browse Source

Show task throttling in the trace

Samuel Thibault 8 years ago
parent
commit
1fc4a6ae87
4 changed files with 27 additions and 0 deletions
  1. 11 0
      src/common/fxt.h
  2. 2 0
      src/core/task.c
  3. 6 0
      src/debug/traces/starpu_fxt.c
  4. 8 0
      src/debug/traces/starpu_paje.c

+ 11 - 0
src/common/fxt.h

@@ -217,6 +217,9 @@
 #define _STARPU_FUT_START_FETCH_INPUT	0x517e
 #define _STARPU_FUT_END_FETCH_INPUT	0x517f
 
+#define _STARPU_FUT_TASK_THROTTLE_START	0x5180
+#define _STARPU_FUT_TASK_THROTTLE_END	0x5181
+
 #ifdef STARPU_USE_FXT
 #include <fxt/fxt.h>
 #include <fxt/fut.h>
@@ -738,6 +741,12 @@ do {										\
 #define _STARPU_TRACE_TASK_SUBMIT_END()	\
 	FUT_DO_PROBE1(_STARPU_FUT_TASK_SUBMIT_END, _starpu_gettid());
 
+#define _STARPU_TRACE_TASK_THROTTLE_START()	\
+	FUT_DO_PROBE1(_STARPU_FUT_TASK_THROTTLE_START, _starpu_gettid());
+
+#define _STARPU_TRACE_TASK_THROTTLE_END()	\
+	FUT_DO_PROBE1(_STARPU_FUT_TASK_THROTTLE_END, _starpu_gettid());
+
 #define _STARPU_TRACE_TASK_BUILD_START()	\
 	FUT_DO_PROBE1(_STARPU_FUT_TASK_BUILD_START, _starpu_gettid());
 
@@ -1091,6 +1100,8 @@ do {										\
 #define _STARPU_TRACE_TASK_SUBMIT(job, a, b)			do {(void)(job); (void)(a);(void)(b);} while(0)
 #define _STARPU_TRACE_TASK_SUBMIT_START()		do {} while(0)
 #define _STARPU_TRACE_TASK_SUBMIT_END()			do {} while(0)
+#define _STARPU_TRACE_TASK_THROTTLE_START()		do {} while(0)
+#define _STARPU_TRACE_TASK_THROTTLE_END()		do {} while(0)
 #define _STARPU_TRACE_TASK_BUILD_START()		do {} while(0)
 #define _STARPU_TRACE_TASK_BUILD_END()			do {} while(0)
 #define _STARPU_TRACE_TASK_MPI_DECODE_START()		do {} while(0)

+ 2 - 0
src/core/task.c

@@ -638,7 +638,9 @@ int starpu_task_submit(struct starpu_task *task)
 			&& limit_min_submitted_tasks >= 0 && limit_min_submitted_tasks < nsubmitted_tasks)
 		{
 			starpu_do_schedule();
+			_STARPU_TRACE_TASK_THROTTLE_START();
 			starpu_task_wait_for_n_submitted(limit_min_submitted_tasks);
+			_STARPU_TRACE_TASK_THROTTLE_END();
 		}
 	}
 

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

@@ -468,6 +468,7 @@ static struct
 	{ "Sl",	 "Sleeping",			 WORKER_STATE | THREAD_STATE | COMM_THREAD_STATE },
 	{ "Bu",	 "Building task",		 THREAD_STATE | COMM_THREAD_STATE | USER_THREAD_STATE },
 	{ "Su",  "Submitting task",		 THREAD_STATE | COMM_THREAD_STATE | USER_THREAD_STATE },
+	{ "Th",  "Throttling task submission",	 THREAD_STATE | COMM_THREAD_STATE | USER_THREAD_STATE },
 	{ "MD",  "Decoding task for MPI",	 THREAD_STATE | USER_THREAD_STATE },
 	{ "MPr", "Preparing task for MPI",	 THREAD_STATE | USER_THREAD_STATE },
 	{ "MPo", "Post-processing task for MPI", THREAD_STATE | USER_THREAD_STATE },
@@ -3012,6 +3013,10 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 				handle_task_submit_event(&ev, options, ev.param[0], "Su");
 				break;
 
+			case _STARPU_FUT_TASK_THROTTLE_START:
+				handle_task_submit_event(&ev, options, ev.param[0], "Th");
+				break;
+
 			case _STARPU_FUT_TASK_MPI_DECODE_START:
 				handle_task_submit_event(&ev, options, ev.param[0], "MD");
 				break;
@@ -3034,6 +3039,7 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 
 			case _STARPU_FUT_TASK_BUILD_END:
 			case _STARPU_FUT_TASK_SUBMIT_END:
+			case _STARPU_FUT_TASK_THROTTLE_END:
 			case _STARPU_FUT_TASK_MPI_DECODE_END:
 			case _STARPU_FUT_TASK_MPI_PRE_END:
 			case _STARPU_FUT_TASK_MPI_POST_END:

+ 8 - 0
src/debug/traces/starpu_paje.c

@@ -198,6 +198,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 	poti_DefineEntityValue("H", "S", "Hypervisor", ".5 .18 .0");
 	poti_DefineEntityValue("Bu", "S", "Building task", ".5 .18 .0");
 	poti_DefineEntityValue("Su", "S", "Submiting task", ".3 .09 .0");
+	poti_DefineEntityValue("Th", "S", "Throttling task submission", ".8 .6 .6");
 	poti_DefineEntityValue("MD", "S", "Decoding task for MPI", ".5 .18 .2");
 	poti_DefineEntityValue("MPr", "S", "Preparing task for MPI", ".4 .14 .2");
 	poti_DefineEntityValue("MPo", "S", "Post-processing task for MPI", ".3 .09 .2");
@@ -217,6 +218,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 	poti_DefineEntityValue("H", "WS", "Hypervisor", ".5 .18 .0");
 	poti_DefineEntityValue("Bu", "WS", "Building task", ".5 .18 .0");
 	poti_DefineEntityValue("Su", "WS", "Submiting task", ".3 .09 .0");
+	poti_DefineEntityValue("Th", "WS", "Throttling task submission", ".8 .6 .6");
 
 	/* Types for the MPI Communication Thread of the Memory Node */
 	poti_DefineEventType("MPIev", "MPICt", "MPI event type");
@@ -233,6 +235,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 	poti_DefineEntityValue("RvC", "CtS", "ReceiveCompleted", "0.5 1.0 1.0");
 	poti_DefineEntityValue("Bu", "CtS", "Building task", ".5 .18 .0");
 	poti_DefineEntityValue("Su", "CtS", "Submiting task", ".3 .09 .0");
+	poti_DefineEntityValue("Th", "CtS", "Throttling task submission", ".8 .6 .6");
 
 	/* Type for other threads */
 	poti_DefineEventType("user_user_event", "UT", "user event type");
@@ -240,6 +243,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 	poti_DefineStateType("US", "UT", "User Thread State");
 	poti_DefineEntityValue("Bu", "US", "Building task", ".5 .18 .0");
 	poti_DefineEntityValue("Su", "US", "Submiting task", ".3 .09 .0");
+	poti_DefineEntityValue("Th", "US", "Throttling task submission", ".8 .6 .6");
 	poti_DefineEntityValue("MD", "US", "Decoding task for MPI", ".5 .18 .2");
 	poti_DefineEntityValue("MPr", "US", "Preparing task for MPI", ".4 .14 .2");
 	poti_DefineEntityValue("MPo", "US", "Post-processing task for MPI", ".3 .09 .2");
@@ -331,6 +335,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 6       H       S       Hypervisor      \".5 .18 .0\"		\n\
 6       Bu      S       \"Building task\"   \".5 .18 .0\"		\n\
 6       Su      S       \"Submitting task\" \".3 .09 .0\"		\n\
+6       Th      S       \"Throttling task submission\" \".8 .6 .6\"		\n\
 6       MD      S       \"Decoding task for MPI\" \".5 .18 .2\"		\n\
 6       MPr     S       \"Preparing task for MPI\" \".4 .14 .2\"		\n\
 6       MPo     S       \"Post-processing task for MPI\" \".3 .09 .2\"		\n\
@@ -350,9 +355,11 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 6       H       WS       Hypervisor      \".5 .18 .0\"		\n\
 6       Bu      WS       \"Building task\"   \".5 .18 .0\"		\n\
 6       Su      WS       \"Submitting task\" \".3 .09 .0\"		\n\
+6       Th      WS       \"Throttling task submission\" \".8 .6 .6\"		\n\
 3       US       UT       \"User Thread State\"                        \n\
 6       Bu      US      \"Building task\"   \".5 .18 .0\"		\n\
 6       Su      US      \"Submitting task\" \".3 .09 .0\"		\n\
+6       Th      US      \"Throttling task submission\" \".8 .6 .6\"		\n\
 6       MD      US      \"Decoding task for MPI\" \".5 .18 .2\"		\n\
 6       MPr     US      \"Preparing task for MPI\" \".4 .14 .2\"		\n\
 6       MPo     US      \"Post-processing task for MPI\" \".3 .09 .2\"		\n\
@@ -371,6 +378,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 6       RvC       CtS      ReceiveCompleted  \"0.5 1.0 1.0\"	\n\
 6       Bu      CtS      \"Building task\"   \".5 .18 .0\"		\n\
 6       Su      CtS      \"Submitting task\" \".3 .09 .0\"		\n\
+6       Th      CtS      \"Throttling task submission\" \".8 .6 .6\"		\n\
 ");
 	for (i=1; i<STARPU_NMAX_SCHED_CTXS; i++)
 		fprintf(file, "\