Browse Source

top: function starpu_top_task_prevision is now in public API

Nathalie Furmento 12 years ago
parent
commit
f8cb4e94fc

+ 8 - 0
include/starpu_top.h

@@ -195,6 +195,14 @@ void starpu_top_update_data_float(const struct starpu_top_data* data,
 				  double value);
 
 /*
+ * This function notifies UI than the task have been planed to
+ * run from start to end, on computation-core
+ */
+void starpu_top_task_prevision(struct starpu_task *task,
+			       int devid, unsigned long long start,
+			       unsigned long long end);
+
+/*
  * This functions are usefull in debug mode. The starpu developper doesn't need
  * to check if the debug mode is active.
  * This is checked by starpu_top itsefl.

+ 7 - 8
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -327,10 +327,9 @@ static int push_task_on_best_worker(struct starpu_task *task, int best_workerid,
 	task->predicted_transfer = predicted_transfer;
 
 #ifdef STARPU_USE_TOP
-	if (_starpu_top_status_get())
-		_starpu_top_task_prevision(task, best_workerid,
-			(unsigned long long)(fifo->exp_end-predicted)/1000,
-			(unsigned long long)fifo->exp_end/1000);
+	starpu_top_task_prevision(task, best_workerid,
+				  (unsigned long long)(fifo->exp_end-predicted)/1000,
+				  (unsigned long long)fifo->exp_end/1000);
 #endif /* !STARPU_USE_TOP */
 
 	if (starpu_get_prefetch_flag())
@@ -866,13 +865,13 @@ static void initialize_dmda_policy(unsigned sched_ctx_id)
 
 #ifdef STARPU_USE_TOP
 	starpu_top_register_parameter_float("DMDA_ALPHA", &alpha,
-		alpha_minimum, alpha_maximum, param_modified);
+					    alpha_minimum, alpha_maximum, param_modified);
 	starpu_top_register_parameter_float("DMDA_BETA", &beta,
-		beta_minimum, beta_maximum, param_modified);
+					    beta_minimum, beta_maximum, param_modified);
 	starpu_top_register_parameter_float("DMDA_GAMMA", &_gamma,
-		gamma_minimum, gamma_maximum, param_modified);
+					    gamma_minimum, gamma_maximum, param_modified);
 	starpu_top_register_parameter_float("DMDA_IDLE_POWER", &idle_power,
-		idle_power_minimum, idle_power_maximum, param_modified);
+					    idle_power_minimum, idle_power_maximum, param_modified);
 #endif /* !STARPU_USE_TOP */
 }
 

+ 2 - 2
src/top/starpu_top_core.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011 William Braik, Yann Courtois, Jean-Marie Couteyen, Anthony Roy
- * Copyright (C) 2011, 2012 Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013 Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -48,7 +48,7 @@ void __starpu_top_task_prevision_timespec(struct starpu_task *task,
 					int devid,
 					const struct timespec* start,
 					const struct timespec* end);
-void _starpu_top_task_prevision(struct starpu_task *task,
+void starpu_top_task_prevision(struct starpu_task *task,
 			       int devid, unsigned long long start,
 			       unsigned long long end);
 

+ 6 - 3
src/top/starpu_top_task.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011 William Braik, Yann Courtois, Jean-Marie Couteyen, Anthony Roy
- * Copyright (C) 2011 Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2013 Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -66,17 +66,20 @@ void __starpu_top_task_prevision_timespec(struct starpu_task *task,
 					const struct timespec* start,
 					const struct timespec* end)
 {
-	_starpu_top_task_prevision(task,
+	starpu_top_task_prevision(task,
 				  devid,
 				  _starpu_top_timing_timespec_to_ms(start),
 				  _starpu_top_timing_timespec_to_ms(end));
 }
 
-void _starpu_top_task_prevision(struct starpu_task *task,
+void starpu_top_task_prevision(struct starpu_task *task,
 			       int devid,
 			       unsigned long long start,
 			       unsigned long long end)
 {
+	if (!_starpu_top_status_get())
+		return;
+
 	unsigned long long taskid = _starpu_get_job_associated_to_task(task)->job_id;
 	STARPU_ASSERT(_starpu_top_status_get());
 	struct timespec now;