Commit 394e1ecc authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Now also with correct subset loops in the ghosts

parent c50daa96
......@@ -527,8 +527,6 @@ void runner_do_ghost(struct runner *r, struct cell *c) {
count = redo;
if (count > 0) {
return;
/* Climb up the cell hierarchy. */
for (finger = c; finger != NULL; finger = finger->parent) {
......@@ -552,8 +550,13 @@ void runner_do_ghost(struct runner *r, struct cell *c) {
}
/* Otherwise, sub interaction? */
else if (l->t->type == task_type_sub_pair) { // MATTHIEU
/* Otherwise, sub-self interaction? */
else if (l->t->type == task_type_sub_self)
runner_dosub_subset_density(r, finger, parts, pid, count, NULL, -1,
1);
/* Otherwise, sub-pair interaction? */
else if (l->t->type == task_type_sub_pair) {
/* Left or right? */
if (l->t->ci == finger)
......
......@@ -774,22 +774,22 @@ void scheduler_reweight(struct scheduler *s) {
2 * wscale * t->ci->count * t->cj->count * sid_scale[t->flags];
break;
case task_type_sub_pair:
if (t->ci->nodeID != nodeID || t->cj->nodeID != nodeID) {
if (t->flags < 0)
t->weight += 3 * wscale * t->ci->count * t->cj->count;
else
t->weight += 3 * wscale * t->ci->count * t->cj->count *
sid_scale[t->flags];
} else {
if (t->flags < 0)
t->weight += 2 * wscale * t->ci->count * t->cj->count;
else
t->weight += 2 * wscale * t->ci->count * t->cj->count *
sid_scale[t->flags];
}
break;
case task_type_sub_self:
t->weight += 1 * wscale * t->ci->count * t->ci->count;
if (t->ci->nodeID != nodeID || t->cj->nodeID != nodeID) {
if (t->flags < 0)
t->weight += 3 * wscale * t->ci->count * t->cj->count;
else
t->weight += 3 * wscale * t->ci->count * t->cj->count *
sid_scale[t->flags];
} else {
if (t->flags < 0)
t->weight += 2 * wscale * t->ci->count * t->cj->count;
else
t->weight += 2 * wscale * t->ci->count * t->cj->count *
sid_scale[t->flags];
}
break;
case task_type_sub_self:
t->weight += 1 * wscale * t->ci->count * t->ci->count;
break;
case task_type_ghost:
if (t->ci == t->ci->super) t->weight += wscale * t->ci->count;
......@@ -967,7 +967,8 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
case task_type_pair:
case task_type_sub_pair:
qid = t->ci->super->owner;
if (qid < 0 || s->queues[qid].count > s->queues[t->cj->super->owner].count)
if (qid < 0 ||
s->queues[qid].count > s->queues[t->cj->super->owner].count)
qid = t->cj->super->owner;
break;
case task_type_recv:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment