Explorar el Código

Add support for letting a schedule choose its own set of workers without having to care about combined workers. This only works for SPMD however, not FORKJOIN

Samuel Thibault hace 11 años
padre
commit
7c03c945f7
Se han modificado 4 ficheros con 25 adiciones y 9 borrados
  1. 2 0
      ChangeLog
  2. 6 1
      doc/doxygen/chapters/api/parallel_tasks.doxy
  3. 1 0
      include/starpu_task.h
  4. 16 8
      src/core/parallel_task.c

+ 2 - 0
ChangeLog

@@ -71,6 +71,8 @@ Small features:
   * New STARPU_DISABLE_KERNELS environment variable to disable actual kernel
     execution.
   * New starpu_memory_get_total function to get the size of a memory node.
+  * New starpu_parallel_task_barrier_init_n function to let a scheduler decide
+    a set of workers without going through combined workers.
 
 Changes:
   * Data interfaces (variable, vector, matrix and block) now define

+ 6 - 1
doc/doxygen/chapters/api/parallel_tasks.doxy

@@ -45,7 +45,12 @@ workers
 \fn void starpu_parallel_task_barrier_init(struct starpu_task *task, int workerid)
 \ingroup API_Parallel_Tasks
 Initialise the barrier for the parallel task, and dispatch the task
-between the different combined workers.
+between the different workers of the given combined worker.
+
+\fn void starpu_parallel_task_barrier_init_n(struct starpu_task *task, int worker_size)
+\ingroup API_Parallel_Tasks
+Initialise the barrier for the parallel task, to be pushed to \e worker_size
+workers (without having to explicit a given combined worker).
 
 */
 

+ 1 - 0
include/starpu_task.h

@@ -257,6 +257,7 @@ void starpu_codelet_display_stats(struct starpu_codelet *cl);
 struct starpu_task *starpu_task_get_current(void);
 
 void starpu_parallel_task_barrier_init(struct starpu_task *task, int workerid);
+void starpu_parallel_task_barrier_init_n(struct starpu_task *task, int worker_size);
 
 struct starpu_task *starpu_task_dup(struct starpu_task *task);
 

+ 16 - 8
src/core/parallel_task.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010  Université de Bordeaux 1
+ * Copyright (C) 2010, 2014  Université de Bordeaux 1
  *
  * 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
@@ -34,16 +34,11 @@ struct starpu_task *starpu_task_dup(struct starpu_task *task)
 	return task_dup;
 }
 
-void starpu_parallel_task_barrier_init(struct starpu_task* task, int workerid)
+void starpu_parallel_task_barrier_init_n(struct starpu_task* task, int worker_size)
 {
-	/* The master needs to dispatch the task between the
-	 * different combined workers */
-	struct _starpu_combined_worker *combined_worker =  _starpu_get_combined_worker_struct(workerid);
-	int worker_size = combined_worker->worker_size;
-
 	struct _starpu_job *j = _starpu_get_job_associated_to_task(task);
 	j->task_size = worker_size;
-	j->combined_workerid = workerid;
+	j->combined_workerid = -1;
 	j->active_task_alias_count = 0;
 
 	//fprintf(stderr, "POP -> size %d best_size %d\n", worker_size, best_size);
@@ -54,3 +49,16 @@ void starpu_parallel_task_barrier_init(struct starpu_task* task, int workerid)
 	return;
 }
 
+void starpu_parallel_task_barrier_init(struct starpu_task* task, int workerid)
+{
+	/* The master needs to dispatch the task between the
+	 * different combined workers */
+	struct _starpu_combined_worker *combined_worker =  _starpu_get_combined_worker_struct(workerid);
+	int worker_size = combined_worker->worker_size;
+	struct _starpu_job *j = _starpu_get_job_associated_to_task(task);
+
+	starpu_parallel_task_barrier_init_n(task, worker_size);
+
+	j->combined_workerid = workerid;
+}
+