Skip to content

Commit

Permalink
Fix pheft and modular-* respecting workerids
Browse files Browse the repository at this point in the history
This completes ed88399 ("Honor workerids in all versions of
worker_can_execute_task") that missed the
starpu_combined_worker_can_execute_task case
  • Loading branch information
sthibaul committed Nov 23, 2023
1 parent 7c24dc0 commit 8b3a4fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/core/workers.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,13 +695,10 @@ int starpu_combined_worker_can_execute_task(unsigned workerid, struct starpu_tas
unsigned nworkers = _starpu_config.topology.nworkers;


if (!_starpu_enforce_locality(workerid, task))
return 0;

/* Is this a parallel worker ? */
if (workerid < nworkers)
{
if (!_starpu_config.workers[workerid].enable_knob)
if (!_starpu_can_execute_task_any_impl(workerid, task))
return 0;

return !!((task->where & _starpu_config.workers[workerid].worker_mask) &&
Expand All @@ -710,6 +707,9 @@ int starpu_combined_worker_can_execute_task(unsigned workerid, struct starpu_tas
}
else
{
if (!_starpu_enforce_locality(workerid, task))
return 0;

if (cl->type == STARPU_SPMD
#ifdef STARPU_HAVE_HWLOC
|| cl->type == STARPU_FORKJOIN
Expand Down
9 changes: 3 additions & 6 deletions tests/sched_policies/workerids.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,10 @@ int main(void)
{
int ret;

if (strncmp((*policy)->policy_name, "modular-", 8) == 0
|| strcmp((*policy)->policy_name, "pheft") == 0
|| strcmp((*policy)->policy_name, "heteroprio") == 0
|| strcmp((*policy)->policy_name, "lws") == 0
|| strcmp((*policy)->policy_name, "ws") == 0)
if (strcmp((*policy)->policy_name, "lws") == 0
|| strcmp((*policy)->policy_name, "ws") == 0)
#ifdef STARPU_DEVEL
#warning FIXME for modular-*, pheft and heteroprio
#warning FIXME performance for ws
#endif
continue;

Expand Down

0 comments on commit 8b3a4fd

Please sign in to comment.