|
@@ -532,39 +532,45 @@ static int _dmda_push_task(struct starpu_task *task, unsigned prio, struct starp
|
|
|
return push_task_on_best_worker(task, best, model_best, prio);
|
|
|
}
|
|
|
|
|
|
-static int dmda_push_sorted_task(struct starpu_task *task, struct starpu_sched_ctx *sched_ctx)
|
|
|
+static int dmda_push_sorted_task(struct starpu_task *task, int sched_ctx_id)
|
|
|
{
|
|
|
- return _dmda_push_task(task, 2, sched_ctx);
|
|
|
+ struct starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx(sched_ctx_id);
|
|
|
+ return _dmda_push_task(task, 2, sched_ctx);
|
|
|
}
|
|
|
|
|
|
-static int dm_push_prio_task(struct starpu_task *task, struct starpu_sched_ctx *sched_ctx)
|
|
|
+static int dm_push_prio_task(struct starpu_task *task, int sched_ctx_id)
|
|
|
{
|
|
|
+ struct starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx(sched_ctx_id);
|
|
|
return _dm_push_task(task, 1, sched_ctx);
|
|
|
}
|
|
|
|
|
|
-static int dm_push_task(struct starpu_task *task, struct starpu_sched_ctx *sched_ctx)
|
|
|
+static int dm_push_task(struct starpu_task *task, int sched_ctx_id)
|
|
|
{
|
|
|
+ struct starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx(sched_ctx_id);
|
|
|
if (task->priority > 0)
|
|
|
return _dm_push_task(task, 1, sched_ctx);
|
|
|
|
|
|
return _dm_push_task(task, 0, sched_ctx);
|
|
|
}
|
|
|
|
|
|
-static int dmda_push_prio_task(struct starpu_task *task, struct starpu_sched_ctx *sched_ctx)
|
|
|
+static int dmda_push_prio_task(struct starpu_task *task, int sched_ctx_id)
|
|
|
{
|
|
|
+ struct starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx(sched_ctx_id);
|
|
|
return _dmda_push_task(task, 1, sched_ctx);
|
|
|
}
|
|
|
|
|
|
-static int dmda_push_task(struct starpu_task *task, struct starpu_sched_ctx *sched_ctx)
|
|
|
+static int dmda_push_task(struct starpu_task *task, int sched_ctx_id)
|
|
|
{
|
|
|
+ struct starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx(sched_ctx_id);
|
|
|
if (task->priority > 0)
|
|
|
return _dmda_push_task(task, 1, sched_ctx);
|
|
|
|
|
|
return _dmda_push_task(task, 0, sched_ctx);
|
|
|
}
|
|
|
|
|
|
-static void initialize_dmda_policy(struct starpu_sched_ctx *sched_ctx)
|
|
|
+static void initialize_dmda_policy(int sched_ctx_id)
|
|
|
{
|
|
|
+ struct starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx(sched_ctx_id);
|
|
|
nworkers = sched_ctx->nworkers_in_ctx;
|
|
|
|
|
|
const char *strval_alpha = getenv("STARPU_SCHED_ALPHA");
|
|
@@ -592,17 +598,18 @@ static void initialize_dmda_policy(struct starpu_sched_ctx *sched_ctx)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void initialize_dmda_sorted_policy(struct starpu_sched_ctx *sched_ctx)
|
|
|
+static void initialize_dmda_sorted_policy(int sched_ctx_id)
|
|
|
{
|
|
|
- initialize_dmda_policy(sched_ctx);
|
|
|
+ initialize_dmda_policy(sched_ctx_id);
|
|
|
|
|
|
/* The application may use any integer */
|
|
|
starpu_sched_set_min_priority(INT_MIN);
|
|
|
starpu_sched_set_max_priority(INT_MAX);
|
|
|
}
|
|
|
|
|
|
-static void deinitialize_dmda_policy(struct starpu_sched_ctx *sched_ctx)
|
|
|
+static void deinitialize_dmda_policy(int sched_ctx_id)
|
|
|
{
|
|
|
+ struct starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx(sched_ctx_id);
|
|
|
unsigned workerid;
|
|
|
int workerid_in_ctx;
|
|
|
int nworkers = sched_ctx->nworkers_in_ctx;
|