Bläddra i källkod

show data registration and invalidation in paje trace

Samuel Thibault 8 år sedan
förälder
incheckning
8fc6f07f4e

+ 1 - 1
examples/cholesky/cholesky_implicit.c

@@ -323,7 +323,7 @@ int main(int argc, char **argv)
 
 	int ret;
 	ret = starpu_init(NULL);
-	starpu_fxt_stop_profiling();
+	//starpu_fxt_stop_profiling();
 
 	if (ret == -ENODEV) return 77;
         STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");

+ 1 - 0
src/datawizard/filters.c

@@ -170,6 +170,7 @@ static void _starpu_data_partition(starpu_data_handle_t initial_handle, starpu_d
 		else
 			child = childrenp[i];
 		STARPU_ASSERT(child);
+		_STARPU_TRACE_HANDLE_DATA_REGISTER(child);
 
 		struct starpu_data_interface_ops *ops;
 

+ 0 - 2
src/datawizard/interfaces/data_interface.c

@@ -459,9 +459,7 @@ void starpu_data_register(starpu_data_handle_t *handleptr, unsigned home_node,
 			  struct starpu_data_interface_ops *ops)
 {
 	starpu_data_handle_t handle = _starpu_data_handle_allocate(ops, home_node);
-#ifdef STARPU_USE_FXT
 	_STARPU_TRACE_HANDLE_DATA_REGISTER(handle);
-#endif
 
 	STARPU_ASSERT(handleptr);
 	*handleptr = handle;

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

@@ -1567,6 +1567,43 @@ static void handle_worker_sleep_end(struct fxt_ev_64 *ev, struct starpu_fxt_opti
 	update_accumulated_time(worker, sleep_length, 0.0, end_sleep_timestamp, 0);
 }
 
+static void handle_data_register(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+{
+	unsigned long handle = ev->param[0];
+	char *prefix = options->file_prefix;
+
+	if (out_paje_file)
+	{
+#ifdef STARPU_HAVE_POTI
+		char paje_value[STARPU_POTI_STR_LEN], container[STARPU_POTI_STR_LEN];
+		snprintf(paje_value, STARPU_POTI_STR_LEN, "%lx", handle);
+		program_container_alias (container, STARPU_POTI_STR_LEN, prefix);
+		poti_NewEvent(get_event_time_stamp(ev, options), container, "user_event", paje_value);
+#else
+		fprintf(out_paje_file, "9	%.9f	register	%sp	%lx\n", get_event_time_stamp(ev, options), prefix, handle);
+#endif
+	}
+}
+
+static void handle_data_invalidate(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+{
+	unsigned long handle = ev->param[0];
+	unsigned node = ev->param[1];
+	char *prefix = options->file_prefix;
+
+	if (out_paje_file)
+	{
+#ifdef STARPU_HAVE_POTI
+		char paje_value[STARPU_POTI_STR_LEN], memnode_container[STARPU_POTI_STR_LEN];
+		memmanager_container_alias(memnode_container, STARPU_POTI_STR_LEN, prefix, node);
+		snprintf(paje_value, STARPU_POTI_STR_LEN, "%lx", handle);
+		poti_NewEvent(get_event_time_stamp(ev, options), container, "user_event", paje_value);
+#else
+		fprintf(out_paje_file, "9	%.9f	invalidate	%smm%u	%lx\n", get_event_time_stamp(ev, options), prefix, node, handle);
+#endif
+	}
+}
+
 static void handle_data_copy(void)
 {
 }
@@ -2617,6 +2654,14 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 				handle_tag_done(&ev, options);
 				break;
 
+			case _STARPU_FUT_HANDLE_DATA_REGISTER:
+				handle_data_register(&ev, options);
+				break;
+
+			case _STARPU_FUT_DATA_INVALIDATE:
+				handle_data_invalidate(&ev, options);
+				break;
+
 			case _STARPU_FUT_DATA_COPY:
 				if (!options->no_bus)
 				     handle_data_copy();

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

@@ -156,8 +156,10 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 	poti_DefineContainerType("MPICt", "P", "MPI Communication Thread");
 	poti_DefineContainerType("Sc", "P", "Scheduler");
 	poti_DefineEventType("prog_event", "P", "program event type");
+	poti_DefineEventType("register", "P", "data registration");
 
 	/* Types for the memory node */
+	poti_DefineEventType("invalidate", "Mm", "data invalidation");
 	poti_DefineVariableType("bw", "Mm", "Bandwidth", "0 0 0");
 	poti_DefineStateType("MS", "Mm", "Memory Node State");
 	poti_DefineEntityValue("A", "MS", "Allocating", ".4 .1 .0");
@@ -280,6 +282,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 1       MPICt   P       \"MPI Communication Thread\"              \n\
 1       Sc       P       \"Scheduler State\"                        \n\
 2       prog_event   P       \"program event type\"				\n\
+2       register     P       \"data registration\"				\n\
 2       user_event   T       \"user event type\"				\n\
 2       thread_event   T       \"thread event type\"				\n\
 2       user_user_event   UT       \"user event type\"				\n\
@@ -290,6 +293,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 	for (i=1; i<STARPU_NMAX_SCHED_CTXS; i++)
 		fprintf(file, "3       Ctx%u      T     \"InCtx%u\"         		\n", i, i);
 	fprintf(file, "\
+2       invalidate Mm \"data invalidation\"                            \n\
 3       MS       Mm       \"Memory Node State\"                        \n\
 4       nsubmitted    Sc       \"Number of Submitted Uncompleted Tasks\"                        \n\
 4       nready    Sc       \"Number of Ready Tasks\"                        \n\