Commit ca250f50 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

don't re-sort existing dimensions if no cleanup required.

parent 7e7f9fed
...@@ -335,6 +335,11 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int cleanup, ...@@ -335,6 +335,11 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int cleanup,
/* We need to do the local sorts plus whatever was requested further up. */ /* We need to do the local sorts plus whatever was requested further up. */
flags |= c->do_sort; flags |= c->do_sort;
if (cleanup) {
c->sorted = 0;
} else {
flags &= ~c->sorted;
}
if (flags == 0 && !c->do_sub_sort) return; if (flags == 0 && !c->do_sub_sort) return;
/* Check that the particles have been moved to the current time */ /* Check that the particles have been moved to the current time */
...@@ -466,7 +471,8 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int cleanup, ...@@ -466,7 +471,8 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int cleanup,
xparts[k].x_diff_sort[2] = 0.0f; xparts[k].x_diff_sort[2] = 0.0f;
} }
} }
c->dx_max_sort_old = c->dx_max_sort = 0.f; c->dx_max_sort_old = 0.f;
c->dx_max_sort = 0.f;
} }
/* Fill the sort array. */ /* Fill the sort array. */
......
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