Procházet zdrojové kódy

fix starpu_replay into actually simulating task time again

Using the STARPU_CODELET_SIMGRID_EXECUTE flag drops the simgrid
simulation.
Samuel Thibault před 5 roky
rodič
revize
f252fdc780
1 změnil soubory, kde provedl 14 přidání a 0 odebrání
  1. 14 0
      tools/starpu_replay.c

+ 14 - 0
tools/starpu_replay.c

@@ -348,6 +348,20 @@ void dumb_kernel(void *buffers[], void *args) {
 		printf("\rExecuted task %lu...", nexecuted_tasks);
 		fflush(stdout);
 	}
+
+	unsigned this_worker = starpu_worker_get_id_check();
+	struct starpu_perfmodel_arch *perf_arch = starpu_worker_get_perf_archtype(this_worker, STARPU_NMAX_SCHED_CTXS);
+
+	struct starpu_task *task = starpu_task_get_current();
+	unsigned impl = starpu_task_get_implementation(task);
+
+	double length = starpu_task_expected_length(task, perf_arch, impl);
+
+	STARPU_ASSERT_MSG(!_STARPU_IS_ZERO(length) && !isnan(length),
+			"Codelet %s does not have a perfmodel, or is not calibrated enough, please re-run in non-simgrid mode until it is calibrated",
+		starpu_task_get_name(task));
+
+	starpu_sleep(length / 1000000);
 }
 
 /* [CODELET] Initialization of an unique codelet for all the tasks*/