Browse Source

Fix spurious Idle state on CPUs and mono-worker GPUs

Samuel Thibault 7 years ago
parent
commit
c08752aed9
2 changed files with 9 additions and 3 deletions
  1. 1 1
      src/common/fxt.h
  2. 8 2
      src/debug/traces/starpu_fxt.c

+ 1 - 1
src/common/fxt.h

@@ -623,7 +623,7 @@ do {									\
 	const uint32_t job_hash = _starpu_compute_buffers_footprint((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));\
 	char _archname[32]=""; \
 	starpu_perfmodel_get_arch_name(perf_arch, _archname, 32, 0);	\
-	_STARPU_FUT_DO_PROBE4STR(_STARPU_FUT_END_CODELET_BODY, (job)->job_id, (job_size), (job_hash), workerid, _archname); \
+	_STARPU_FUT_DO_PROBE5STR(_STARPU_FUT_END_CODELET_BODY, (job)->job_id, (job_size), (job_hash), workerid, _starpu_gettid(), _archname); \
 } while(0);
 
 #define _STARPU_TRACE_START_EXECUTING()				\

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

@@ -665,6 +665,7 @@ static int find_worker_id(unsigned long nodeid, unsigned long tid)
 	return entry->workerid;
 }
 
+/* check whether this thread manages several workers */
 static int find_sync(unsigned long nodeid, unsigned long tid)
 {
 	struct worker_entry *entry;
@@ -1648,12 +1649,17 @@ static void handle_end_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_opti
 
 	size_t codelet_size = ev->param[1];
 	uint32_t codelet_hash = ev->param[2];
+	long unsigned int threadid = ev->param[4];
 	char *name = get_fxt_string(ev, 4);
 
+	const char *state = "I";
+	if (find_sync(prefixTOnodeid(prefix), threadid))
+		state = "B";
+
 	if (out_paje_file)
-		worker_set_state(end_codelet_time, prefix, worker, "I");
+		worker_set_state(end_codelet_time, prefix, worker, state);
 	if (trace_file)
-		recfmt_worker_set_state(end_codelet_time, worker, "I", "Other");
+		recfmt_worker_set_state(end_codelet_time, worker, state, "Other");
 
 	struct task_info *task = get_task(ev->param[0], options->file_rank);