diff --git a/src/partition.c b/src/partition.c index 0584fab8dff94c32128610a7e0f06a533daac1d9..1dde46dcd4ad2eb397bd26905fd8b57240088857 100644 --- a/src/partition.c +++ b/src/partition.c @@ -2094,6 +2094,7 @@ static void check_weights(struct task *tasks, int nr_tasks, int nr_cells = mydata->nr_cells; int timebins = mydata->timebins; int vweights = mydata->vweights; + int use_ticks = mydata->use_ticks; struct cell *cells = mydata->cells; @@ -2118,10 +2119,18 @@ static void check_weights(struct task *tasks, int nr_tasks, struct task *t = &tasks[j]; /* Skip un-interesting tasks. */ - if (t->cost == 0.f) continue; + if (t->type == task_type_send || t->type == task_type_recv || + t->type == task_type_logger || t->implicit || t->ci == NULL) + continue; - /* Get the task weight based on costs. */ - double w = (double)t->cost; + /* Get weight for this task. Either based on fixed costs or task timings. */ + double w = 0.0; + if (use_ticks) { + w = (double)t->toc - (double)t->tic; + } else { + w = repartition_costs[t->type][t->subtype]; + } + if (w <= 0.0) continue; /* Get the top-level cells involved. */ struct cell *ci, *cj;