Przeglądaj źródła

rename starpu_sched_ctx_worker_collection to starpu_worker_collection & move definition of the corresponding structure in starpu_worker.h

Andra Hugo 12 lat temu
rodzic
commit
021aff4d1c

+ 12 - 12
doc/chapters/advanced-api.texi

@@ -826,7 +826,7 @@ This function removes the workers indicated in the first argument from the conte
 A scheduling context manages a collection of workers that can be memorized using different data structures. Thus, a generic structure is available in order to simplify the choice of its type.
 Only the list data structure is available but further data structures(like tree) implementations are foreseen.
 
-@deftp {Data Type} {struct starpu_sched_ctx_worker_collection}
+@deftp {Data Type} {struct starpu_worker_collection}
 @table @asis
 @item @code{void *workerids}
 The workerids managed by the collection
@@ -835,28 +835,28 @@ The number of workerids
 @item @code{pthread_key_t cursor_key} (optional)
 The cursor needed to iterate the collection (depending on the data structure)
 @item @code{int type}
-The type of structure (currently STARPU_SCHED_CTX_WORKER_LIST is the only one available)
-@item @code{unsigned (*has_next)(struct starpu_sched_ctx_worker_collection *workers)}
+The type of structure (currently STARPU_WORKER_LIST is the only one available)
+@item @code{unsigned (*has_next)(struct starpu_worker_collection *workers)}
 Checks if there is a next worker
-@item @code{int (*get_next)(struct starpu_sched_ctx_worker_collection *workers)}
+@item @code{int (*get_next)(struct starpu_worker_collection *workers)}
 Gets the next worker
-@item @code{int (*add)(struct starpu_sched_ctx_worker_collection *workers, int worker)}
+@item @code{int (*add)(struct starpu_worker_collection *workers, int worker)}
 Adds a worker to the collection
-@item @code{int (*remove)(struct starpu_sched_ctx_worker_collection *workers, int worker)}
+@item @code{int (*remove)(struct starpu_worker_collection *workers, int worker)}
 Removes a worker from the collection
-@item @code{void* (*init)(struct starpu_sched_ctx_worker_collection *workers)}
+@item @code{void* (*init)(struct starpu_worker_collection *workers)}
 Initialize the collection
-@item @code{void (*deinit)(struct starpu_sched_ctx_worker_collection *workers)}
+@item @code{void (*deinit)(struct starpu_worker_collection *workers)}
 Deinitialize the colection
-@item @code{void (*init_cursor)(struct starpu_sched_ctx_worker_collection *workers)} (optional)
+@item @code{void (*init_cursor)(struct starpu_worker_collection *workers)} (optional)
 Initialize the cursor if there is one
-@item @code{void (*deinit_cursor)(struct starpu_sched_ctx_worker_collection *workers)} (optional)
+@item @code{void (*deinit_cursor)(struct starpu_worker_collection *workers)} (optional)
 Deinitialize the cursor if there is one
 
 @end table
 @end deftp
 
-@deftypefun struct starpu_sched_ctx_worker_collection* starpu_sched_ctx_create_worker_collection (unsigned @var{sched_ctx_id}, int @var{type})
+@deftypefun struct starpu_worker_collection* starpu_sched_ctx_create_worker_collection (unsigned @var{sched_ctx_id}, int @var{type})
 Create a worker collection of the type indicated by the last parameter for the context specified through the first parameter.
 @end deftypefun
 
@@ -864,7 +864,7 @@ Create a worker collection of the type indicated by the last parameter for the c
 Delete the worker collection of the specified scheduling context
 @end deftypefun
 
-@deftypefun struct starpu_sched_ctx_worker_collection* starpu_sched_ctx_get_worker_collection (unsigned @var{sched_ctx_id})
+@deftypefun struct starpu_worker_collection* starpu_sched_ctx_get_worker_collection (unsigned @var{sched_ctx_id})
 Return the worker collection managed by the indicated context
 @end deftypefun
 

+ 2 - 2
examples/scheduler/dummy_sched.c

