Samuel Thibault лет назад: 12
Родитель
Сommit
eb64e18781

+ 2 - 0
STARPU-VERSION

@@ -17,6 +17,8 @@
 # - If any interfaces have been removed or changed since the last
 #   public release, then set age to 0. change
 
+# Note for StarPU 1.1: we have changed ABI
+
 # Libtool interface versioning (info "(libtool) Versioning").
 LIBSTARPU_INTERFACE_CURRENT=1	# increment upon ABI change
 LIBSTARPU_INTERFACE_REVISION=0	# increment upon implementation change

+ 0 - 1
examples/cholesky/cholesky_implicit.c

@@ -137,7 +137,6 @@ static int _cholesky(starpu_data_handle_t dataA, unsigned nblocks)
 
 	end = starpu_timing_now();
 
-	//double timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
 	double timing = end - start;
 	unsigned long n = starpu_matrix_get_nx(dataA);
 

+ 1 - 1
include/starpu_perfmodel.h

@@ -203,7 +203,7 @@ int starpu_perfmodel_load_symbol(const char *symbol, struct starpu_perfmodel *mo
 void starpu_perfmodel_debugfilepath(struct starpu_perfmodel *model, enum starpu_perf_archtype arch, char *path, size_t maxlen, unsigned nimpl);
 void starpu_perfmodel_get_arch_name(enum starpu_perf_archtype arch, char *archname, size_t maxlen, unsigned nimpl);
 
-double starpu_history_based_job_expected_perf(struct starpu_perfmodel *model, enum starpu_perf_archtype arch, uint32_t footprint);
+double starpu_history_based_expected_perf(struct starpu_perfmodel *model, enum starpu_perf_archtype arch, uint32_t footprint);
 int starpu_perfmodel_list(FILE *output);
 void starpu_perfmodel_print(struct starpu_perfmodel *model, enum starpu_perf_archtype arch, unsigned nimpl, char *parameter, uint32_t *footprint, FILE *output);
 int starpu_perfmodel_print_all(struct starpu_perfmodel *model, char *arch, char *parameter, uint32_t *footprint, FILE *output);

+ 0 - 6
include/starpu_scheduler.h

@@ -196,10 +196,4 @@ double starpu_task_bundle_expected_power(starpu_task_bundle_t bundle, enum starp
 }
 #endif
 
-/* /\* Waits until all the tasks of a worker, already submitted, have been executed *\/ */
-/* int starpu_wait_for_all_tasks_of_worker(int workerid); */
-
-/* /\* Waits until all the tasks of a bunch of workers have been executed *\/ */
-/* int starpu_wait_for_all_tasks_of_workers(int *workerids_ctx, int nworkers_ctx); */
-
 #endif /* __STARPU_SCHEDULER_H__ */

+ 2 - 0
include/starpu_task.h

@@ -211,10 +211,12 @@ struct starpu_task
 
 	int hypervisor_tag;
 	
+	/* Number of flops computed by this tag, used by resource reallocation for contexts */
 	double flops;
 
 	unsigned already_pushed;
 
+	/* Whether the scheduler has pushed the task on some queue */
 	unsigned scheduled;
 };
 

+ 1 - 3
include/starpu_worker.h

