瀏覽代碼

Add FXT cp stuff to see cp begin and end as events in vite

Romain LION 5 年之前
父節點
當前提交
c9e3a4cd27
共有 1 個文件被更改,包括 45 次插入2 次删除
  1. 45 2
      src/debug/traces/starpu_fxt.c

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

@@ -2281,6 +2281,39 @@ static const char *copy_link_type(enum _starpu_is_prefetch prefetch)
 	}
 }
 
+
+static void handle_checkpoint_begin(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+{
+
+	/* Add an event in the trace */
+	if (out_paje_file) {
+#ifdef STARPU_HAVE_POTI
+		char container[STARPU_POTI_STR_LEN];
+		snprintf(container, sizeof(container), "%sp", options->file_prefix);
+		poti_NewEvent(get_event_time_stamp(ev, options), container, "prog_event", event);
+#else
+		fprintf(out_paje_file, "25	%.9f	checkpoint_begin %sp	 0 %lu %lu\n", get_event_time_stamp(ev, options),
+		        options->file_prefix, ev->param[0], ev->param[1]);
+#endif
+	}
+}
+
+static void handle_checkpoint_end(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+{
+
+	/* Add an event in the trace */
+	if (out_paje_file) {
+#ifdef STARPU_HAVE_POTI
+		char container[STARPU_POTI_STR_LEN];
+		snprintf(container, sizeof(container), "%sp", options->file_prefix);
+		poti_NewEvent(get_event_time_stamp(ev, options), container, "prog_event", event);
+#else
+		fprintf(out_paje_file, "25	%.9f	checkpoint_end	%sp	0 %lu %lu\n", get_event_time_stamp(ev, options),
+		        options->file_prefix, ev->param[0], ev->param[1]);
+#endif
+	}
+}
+
 static void handle_start_driver_copy(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	unsigned src = ev->param[0];
@@ -2641,7 +2674,8 @@ static void handle_job_push(struct fxt_ev_64 *ev, struct starpu_fxt_options *opt
                poti_NewEvent(get_event_time_stamp(ev, options), container, "pu", paje_value);
 #else
 	       fprintf(out_paje_file, "13	%.9f	%ssched	nready	%f\n", current_timestamp, options->file_prefix, (float)curq_size);
-               fprintf(out_paje_file, "9       %.9f    %s      %sp     %u\n", get_event_time_stamp(ev, options), "pu", options->file_prefix, task);
+	       if (!options->no_events)
+	       	    fprintf(out_paje_file, "9       %.9f    %s      %sp     %u\n", get_event_time_stamp(ev, options), "pu", options->file_prefix, task);
 #endif
 	}
 
@@ -2687,7 +2721,8 @@ static void handle_job_pop(struct fxt_ev_64 *ev, struct starpu_fxt_options *opti
 #else
 		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);
-		fprintf(out_paje_file, "9       %.9f    %s      %sp     %u\n", get_event_time_stamp(ev, options), "po", options->file_prefix, task);
+		if (!options->no_events)
+			fprintf(out_paje_file, "9       %.9f    %s      %sp     %u\n", get_event_time_stamp(ev, options), "po", options->file_prefix, task);
 #endif
 	}
 
@@ -4003,6 +4038,14 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 				handle_mpi_driver_run_end(&ev, options);
 				break;
 
+			case _STARPU_MPI_FUT_CHECKPOINT_BEGIN:
+				handle_checkpoint_begin(&ev, options);
+				break;
+
+			case _STARPU_MPI_FUT_CHECKPOINT_END:
+				handle_checkpoint_end(&ev, options);
+				break;
+
 			case _STARPU_FUT_SET_PROFILING:
 				handle_set_profiling(&ev, options);
 				break;