|
@@ -576,22 +576,6 @@ int _starpu_push_task_to_workers(struct starpu_task *task)
|
|
|
{
|
|
|
struct _starpu_machine_config *config = _starpu_get_machine_config();
|
|
|
|
|
|
- /* When a task can only be executed on a given arch and we have
|
|
|
- * only one memory node for that arch, we can systematically
|
|
|
- * prefetch before the scheduling decision. */
|
|
|
- /* XXX: no, this is definitely not a good idea if the scheduler reorders tasks... */
|
|
|
- if (0 && starpu_get_prefetch_flag() && starpu_memory_nodes_get_count() > 1)
|
|
|
- {
|
|
|
- if (task->where == STARPU_CPU && config->cpus_nodeid >= 0)
|
|
|
- starpu_prefetch_task_input_on_node(task, config->cpus_nodeid);
|
|
|
- else if (task->where == STARPU_CUDA && config->cuda_nodeid >= 0)
|
|
|
- starpu_prefetch_task_input_on_node(task, config->cuda_nodeid);
|
|
|
- else if (task->where == STARPU_OPENCL && config->opencl_nodeid >= 0)
|
|
|
- starpu_prefetch_task_input_on_node(task, config->opencl_nodeid);
|
|
|
- else if (task->where == STARPU_MIC && config->mic_nodeid >= 0)
|
|
|
- starpu_prefetch_task_input_on_node(task, config->mic_nodeid);
|
|
|
- }
|
|
|
-
|
|
|
if(!sched_ctx->sched_policy)
|
|
|
{
|
|
|
/* Note: we have to call that early, or else the task may have
|
|
@@ -634,6 +618,23 @@ int _starpu_push_task_to_workers(struct starpu_task *task)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ /* When a task can only be executed on a given arch and we have
|
|
|
+ * only one memory node for that arch, we can systematically
|
|
|
+ * prefetch before the scheduling decision. */
|
|
|
+ if (!sched_ctx->sched_policy->prefetches
|
|
|
+ && starpu_get_prefetch_flag()
|
|
|
+ && starpu_memory_nodes_get_count() > 1)
|
|
|
+ {
|
|
|
+ if (task->where == STARPU_CPU && config->cpus_nodeid >= 0)
|
|
|
+ starpu_prefetch_task_input_on_node(task, config->cpus_nodeid);
|
|
|
+ else if (task->where == STARPU_CUDA && config->cuda_nodeid >= 0)
|
|
|
+ starpu_prefetch_task_input_on_node(task, config->cuda_nodeid);
|
|
|
+ else if (task->where == STARPU_OPENCL && config->opencl_nodeid >= 0)
|
|
|
+ starpu_prefetch_task_input_on_node(task, config->opencl_nodeid);
|
|
|
+ else if (task->where == STARPU_MIC && config->mic_nodeid >= 0)
|
|
|
+ starpu_prefetch_task_input_on_node(task, config->mic_nodeid);
|
|
|
+ }
|
|
|
+
|
|
|
STARPU_ASSERT(sched_ctx->sched_policy->push_task);
|
|
|
/* check out if there are any workers in the context */
|
|
|
unsigned nworkers = starpu_sched_ctx_get_nworkers(sched_ctx->id);
|