@@ -28,9 +28,7 @@ extern "C"
 
 enum starpu_archtype
 {
-#ifdef STARPU_USE_SCHED_CTX_HYPERVISOR
-	STARPU_ANY_WORKER, /* any worker, used in the hypervisor */
-#endif
+	STARPU_ANY_WORKER,    /* any worker, used in the hypervisor */
 	STARPU_CPU_WORKER,    /* CPU core */
 	STARPU_CUDA_WORKER,   /* NVIDIA CUDA device */
 	STARPU_OPENCL_WORKER, /* OpenCL device */

+ 1 - 1
sched_ctx_hypervisor/src/hypervisor_policies/lp2_policy.c

@@ -303,7 +303,7 @@ static void _starpu_get_tasks_times(int nw, int nt, double times[nw][nt], int *w
                 {
                         enum starpu_perf_archtype arch = workers == NULL ? starpu_worker_get_perf_archtype(w) :
 				starpu_worker_get_perf_archtype(workers[w]);
-                        double length = starpu_history_based_job_expected_perf(tp->cl->model, arch, tp->footprint);
+                        double length = starpu_history_based_expected_perf(tp->cl->model, arch, tp->footprint);
 
                         if (isnan(length))
                                 times[w][t] = NAN;

+ 5 - 1
src/common/barrier_counter.c

@@ -74,13 +74,17 @@ int _starpu_barrier_counter_decrement_until_empty_counter(struct _starpu_barrier
 int _starpu_barrier_counter_increment_until_full_counter(struct _starpu_barrier_counter *barrier_c)
 {
 	struct _starpu_barrier *barrier = &barrier_c->barrier;
+	int ret = 0;
 	_STARPU_PTHREAD_MUTEX_LOCK(&barrier->mutex);
 	
 	if(++barrier->reached_start == barrier->count)
+	{
+		ret = 1;
 		_STARPU_PTHREAD_COND_BROADCAST(&barrier_c->cond2);
+	}
 
 	_STARPU_PTHREAD_MUTEX_UNLOCK(&barrier->mutex);
-	return 0;
+	return ret;
 }
 
 int _starpu_barrier_counter_increment(struct _starpu_barrier_counter *barrier_c)

+ 1 - 1
src/core/perfmodel/perfmodel_history.c

@@ -1139,7 +1139,7 @@ double _starpu_history_based_job_expected_perf(struct starpu_perfmodel *model, e
 	return exp;
 }
 
-double starpu_history_based_job_expected_perf(struct starpu_perfmodel *model, enum starpu_perf_archtype arch, uint32_t footprint)
+double starpu_history_based_expected_perf(struct starpu_perfmodel *model, enum starpu_perf_archtype arch, uint32_t footprint)
 {
 	struct _starpu_job j =
 		{

+ 8 - 4
src/core/sched_policy.c

@@ -313,6 +313,8 @@ int _starpu_push_task(struct _starpu_job *j)
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(task->sched_ctx);
 	unsigned nworkers = 0;
 
+	_STARPU_LOG_IN();
+
 	if(!sched_ctx->is_initial_sched)
 	{
 		/*if there are workers in the ctx that are not able to execute tasks
@@ -326,6 +328,7 @@ int _starpu_push_task(struct _starpu_job *j)
 				_STARPU_PTHREAD_MUTEX_LOCK(&sched_ctx->empty_ctx_mutex);
 				starpu_task_list_push_back(&sched_ctx->empty_ctx_tasks, task);
 				_STARPU_PTHREAD_MUTEX_UNLOCK(&sched_ctx->empty_ctx_mutex);
+				_STARPU_LOG_OUT();
 				return -1;
 			}
 			else
@@ -334,13 +337,13 @@ int _starpu_push_task(struct _starpu_job *j)
 				task->already_pushed = 1;
 				starpu_task_list_push_front(&sched_ctx->empty_ctx_tasks, task);
 				_STARPU_PTHREAD_MUTEX_UNLOCK(&sched_ctx->empty_ctx_mutex);
+				_STARPU_LOG_OUT();
 				return 0;
 			}
 		}
 	}
 
-	_STARPU_LOG_IN();
-
+	_STARPU_TRACE_JOB_PUSH(task, task->priority > 0);
 	_starpu_increment_nready_tasks();
 	task->status = STARPU_TASK_READY;
 #ifdef HAVE_AYUDAME_H
@@ -373,6 +376,7 @@ int _starpu_push_task(struct _starpu_job *j)
 		if(ret == -1)
 		{
 			fprintf(stderr, "repush task \n");
+			_STARPU_TRACE_JOB_POP(task, task->priority > 0);
 			_starpu_decrement_nready_tasks();
 			ret = _starpu_push_task(j);
 		}
@@ -583,7 +587,7 @@ pick:
 
 
 	if (!task)
-		goto profiling;
+		return NULL;
 
 	/* Make sure we do not bother with all the multiformat-specific code if
 	 * it is not necessary. */
@@ -631,7 +635,7 @@ pick:
 	goto pick;
 
 profiling:
-	if (profiling && task)
+	if (profiling)
 	{
 		struct starpu_task_profiling_info *profiling_info;
 		profiling_info = task->profiling_info;

+ 10 - 22
src/core/task.c

@@ -433,29 +433,11 @@ int starpu_task_submit(struct starpu_task *task)
 		_starpu_detect_implicit_data_deps(task);
 
 
-		if(task->bundle)
-		{
-			struct _starpu_task_bundle_entry *entry;
-			entry = task->bundle->list;
-			while(entry)
-			{
-				if (entry->task->cl->model && task->cl->model->symbol)
-					_starpu_load_perfmodel(entry->task->cl->model);
-				
-				if (entry->task->cl->power_model && task->cl->power_model->symbol)
-					_starpu_load_perfmodel(entry->task->cl->power_model);
+		if (task->cl->model && task->cl->model->symbol)
+			_starpu_load_perfmodel(task->cl->model);
 
-				entry = entry->next;
-			}
-		}
-		else
-		{
-			if (task->cl->model && task->cl->model->symbol)
-				_starpu_load_perfmodel(task->cl->model);
-			
-			if (task->cl->power_model && task->cl->power_model->symbol)
-				_starpu_load_perfmodel(task->cl->power_model);
-		}
+		if (task->cl->power_model && task->cl->power_model->symbol)
+			_starpu_load_perfmodel(task->cl->power_model);
 	}
 
 	if (bundle)
@@ -684,7 +666,13 @@ int starpu_task_wait_for_all(void)
 #endif
 	}
 	else
+	{
 		_starpu_wait_for_all_tasks_of_sched_ctx(sched_ctx);
+#ifdef HAVE_AYUDAME_H
+		/* TODO: improve Temanejo into knowing about contexts ... */
+		if (AYU_event) AYU_event(AYU_BARRIER, 0, NULL);
+#endif
+	}
 	return 0;
 }
 

+ 11 - 14
src/core/workers.c

@@ -730,14 +730,6 @@ int starpu_init(struct starpu_conf *user_conf)
 		AYU_event(AYU_PREINIT, 0, (void*) &ayu_rt);
 	}
 #endif
-	_starpu_open_debug_logfile();
-
-	_starpu_data_interface_init();
-
-	_starpu_timing_init();
-
-	_starpu_profiling_init();
-
 	/* store the pointer to the user explicit configuration during the
 	 * initialization */
 	if (user_conf == NULL)
@@ -757,8 +749,6 @@ int starpu_init(struct starpu_conf *user_conf)
 	     config.default_conf = 0;
 	}
 
-	_starpu_load_bus_performance_files();
-
 	_starpu_conf_check_environment(config.conf);
 
 	_starpu_init_all_sched_ctxs(&config);
@@ -770,6 +760,16 @@ int starpu_init(struct starpu_conf *user_conf)
 	_starpu_start_fxt_profiling();
 #endif
 
+	_starpu_open_debug_logfile();
+
+	_starpu_data_interface_init();
+
+	_starpu_timing_init();
+
+	_starpu_profiling_init();
+
+	_starpu_load_bus_performance_files();
+
 	ret = _starpu_build_topology(&config);
 	if (ret)
 	{
@@ -786,10 +786,7 @@ int starpu_init(struct starpu_conf *user_conf)
 	 * threads */
 	_starpu_initialize_current_task_key();
 
-	if(user_conf == NULL)
-		_starpu_create_sched_ctx(NULL, NULL, -1, 1, "init");
-	else
-		_starpu_create_sched_ctx(user_conf->sched_policy_name, NULL, -1, 1, "init");
+	_starpu_create_sched_ctx(config.conf->sched_policy_name, NULL, -1, 1, "init");
 
 	_starpu_initialize_registered_performance_models();
 

+ 3 - 2
src/drivers/driver_common/driver_common.c

@@ -160,8 +160,9 @@ struct starpu_task *_starpu_get_worker_task(struct _starpu_worker *args, int wor
 
 	if (task == NULL)
 	{
-		/*TODO: check this out after the merge */
-
+#ifdef STARPU_DEVEL
+#warning TODO: check this out after the merge (atomicity issue)
+#endif
 
 		/* Note: we need to keep the sched condition mutex all along the path
 		 * from popping a task from the scheduler to blocking. Otherwise the

+ 0 - 2
src/sched_policies/eager_central_priority_policy.c

@@ -156,8 +156,6 @@ static int _starpu_priority_push_task(struct starpu_task *task)
 	/* wake people waiting for a task */
 	_STARPU_PTHREAD_MUTEX_LOCK(&data->sched_mutex);
 
-	_STARPU_TRACE_JOB_PUSH(task, 1);
-
 	unsigned priolevel = task->priority - STARPU_MIN_PRIO;
 
 	starpu_task_list_push_back(&taskq->taskq[priolevel], task);

+ 0 - 5
src/sched_policies/fifo_queues.c

@@ -62,8 +62,6 @@ _starpu_fifo_push_sorted_task(struct _starpu_fifo_taskq *fifo_queue,
 
 	_STARPU_PTHREAD_MUTEX_LOCK(sched_mutex);
 
-	_STARPU_TRACE_JOB_PUSH(task, 0);
-
 	if (list->head == NULL)
 	{
 		list->head = task;
@@ -129,14 +127,11 @@ int _starpu_fifo_push_task(struct _starpu_fifo_taskq *fifo_queue, _starpu_pthrea
 
 	if (task->priority > 0)
 	{
-		_STARPU_TRACE_JOB_PUSH(task, 1);
 		_starpu_fifo_push_sorted_task(fifo_queue, sched_mutex,
 					      sched_cond, task);
 	}
 	else
 	{
-		_STARPU_TRACE_JOB_PUSH(task, 0);
-
 		_STARPU_PTHREAD_MUTEX_LOCK(sched_mutex);
 		starpu_task_list_push_front(&fifo_queue->taskq, task);
 

+ 1 - 1
src/sched_policies/parallel_heft.c

@@ -80,7 +80,7 @@ static void parallel_heft_pre_exec_hook(struct starpu_task *task)
 	 * of work. */
 	_STARPU_PTHREAD_MUTEX_LOCK(sched_mutex);
 	worker_exp_len[workerid] -= model + transfer_model;
-	worker_exp_start[workerid] = starpu_timing_now();
+	worker_exp_start[workerid] = starpu_timing_now() + model;
 	worker_exp_end[workerid] = worker_exp_start[workerid] + worker_exp_len[workerid];
 	ntasks[workerid]--;
 	_STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);

+ 1 - 2
src/sched_policies/random_policy.c

@@ -79,8 +79,7 @@ static int _random_push_task(struct starpu_task *task, unsigned prio)
                 workers->deinit_cursor(workers);
 
 	/* we should now have the best worker in variable "selected" */
-	int n = starpu_push_local_task(selected, task, prio);
-	return n;
+	return starpu_push_local_task(selected, task, prio);
 }
 
 static int random_push_task(struct starpu_task *task)

+ 1 - 2
src/sched_policies/stack_queues.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2010-2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -62,7 +62,6 @@ void _starpu_stack_push_task(struct _starpu_stack_jobq *stack_queue, _starpu_pth
 	_STARPU_PTHREAD_MUTEX_LOCK(sched_mutex);
 	total_number_of_jobs++;
 
-	_STARPU_TRACE_JOB_PUSH(task, 0);
 	if (task->task->priority)
 		_starpu_job_list_push_back(stack_queue->jobq, task);
 	else

+ 0 - 1
src/sched_policies/work_stealing_policy.c

@@ -323,7 +323,6 @@ int ws_push_task(struct starpu_task *task)
 
 	deque_queue = ws->queue_array[workerid];
 
-	_STARPU_TRACE_JOB_PUSH(task, 0);
 #ifdef HAVE_AYUDAME_H
 	if (AYU_event)
 	{

+ 0 - 2
src/top/starpu_top.c

@@ -106,11 +106,9 @@ static void starpu_top_get_device_type(int id, char* type)
 	case STARPU_GORDON_WORKER:
 		strncpy(type, "GORDON",9);
 		break;
-#ifdef STARPU_USE_SCHED_CTX_HYPERVISOR
 	case STARPU_ANY_WORKER:
 		strncpy(type, "ANY",9);
 		break;
-#endif
 	}
 }