@@ -28,7 +28,7 @@ typedef struct dummy_sched_data {
 
 static void init_dummy_sched(unsigned sched_ctx_id)
 {
-	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_SCHED_CTX_WORKER_LIST);
+	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 
 	struct dummy_sched_data *data = (struct dummy_sched_data*)malloc(sizeof(struct dummy_sched_data));
 	
@@ -79,7 +79,7 @@ static int push_task_dummy(struct starpu_task *task)
         /*if there are no tasks block */
         /* wake people waiting for a task */
         unsigned worker = 0;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 
         struct starpu_sched_ctx_iterator it;
         if(workers->init_iterator)

+ 2 - 37
include/starpu_sched_ctx.h

@@ -24,41 +24,6 @@ extern "C"
 {
 #endif
 
-//struct starpu_sched_ctx_iterator;
-struct starpu_sched_ctx_iterator
-{
-	int cursor;
-};
-
-
-/* generic structure used by the scheduling contexts to iterate the workers */
-struct starpu_sched_ctx_worker_collection
-{
-	/* hidden data structure used to memorize the workers */
-	void *workerids;
-	/* the number of workers in the collection */
-	unsigned nworkers;
-	/* the type of structure (STARPU_SCHED_CTX_WORKER_LIST,...) */
-	int type;
-	/* checks if there is another element in collection */
-	unsigned (*has_next)(struct starpu_sched_ctx_worker_collection *workers, struct starpu_sched_ctx_iterator *it);
-	/* return the next element in the collection */
-	int (*get_next)(struct starpu_sched_ctx_worker_collection *workers, struct starpu_sched_ctx_iterator *it);
-	/* add a new element in the collection */
-	int (*add)(struct starpu_sched_ctx_worker_collection *workers, int worker);
-	/* remove an element from the collection */
-	int (*remove)(struct starpu_sched_ctx_worker_collection *workers, int worker);
-	/* initialize the structure */
-	void (*init)(struct starpu_sched_ctx_worker_collection *workers);
-	/* free the structure */
-	void (*deinit)(struct starpu_sched_ctx_worker_collection *workers);
-	/* initialize the cursor if there is one */
-	void (*init_iterator)(struct starpu_sched_ctx_worker_collection *workers, struct starpu_sched_ctx_iterator *it);
-};
-
-/* types of structures the worker collection can implement */
-#define STARPU_SCHED_CTX_WORKER_LIST 0
-
 struct starpu_sched_ctx_performance_counters
 {
 	void (*notify_idle_cycle)(unsigned sched_ctx_id, int worker, double idle_time);
@@ -91,11 +56,11 @@ void starpu_sched_ctx_set_policy_data(unsigned sched_ctx_id, void *policy_data);
 
 void* starpu_sched_ctx_get_policy_data(unsigned sched_ctx_id);
 
-struct starpu_sched_ctx_worker_collection* starpu_sched_ctx_create_worker_collection(unsigned sched_ctx_id, int type);
+struct starpu_worker_collection* starpu_sched_ctx_create_worker_collection(unsigned sched_ctx_id, int type);
 
 void starpu_sched_ctx_delete_worker_collection(unsigned sched_ctx_id);
 
-struct starpu_sched_ctx_worker_collection* starpu_sched_ctx_get_worker_collection(unsigned sched_ctx_id);
+struct starpu_worker_collection* starpu_sched_ctx_get_worker_collection(unsigned sched_ctx_id);
 
 #if !defined(_MSC_VER) && !defined(STARPU_SIMGRID)
 pthread_mutex_t* starpu_sched_ctx_get_changing_ctx_mutex(unsigned sched_ctx_id);

+ 34 - 0
include/starpu_worker.h

@@ -34,6 +34,40 @@ enum starpu_archtype
 	STARPU_OPENCL_WORKER  /* OpenCL device */
 };
 
+struct starpu_sched_ctx_iterator
+{
+	int cursor;
+};
+
+
+/* generic structure used by the scheduling contexts to iterate the workers */
+struct starpu_worker_collection
+{
+	/* hidden data structure used to memorize the workers */
+	void *workerids;
+	/* the number of workers in the collection */
+	unsigned nworkers;
+	/* the type of structure (STARPU_WORKER_LIST,...) */
+	int type;
+	/* checks if there is another element in collection */
+	unsigned (*has_next)(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it);
+	/* return the next element in the collection */
+	int (*get_next)(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it);
+	/* add a new element in the collection */
+	int (*add)(struct starpu_worker_collection *workers, int worker);
+	/* remove an element from the collection */
+	int (*remove)(struct starpu_worker_collection *workers, int worker);
+	/* initialize the structure */
+	void (*init)(struct starpu_worker_collection *workers);
+	/* free the structure */
+	void (*deinit)(struct starpu_worker_collection *workers);
+	/* initialize the cursor if there is one */
+	void (*init_iterator)(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it);
+};
+
+/* types of structures the worker collection can implement */
+#define STARPU_WORKER_LIST 0
+
 /* This function returns the number of workers (ie. processing units executing
  * StarPU tasks). The returned value should be at most STARPU_NMAXWORKERS. */
 unsigned starpu_worker_get_count(void);

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

@@ -72,7 +72,7 @@ static int* _get_slowest_workers(unsigned sched_ctx, int *nworkers, enum starpu_
 	for(i = 0; i < *nworkers; i++)
 		curr_workers[i] = -1;
 
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 	int index;
 	int worker;
 	int considered = 0;

+ 6 - 6
sched_ctx_hypervisor/src/hypervisor_policies/policy_tools.c

@@ -25,7 +25,7 @@ static int _compute_priority(unsigned sched_ctx)
 
 	int total_priority = 0;
 
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 	int worker;
 
 	struct starpu_sched_ctx_iterator it;
@@ -113,7 +113,7 @@ int* _get_first_workers(unsigned sched_ctx, int *nworkers, enum starpu_archtype
 	for(i = 0; i < *nworkers; i++)
 		curr_workers[i] = -1;
 
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 	int index;
 	int worker;
 	int considered = 0;
@@ -180,7 +180,7 @@ int* _get_first_workers(unsigned sched_ctx, int *nworkers, enum starpu_archtype
 /* get the number of workers in the context that are allowed to be moved (that are not fixed) */
 unsigned _get_potential_nworkers(struct sched_ctx_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_archtype arch)
 {
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 
 	unsigned potential_workers = 0;
 	int worker;
@@ -304,7 +304,7 @@ unsigned _resize_to_unknown_receiver(unsigned sender_sched_ctx, unsigned now)
 
 static double _get_ispeed_sample_for_type_of_worker(struct sched_ctx_hypervisor_wrapper* sc_w, enum starpu_archtype req_arch)
 {
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
         int worker;
 
 	double avg = 0.0;
@@ -330,7 +330,7 @@ static double _get_ispeed_sample_for_type_of_worker(struct sched_ctx_hypervisor_
 
 static double _get_ispeed_sample_for_sched_ctx(unsigned sched_ctx)
 {
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 	struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sched_ctx);
         
 	int worker;
@@ -485,7 +485,7 @@ double _get_velocity_per_worker(struct sched_ctx_hypervisor_wrapper *sc_w, unsig
 static double _get_best_elapsed_flops(struct sched_ctx_hypervisor_wrapper* sc_w, int *npus, enum starpu_archtype req_arch)
 {
 	double ret_val = 0.0;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
         int worker;
 
 	struct starpu_sched_ctx_iterator it;

+ 3 - 3
sched_ctx_hypervisor/src/hypervisor_policies/simple_policy.c

@@ -23,7 +23,7 @@ static int _compute_priority(unsigned sched_ctx)
 
 	int total_priority = 0;
 
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 	int worker;
 	
 	starpu_iterator it;
@@ -80,7 +80,7 @@ int* _get_first_workers(unsigned sched_ctx, unsigned *nworkers, enum starpu_arch
 	for(i = 0; i < *nworkers; i++)
 		curr_workers[i] = -1;
 
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 	int index;
 	int worker;
 	int considered = 0;
@@ -146,7 +146,7 @@ int* _get_first_workers(unsigned sched_ctx, unsigned *nworkers, enum starpu_arch
 
 static unsigned _get_potential_nworkers(struct sched_ctx_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_archtype arch)
 {
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 
 	unsigned potential_workers = 0;
 	int worker;

+ 3 - 3
sched_ctx_hypervisor/src/sched_ctx_hypervisor.c

@@ -341,7 +341,7 @@ void sched_ctx_hypervisor_unregister_ctx(unsigned sched_ctx)
 static double _get_best_total_elapsed_flops(struct sched_ctx_hypervisor_wrapper* sc_w, int *npus, enum starpu_archtype req_arch)
 {
 	double ret_val = 0.0;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
         int worker;
 
 	struct starpu_sched_ctx_iterator it;
@@ -388,7 +388,7 @@ double _get_ref_velocity_per_worker_type(struct sched_ctx_hypervisor_wrapper* sc
 	double ref_velocity = 0.0;
 	unsigned nw = 0;
 
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
 	int worker;
 
 	struct starpu_sched_ctx_iterator it;
@@ -439,7 +439,7 @@ static void _get_cpus(int *workers, int nworkers, int *cpus, int *ncpus)
 int sched_ctx_hypervisor_get_nworkers_ctx(unsigned sched_ctx, enum starpu_archtype arch)
 {
 	int nworkers_ctx = 0;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 	int worker;
 
 	struct starpu_sched_ctx_iterator it;

+ 13 - 13
src/core/sched_ctx.c

@@ -20,7 +20,7 @@
 
 _starpu_pthread_mutex_t changing_ctx_mutex[STARPU_NMAX_SCHED_CTXS];
 
-extern struct starpu_sched_ctx_worker_collection worker_list;
+extern struct starpu_worker_collection worker_list;
 static _starpu_pthread_mutex_t sched_ctx_manag = _STARPU_PTHREAD_MUTEX_INITIALIZER;
 static _starpu_pthread_mutex_t finished_submit_mutex = _STARPU_PTHREAD_MUTEX_INITIALIZER;
 struct starpu_task stop_submission_task = STARPU_TASK_INITIALIZER;
@@ -133,7 +133,7 @@ void starpu_sched_ctx_stop_task_submission()
 static void _starpu_add_workers_to_sched_ctx(struct _starpu_sched_ctx *sched_ctx, int *workerids, int nworkers,
 				       int *added_workers, int *n_added_workers)
 {
-	struct starpu_sched_ctx_worker_collection *workers = sched_ctx->workers;
+	struct starpu_worker_collection *workers = sched_ctx->workers;
 	struct _starpu_machine_config *config = (struct _starpu_machine_config *)_starpu_get_machine_config();
 
 	int nworkers_to_add = nworkers == -1 ? (int)config->topology.nworkers : nworkers;
@@ -181,7 +181,7 @@ static void _starpu_add_workers_to_sched_ctx(struct _starpu_sched_ctx *sched_ctx
 static void _starpu_remove_workers_from_sched_ctx(struct _starpu_sched_ctx *sched_ctx, int *workerids,
 						  int nworkers, int *removed_workers, int *n_removed_workers)
 {
-	struct starpu_sched_ctx_worker_collection *workers = sched_ctx->workers;
+	struct starpu_worker_collection *workers = sched_ctx->workers;
 
 	int i = 0;
 
@@ -807,14 +807,14 @@ void* starpu_sched_ctx_get_policy_data(unsigned sched_ctx_id)
 	return sched_ctx->policy_data;
 }
 
-struct starpu_sched_ctx_worker_collection* starpu_sched_ctx_create_worker_collection(unsigned sched_ctx_id, int worker_collection_type)
+struct starpu_worker_collection* starpu_sched_ctx_create_worker_collection(unsigned sched_ctx_id, int worker_collection_type)
 {
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
-	sched_ctx->workers = (struct starpu_sched_ctx_worker_collection*)malloc(sizeof(struct starpu_sched_ctx_worker_collection));
+	sched_ctx->workers = (struct starpu_worker_collection*)malloc(sizeof(struct starpu_worker_collection));
 
 	switch(worker_collection_type)
 	{
-	case STARPU_SCHED_CTX_WORKER_LIST:
+	case STARPU_WORKER_LIST:
 		sched_ctx->workers->has_next = worker_list.has_next;
 		sched_ctx->workers->get_next = worker_list.get_next;
 		sched_ctx->workers->add = worker_list.add;
@@ -822,7 +822,7 @@ struct starpu_sched_ctx_worker_collection* starpu_sched_ctx_create_worker_collec
 		sched_ctx->workers->init = worker_list.init;
 		sched_ctx->workers->deinit = worker_list.deinit;
 		sched_ctx->workers->init_iterator = worker_list.init_iterator;
-		sched_ctx->workers->type = STARPU_SCHED_CTX_WORKER_LIST;
+		sched_ctx->workers->type = STARPU_WORKER_LIST;
 		break;
 	}
 
@@ -831,7 +831,7 @@ struct starpu_sched_ctx_worker_collection* starpu_sched_ctx_create_worker_collec
 
 static unsigned _get_workers_list(struct _starpu_sched_ctx *sched_ctx, int **workerids)
 {
-	struct starpu_sched_ctx_worker_collection *workers = sched_ctx->workers;
+	struct starpu_worker_collection *workers = sched_ctx->workers;
 	*workerids = (int*)malloc(workers->nworkers*sizeof(int));
 	int worker;
 	unsigned nworkers = 0;
@@ -854,7 +854,7 @@ void starpu_sched_ctx_delete_worker_collection(unsigned sched_ctx_id)
 	free(sched_ctx->workers);
 }
 
-struct starpu_sched_ctx_worker_collection* starpu_sched_ctx_get_worker_collection(unsigned sched_ctx_id)
+struct starpu_worker_collection* starpu_sched_ctx_get_worker_collection(unsigned sched_ctx_id)
 {
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
 	return sched_ctx->workers;
@@ -864,7 +864,7 @@ int starpu_get_workers_of_sched_ctx(unsigned sched_ctx_id, int *pus, enum starpu
 {
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
 
-	struct starpu_sched_ctx_worker_collection *workers = sched_ctx->workers;
+	struct starpu_worker_collection *workers = sched_ctx->workers;
 	int worker;
 
 	int npus = 0;
@@ -903,8 +903,8 @@ unsigned starpu_sched_ctx_get_nshared_workers(unsigned sched_ctx_id, unsigned sc
         struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
         struct _starpu_sched_ctx *sched_ctx2 = _starpu_get_sched_ctx_struct(sched_ctx_id2);
 
-        struct starpu_sched_ctx_worker_collection *workers = sched_ctx->workers;
-        struct starpu_sched_ctx_worker_collection *workers2 = sched_ctx2->workers;
+        struct starpu_worker_collection *workers = sched_ctx->workers;
+        struct starpu_worker_collection *workers2 = sched_ctx2->workers;
         int worker, worker2;
         int shared_workers = 0;
 
@@ -940,7 +940,7 @@ unsigned starpu_sched_ctx_contains_worker(int workerid, unsigned sched_ctx_id)
 /* 	} */
         struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
 
-        struct starpu_sched_ctx_worker_collection *workers = sched_ctx->workers;
+        struct starpu_worker_collection *workers = sched_ctx->workers;
         int worker;
 
 	struct starpu_sched_ctx_iterator it;

+ 1 - 1
src/core/sched_ctx.h

@@ -46,7 +46,7 @@ struct _starpu_sched_ctx
 	/* data necessary for the policy */
 	void *policy_data;
 
-	struct starpu_sched_ctx_worker_collection *workers;
+	struct starpu_worker_collection *workers;
 
 	/* we keep an initial sched which we never delete */
 	unsigned is_initial_sched;

+ 1 - 1
src/core/sched_policy.c

@@ -296,7 +296,7 @@ static int _starpu_push_task_on_specific_worker(struct starpu_task *task, int wo
 static int _starpu_nworkers_able_to_execute_task(struct starpu_task *task, struct _starpu_sched_ctx *sched_ctx)
 {
 	int worker = -1, nworkers = 0;
-	struct starpu_sched_ctx_worker_collection *workers = sched_ctx->workers;
+	struct starpu_worker_collection *workers = sched_ctx->workers;
 
 	struct starpu_sched_ctx_iterator it;
 	if(workers->init_iterator)

+ 1 - 1
src/core/workers.c

@@ -1310,7 +1310,7 @@ int starpu_worker_get_nids_ctx_free_by_type(enum starpu_archtype type, int *work
 			{
 				if(config.sched_ctxs[s].id != STARPU_NMAX_SCHED_CTXS)
 				{
-					struct starpu_sched_ctx_worker_collection *workers = config.sched_ctxs[s].workers;
+					struct starpu_worker_collection *workers = config.sched_ctxs[s].workers;
 					struct starpu_sched_ctx_iterator it;
 					if(workers->init_iterator)
 						workers->init_iterator(workers, &it);

+ 4 - 4
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -375,7 +375,7 @@ static int _dm_push_task(struct starpu_task *task, unsigned prio, unsigned sched
 
 	unsigned best_impl = 0;
 	unsigned nimpl;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 
 	struct starpu_sched_ctx_iterator it;
 	if(workers->init_iterator)
@@ -496,7 +496,7 @@ static void compute_all_performance_predictions(struct starpu_task *task,
 
 	starpu_task_bundle_t bundle = task->bundle;
 	struct _starpu_dmda_data *dt = (struct _starpu_dmda_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 
 	struct starpu_sched_ctx_iterator it;
 	if(workers->init_iterator)
@@ -615,7 +615,7 @@ static int _dmda_push_task(struct starpu_task *task, unsigned prio, unsigned sch
 	int forced_impl = -1;
 
 	struct _starpu_dmda_data *dt = (struct _starpu_dmda_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 	unsigned nworkers_ctx = workers->nworkers;
 	double local_task_length[STARPU_NMAXWORKERS][STARPU_MAXIMPLEMENTATIONS];
 	double local_data_penalty[STARPU_NMAXWORKERS][STARPU_MAXIMPLEMENTATIONS];
@@ -817,7 +817,7 @@ static void dmda_remove_workers(unsigned sched_ctx_id, int *workerids, unsigned
 
 static void initialize_dmda_policy(unsigned sched_ctx_id)
 {
-	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_SCHED_CTX_WORKER_LIST);
+	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 
 	struct _starpu_dmda_data *dt = (struct _starpu_dmda_data*)malloc(sizeof(struct _starpu_dmda_data));
 	dt->alpha = _STARPU_DEFAULT_ALPHA;

+ 4 - 4
src/sched_policies/detect_combined_workers.c

@@ -85,7 +85,7 @@ static void synthesize_intermediate_workers(hwloc_obj_t *children, unsigned min,
 				unsigned sched_ctx_id  = starpu_sched_ctx_get_context();
 				if(sched_ctx_id == STARPU_NMAX_SCHED_CTXS)
 					sched_ctx_id = 0;
-				struct starpu_sched_ctx_worker_collection* workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+				struct starpu_worker_collection* workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 
 				_STARPU_DEBUG("Adding it\n");
 				ret = starpu_combined_worker_assign_workerid(nworkers, cpu_workers);
@@ -138,7 +138,7 @@ static void find_and_assign_combinations(hwloc_obj_t obj, unsigned min, unsigned
 		if(sched_ctx_id == STARPU_NMAX_SCHED_CTXS)
 			sched_ctx_id = 0;
 
-		struct starpu_sched_ctx_worker_collection* workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+		struct starpu_worker_collection* workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 
 		int newworkerid = starpu_combined_worker_assign_workerid(nworkers, cpu_workers);
 		STARPU_ASSERT(newworkerid >= 0);
@@ -200,7 +200,7 @@ static void find_and_assign_combinations_without_hwloc(int *workerids, int nwork
 	int min;
 	int max;
 
-	struct starpu_sched_ctx_worker_collection* workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection* workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 
 	/* We put the id of all CPU workers in this array */
 	int cpu_workers[STARPU_NMAXWORKERS];
@@ -253,7 +253,7 @@ static void combine_all_cpu_workers(int *workerids, int nworkers)
 	unsigned sched_ctx_id  = starpu_sched_ctx_get_context();
 	if(sched_ctx_id == STARPU_NMAX_SCHED_CTXS)
 		sched_ctx_id = 0;
-	struct starpu_sched_ctx_worker_collection* workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection* workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 	int cpu_workers[STARPU_NMAXWORKERS];
 	int ncpus = 0;
 	struct _starpu_worker *worker;

+ 2 - 2
src/sched_policies/eager_central_policy.c

@@ -32,7 +32,7 @@ struct _starpu_eager_center_policy_data
 
 static void initialize_eager_center_policy(unsigned sched_ctx_id)
 {
-	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_SCHED_CTX_WORKER_LIST);
+	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 
 	struct _starpu_eager_center_policy_data *data = (struct _starpu_eager_center_policy_data*)malloc(sizeof(struct _starpu_eager_center_policy_data));
 
@@ -86,7 +86,7 @@ static int push_task_eager_policy(struct starpu_task *task)
 	/*if there are no tasks block */
 	/* wake people waiting for a task */
 	unsigned worker = 0;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 	
 	struct starpu_sched_ctx_iterator it;
 	if(workers->init_iterator)

+ 3 - 3
src/sched_policies/eager_central_priority_policy.c

@@ -76,7 +76,7 @@ static void _starpu_destroy_priority_taskq(struct _starpu_priority_taskq *priori
 
 static void initialize_eager_center_priority_policy(unsigned sched_ctx_id)
 {
-	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_SCHED_CTX_WORKER_LIST);
+	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	struct _starpu_eager_central_prio_data *data = (struct _starpu_eager_central_prio_data*)malloc(sizeof(struct _starpu_eager_central_prio_data));
 
 	/* In this policy, we support more than two levels of priority. */
@@ -135,7 +135,7 @@ static int _starpu_priority_push_task(struct starpu_task *task)
 	/*if there are no tasks block */
 	/* wake people waiting for a task */
 	unsigned worker = 0;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 	
 	struct starpu_sched_ctx_iterator it;
 	if(workers->init_iterator)
@@ -223,7 +223,7 @@ static struct starpu_task *_starpu_priority_pop_task(unsigned sched_ctx_id)
 	{
 		/* Notify another worker to do that task */
 		unsigned worker = 0;
-		struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+		struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 
 		struct starpu_sched_ctx_iterator it;
 		if(workers->init_iterator)

+ 2 - 2
src/sched_policies/parallel_eager.c

@@ -128,7 +128,7 @@ static void peager_remove_workers(unsigned sched_ctx_id, int *workerids, unsigne
 
 static void initialize_peager_policy(unsigned sched_ctx_id)
 {
-	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_SCHED_CTX_WORKER_LIST);
+	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 
 	struct _starpu_peager_data *data = (struct _starpu_peager_data*)malloc(sizeof(struct _starpu_peager_data));
 	/* masters pick tasks from that queue */
@@ -168,7 +168,7 @@ static int push_task_peager_policy(struct starpu_task *task)
 	}
 	struct _starpu_peager_data *data = (struct _starpu_peager_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	int worker = 0;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 	
 	struct starpu_sched_ctx_iterator it;
 	if(workers->init_iterator)

+ 2 - 2
src/sched_policies/parallel_heft.c

@@ -244,7 +244,7 @@ static int _parallel_heft_push_task(struct starpu_task *task, unsigned prio, uns
 {
 	struct _starpu_pheft_data *hd = (struct _starpu_pheft_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
 
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 	unsigned nworkers_ctx = workers->nworkers;
 
 	unsigned worker, worker_ctx = 0;
@@ -535,7 +535,7 @@ static void parallel_heft_add_workers(unsigned sched_ctx_id, int *workerids, uns
 
 static void initialize_parallel_heft_policy(unsigned sched_ctx_id)
 {
-	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_SCHED_CTX_WORKER_LIST);
+	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	struct _starpu_pheft_data *hd = (struct _starpu_pheft_data*)malloc(sizeof(struct _starpu_pheft_data));
 	hd->alpha = _STARPU_DEFAULT_ALPHA;
 	hd->beta = _STARPU_DEFAULT_BETA;

+ 2 - 2
src/sched_policies/random_policy.c

@@ -34,7 +34,7 @@ static int _random_push_task(struct starpu_task *task, unsigned prio)
 	double alpha_sum = 0.0;
 
 	unsigned sched_ctx_id = task->sched_ctx;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
         int worker;
 	struct starpu_sched_ctx_iterator it;
         if(workers->init_iterator)
@@ -103,7 +103,7 @@ static int random_push_task(struct starpu_task *task)
 
 static void initialize_random_policy(unsigned sched_ctx_id)
 {
-	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_SCHED_CTX_WORKER_LIST);
+	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	starpu_srand48(time(NULL));
 }
 

+ 4 - 4
src/sched_policies/work_stealing_policy.c

@@ -146,7 +146,7 @@ static unsigned select_victim_overload(unsigned sched_ctx_id)
 	if (performed_total < calibration_value)
 		return select_victim_round_robin(sched_ctx_id);
 
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 
 	struct starpu_sched_ctx_iterator it;
         if(workers->init_iterator)
@@ -186,7 +186,7 @@ static unsigned select_worker_overload(unsigned sched_ctx_id)
 	if (performed_total < calibration_value)
 		return select_worker_round_robin(sched_ctx_id);
 
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 
 	struct starpu_sched_ctx_iterator it;
         if(workers->init_iterator)
@@ -335,7 +335,7 @@ int ws_push_task(struct starpu_task *task)
         }
 
 	unsigned worker = 0;
-	struct starpu_sched_ctx_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
+	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);
 	struct starpu_sched_ctx_iterator it;
 	if(workers->init_iterator)
 		workers->init_iterator(workers, &it);
@@ -420,7 +420,7 @@ static void ws_remove_workers(unsigned sched_ctx_id, int *workerids, unsigned nw
 
 static void initialize_ws_policy(unsigned sched_ctx_id)
 {
-	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_SCHED_CTX_WORKER_LIST);
+	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 
 	struct _starpu_work_stealing_data *ws = (struct _starpu_work_stealing_data*)malloc(sizeof(struct _starpu_work_stealing_data));
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)ws);

+ 10 - 10
src/worker_collection/worker_list.c

@@ -19,7 +19,7 @@
 #include <starpu.h>
 #include <pthread.h>
 
-static unsigned list_has_next(struct starpu_sched_ctx_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
+static unsigned list_has_next(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
 {
 	int nworkers = (int)workers->nworkers;
 	STARPU_ASSERT(it != NULL);
@@ -31,7 +31,7 @@ static unsigned list_has_next(struct starpu_sched_ctx_worker_collection *workers
 	return ret;
 }
 
-static int list_get_next(struct starpu_sched_ctx_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
+static int list_get_next(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
 {
 	int *workerids = (int *)workers->workerids;
 	int nworkers = (int)workers->nworkers;
@@ -43,7 +43,7 @@ static int list_get_next(struct starpu_sched_ctx_worker_collection *workers, str
 	return ret;
 }
 
-static unsigned _worker_belongs_to_ctx(struct starpu_sched_ctx_worker_collection *workers, int workerid)
+static unsigned _worker_belongs_to_ctx(struct starpu_worker_collection *workers, int workerid)
 {
 	int *workerids = (int *)workers->workerids;
 	unsigned nworkers = workers->nworkers;
@@ -57,7 +57,7 @@ static unsigned _worker_belongs_to_ctx(struct starpu_sched_ctx_worker_collection
 	return 0;
 }
 
-static int list_add(struct starpu_sched_ctx_worker_collection *workers, int worker)
+static int list_add(struct starpu_worker_collection *workers, int worker)
 {
 	int *workerids = (int *)workers->workerids;
 	unsigned *nworkers = &workers->nworkers;
@@ -105,7 +105,7 @@ static void _rearange_workerids(int *workerids, int old_nworkers)
 	  }
 }
 
-static int list_remove(struct starpu_sched_ctx_worker_collection *workers, int worker)
+static int list_remove(struct starpu_worker_collection *workers, int worker)
 {
 	int *workerids = (int *)workers->workerids;
 	unsigned nworkers = workers->nworkers;
@@ -137,7 +137,7 @@ static void _init_workers(int *workerids)
 	return;
 }
 
-static void list_init(struct starpu_sched_ctx_worker_collection *workers)
+static void list_init(struct starpu_worker_collection *workers)
 {
 	int *workerids = (int*)malloc(STARPU_NMAXWORKERS * sizeof(int));
 	_init_workers(workerids);
@@ -148,17 +148,17 @@ static void list_init(struct starpu_sched_ctx_worker_collection *workers)
 	return;
 }
 
-static void list_deinit(struct starpu_sched_ctx_worker_collection *workers)
+static void list_deinit(struct starpu_worker_collection *workers)
 {
 	free(workers->workerids);
 }
 
-static void list_init_iterator(struct starpu_sched_ctx_worker_collection *workers STARPU_ATTRIBUTE_UNUSED, struct starpu_sched_ctx_iterator *it)
+static void list_init_iterator(struct starpu_worker_collection *workers STARPU_ATTRIBUTE_UNUSED, struct starpu_sched_ctx_iterator *it)
 {
 	*((int*)it) = 0;
 }
 
-struct starpu_sched_ctx_worker_collection worker_list =
+struct starpu_worker_collection worker_list =
 {
 	.has_next = list_has_next,
 	.get_next = list_get_next,
@@ -167,6 +167,6 @@ struct starpu_sched_ctx_worker_collection worker_list =
 	.init = list_init,
 	.deinit = list_deinit,
 	.init_iterator = list_init_iterator,
-	.type = STARPU_SCHED_CTX_WORKER_LIST
+	.type = STARPU_WORKER_LIST
 };