Accéder au contenu.
Menu Sympa

starpu-devel - Re: [Starpu-devel] StarPU can_execute hook with multiple implementations..

Objet : Developers list for StarPU

Archives de la liste

Re: [Starpu-devel] StarPU can_execute hook with multiple implementations..


Chronologique Discussions 
  • From: Usman Dastgeer <usman.dastgeer@liu.se>
  • To: "<starpu-devel@lists.gforge.inria.fr>" <starpu-devel@lists.gforge.inria.fr>
  • Subject: Re: [Starpu-devel] StarPU can_execute hook with multiple implementations..
  • Date: Thu, 11 Oct 2012 17:01:45 +0200
  • List-archive: <http://lists.gforge.inria.fr/pipermail/starpu-devel>
  • List-id: "Developers list. For discussion of new features, code changes, etc." <starpu-devel.lists.gforge.inria.fr>

I made the following fix. It works apparently. The only problem is that the "can_execute" hook is often called >1 even though one worker is already found to be eligible. I am using greedy scheduler. It's just a performance thing (multiple calls etc.) but I guess its because all workers are simultaneously checking the pool for popping task? So we can't do much about it?
 

static uint32_t _starpu_worker_exists_and_can_execute(struct starpu_task *task,
     enum starpu_archtype arch)
{
int i;
int nimpl;
int nworkers = starpu_worker_get_count();
for (i = 0; i < nworkers; i++)
{
if (starpu_worker_get_type(i) == arch)
for (nimpl = 0; nimpl < STARPU_MAXIMPLEMENTATIONS; nimpl++)
{
switch(arch)
{
case STARPU_CPU_WORKER:
{
if(task->cl->cpu_funcs[nimpl] && task->cl->can_execute(i, task, nimpl))
  return 1;
  break;
}
case STARPU_CUDA_WORKER:
{
if(task->cl->cuda_funcs[nimpl] && task->cl->can_execute(i, task, nimpl))
  return 1;
  break;
}
case STARPU_OPENCL_WORKER:
{
if(task->cl->opencl_funcs[nimpl] && task->cl->can_execute(i, task, nimpl))
  return 1;
  break;
}
case STARPU_GORDON_WORKER:
{
if(task->cl->gordon_funcs[nimpl] && task->cl->can_execute(i, task, nimpl))
  return 1;
  break;
}
default:
STARPU_ASSERT_MSG(0, "Unknown arch type");
}
}
}
}
return 0;
}



On Oct 11, 2012, at 2:39 PM, Usman Dastgeer <usman.dastgeer@liu.se> wrote:

I am having some problem while using "can_execute" hook with multiple implementations. The problem is I guess in workers.c, following code:

static uint32_t _starpu_worker_exists_and_can_execute(struct starpu_task *task,
     enum starpu_archtype arch)
{
int i;
int nworkers = starpu_worker_get_count();
for (i = 0; i < nworkers; i++)
if (starpu_worker_get_type(i) == arch &&
   task->cl->can_execute(i, task, 0))
return 1;
return 0;
}


As you can see that it checks only implementation 0? Could you fix this or am I missing something?

--
Usman.







Archives gérées par MHonArc 2.6.19+.

Haut de le page