Commit 034b0441 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Remove the individual task counters.

parent 59d5eb87
......@@ -756,16 +756,9 @@ void cell_convert_hydro(struct cell *c, void *data) {
*/
void cell_clean_links(struct cell *c, void *data) {
c->density = NULL;
c->nr_density = 0;
c->gradient = NULL;
c->nr_gradient = 0;
c->force = NULL;
c->nr_force = 0;
c->grav = NULL;
c->nr_grav = 0;
}
/**
......
......@@ -139,7 +139,6 @@ struct cell {
/* The tasks computing this cell's density. */
struct link *density, *gradient, *force, *grav;
int nr_density, nr_gradient, nr_force, nr_grav;
/* The hierarchical tasks. */
struct task *extra_ghost, *ghost, *init, *kick;
......
......@@ -1361,15 +1361,12 @@ void engine_count_and_link_tasks(struct engine *e) {
atomic_inc(&ci->nr_tasks);
if (t->subtype == task_subtype_density) {
engine_addlink(e, &ci->density, t);
atomic_inc(&ci->nr_density);
}
if (t->subtype == task_subtype_grav) {
engine_addlink(e, &ci->grav, t);
atomic_inc(&ci->nr_grav);
}
if (t->subtype == task_subtype_external_grav) {
engine_addlink(e, &ci->grav, t);
atomic_inc(&ci->nr_grav);
}
/* Link pair tasks to cells. */
......@@ -1378,15 +1375,11 @@ void engine_count_and_link_tasks(struct engine *e) {
atomic_inc(&cj->nr_tasks);
if (t->subtype == task_subtype_density) {
engine_addlink(e, &ci->density, t);
atomic_inc(&ci->nr_density);
engine_addlink(e, &cj->density, t);
atomic_inc(&cj->nr_density);
}
if (t->subtype == task_subtype_grav) {
engine_addlink(e, &ci->grav, t);
atomic_inc(&ci->nr_grav);
engine_addlink(e, &cj->grav, t);
atomic_inc(&cj->nr_grav);
}
/* Link sub-self tasks to cells. */
......@@ -1394,15 +1387,12 @@ void engine_count_and_link_tasks(struct engine *e) {
atomic_inc(&ci->nr_tasks);
if (t->subtype == task_subtype_density) {
engine_addlink(e, &ci->density, t);
atomic_inc(&ci->nr_density);
}
if (t->subtype == task_subtype_grav) {
engine_addlink(e, &ci->grav, t);
atomic_inc(&ci->nr_grav);
}
if (t->subtype == task_subtype_external_grav) {
engine_addlink(e, &ci->grav, t);
atomic_inc(&ci->nr_grav);
}
/* Link sub-pair tasks to cells. */
......@@ -1411,22 +1401,16 @@ void engine_count_and_link_tasks(struct engine *e) {
atomic_inc(&cj->nr_tasks);
if (t->subtype == task_subtype_density) {
engine_addlink(e, &ci->density, t);
atomic_inc(&ci->nr_density);
engine_addlink(e, &cj->density, t);
atomic_inc(&cj->nr_density);
}
if (t->subtype == task_subtype_grav) {
engine_addlink(e, &ci->grav, t);
atomic_inc(&ci->nr_grav);
engine_addlink(e, &cj->grav, t);
atomic_inc(&cj->nr_grav);
}
if (t->subtype == task_subtype_external_grav) {
error("Found a sub-pair/external-gravity task...");
engine_addlink(e, &ci->grav, t);
atomic_inc(&ci->nr_grav);
engine_addlink(e, &cj->grav, t);
atomic_inc(&cj->nr_grav);
}
}
}
......@@ -1658,9 +1642,7 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loops and the cell */
engine_addlink(e, &t->ci->gradient, t2);
atomic_inc(&t->ci->nr_gradient);
engine_addlink(e, &t->ci->force, t3);
atomic_inc(&t->ci->nr_force);
/* Now, build all the dependencies for the hydro */
engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->ci);
......@@ -1673,7 +1655,6 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and the cell */
engine_addlink(e, &t->ci->force, t2);
atomic_inc(&t->ci->nr_force);
/* Now, build all the dependencies for the hydro */
engine_make_hydro_loops_dependencies(sched, t, t2, t->ci);
......@@ -1692,13 +1673,9 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and both cells */
engine_addlink(e, &t->ci->gradient, t2);
atomic_inc(&t->ci->nr_gradient);
engine_addlink(e, &t->cj->gradient, t2);
atomic_inc(&t->cj->nr_gradient);
engine_addlink(e, &t->ci->force, t3);
atomic_inc(&t->ci->nr_force);
engine_addlink(e, &t->cj->force, t3);
atomic_inc(&t->cj->nr_force);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
......@@ -1717,9 +1694,7 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and both cells */
engine_addlink(e, &t->ci->force, t2);
atomic_inc(&t->ci->nr_force);
engine_addlink(e, &t->cj->force, t2);
atomic_inc(&t->cj->nr_force);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
......@@ -1750,9 +1725,7 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and the cell */
engine_addlink(e, &t->ci->gradient, t2);
atomic_inc(&t->ci->nr_gradient);
engine_addlink(e, &t->ci->force, t3);
atomic_inc(&t->ci->nr_force);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
......@@ -1768,7 +1741,6 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and the cell */
engine_addlink(e, &t->ci->force, t2);
atomic_inc(&t->ci->nr_force);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
......@@ -1794,13 +1766,9 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and both cells */
engine_addlink(e, &t->ci->gradient, t2);
atomic_inc(&t->ci->nr_gradient);
engine_addlink(e, &t->cj->gradient, t2);
atomic_inc(&t->cj->nr_gradient);
engine_addlink(e, &t->ci->force, t3);
atomic_inc(&t->ci->nr_force);
engine_addlink(e, &t->cj->force, t3);
atomic_inc(&t->cj->nr_force);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
......@@ -1819,9 +1787,7 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* Add the link between the new loop and both cells */
engine_addlink(e, &t->ci->force, t2);
atomic_inc(&t->ci->nr_force);
engine_addlink(e, &t->cj->force, t2);
atomic_inc(&t->cj->nr_force);
/* Now, build all the dependencies for the hydro for the cells */
/* that are local and are not descendant of the same super-cells */
......
......@@ -392,10 +392,6 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
space_rebuild_recycle(s, &s->cells_top[k]);
s->cells_top[k].sorts = NULL;
s->cells_top[k].nr_tasks = 0;
s->cells_top[k].nr_density = 0;
s->cells_top[k].nr_gradient = 0;
s->cells_top[k].nr_force = 0;
s->cells_top[k].nr_grav = 0;
s->cells_top[k].density = NULL;
s->cells_top[k].gradient = NULL;
s->cells_top[k].force = NULL;
......
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