Commit d4721fbe authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Remove the individual task counters.

parent 98fff2d2
......@@ -757,16 +757,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;
}
/**
......
......@@ -140,7 +140,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;
......
......@@ -1358,15 +1358,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. */
......@@ -1375,15 +1372,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. */
......@@ -1391,15 +1384,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. */
......@@ -1408,22 +1398,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);
}
}
}
......@@ -1649,9 +1633,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);
......@@ -1664,7 +1646,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);
......@@ -1683,13 +1664,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 */
......@@ -1708,9 +1685,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 */
......@@ -1741,9 +1716,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 */
......@@ -1759,7 +1732,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 */
......@@ -1785,13 +1757,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 */
......@@ -1810,9 +1778,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