Commit 838eb3d6 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Better name for the cell links

parent 04a66c12
......@@ -107,8 +107,8 @@ struct cell {
int sortsize, gsortsize;
/* The tasks computing this cell's density. */
struct link *density, *force, *grav;
int nr_density, nr_force, nr_grav;
struct link *link_density, *link_force, *link_grav;
int nr_link_density, nr_link_force, nr_link_grav;
/* The ghost task to link density to interactions. */
struct task *ghost, *init, *drift, *kick;
......
......@@ -1109,27 +1109,27 @@ void engine_maketasks(struct engine *e) {
if (t->type == task_type_self) {
atomic_inc(&t->ci->nr_tasks);
if (t->subtype == task_subtype_density) {
t->ci->density = engine_addlink(e, t->ci->density, t);
atomic_inc(&t->ci->nr_density);
t->ci->link_density = engine_addlink(e, t->ci->link_density, t);
atomic_inc(&t->ci->nr_link_density);
}
} else if (t->type == task_type_pair) {
atomic_inc(&t->ci->nr_tasks);
atomic_inc(&t->cj->nr_tasks);
if (t->subtype == task_subtype_density) {
t->ci->density = engine_addlink(e, t->ci->density, t);
atomic_inc(&t->ci->nr_density);
t->cj->density = engine_addlink(e, t->cj->density, t);
atomic_inc(&t->cj->nr_density);
t->ci->link_density = engine_addlink(e, t->ci->link_density, t);
atomic_inc(&t->ci->nr_link_density);
t->cj->link_density = engine_addlink(e, t->cj->link_density, t);
atomic_inc(&t->cj->nr_link_density);
}
} else if (t->type == task_type_sub) {
atomic_inc(&t->ci->nr_tasks);
if (t->cj != NULL) atomic_inc(&t->cj->nr_tasks);
if (t->subtype == task_subtype_density) {
t->ci->density = engine_addlink(e, t->ci->density, t);
atomic_inc(&t->ci->nr_density);
t->ci->link_density = engine_addlink(e, t->ci->link_density, t);
atomic_inc(&t->ci->nr_link_density);
if (t->cj != NULL) {
t->cj->density = engine_addlink(e, t->cj->density, t);
atomic_inc(&t->cj->nr_density);
t->cj->link_density = engine_addlink(e, t->cj->link_density, t);
atomic_inc(&t->cj->nr_link_density);
}
}
}
......@@ -1171,8 +1171,8 @@ void engine_maketasks(struct engine *e) {
t->ci, NULL, 0);
scheduler_addunlock(sched, t->ci->super->ghost, t2);
scheduler_addunlock(sched, t2, t->ci->super->kick);
t->ci->force = engine_addlink(e, t->ci->force, t2);
atomic_inc(&t->ci->nr_force);
t->ci->link_force = engine_addlink(e, t->ci->link_force, t2);
atomic_inc(&t->ci->nr_link_force);
}
/* Otherwise, pair interaction? */
......@@ -1191,10 +1191,10 @@ void engine_maketasks(struct engine *e) {
scheduler_addunlock(sched, t->cj->super->ghost, t2);
scheduler_addunlock(sched, t2, t->cj->super->kick);
}
t->ci->force = engine_addlink(e, t->ci->force, t2);
atomic_inc(&t->ci->nr_force);
t->cj->force = engine_addlink(e, t->cj->force, t2);
atomic_inc(&t->cj->nr_force);
t->ci->link_force = engine_addlink(e, t->ci->link_force, t2);
atomic_inc(&t->ci->nr_link_force);
t->cj->link_force = engine_addlink(e, t->cj->link_force, t2);
atomic_inc(&t->cj->nr_link_force);
}
/* Otherwise, sub interaction? */
......@@ -1214,11 +1214,11 @@ void engine_maketasks(struct engine *e) {
scheduler_addunlock(sched, t->cj->super->ghost, t2);
scheduler_addunlock(sched, t2, t->cj->super->kick);
}
t->ci->force = engine_addlink(e, t->ci->force, t2);
atomic_inc(&t->ci->nr_force);
t->ci->link_force = engine_addlink(e, t->ci->link_force, t2);
atomic_inc(&t->ci->nr_link_force);
if (t->cj != NULL) {
t->cj->force = engine_addlink(e, t->cj->force, t2);
atomic_inc(&t->cj->nr_force);
t->cj->link_force = engine_addlink(e, t->cj->link_force, t2);
atomic_inc(&t->cj->nr_link_force);
}
}
......
......@@ -714,7 +714,7 @@ void runner_doghost(struct runner *r, struct cell *c) {
for (finger = c; finger != NULL; finger = finger->parent) {
/* Run through this cell's density interactions. */
for (struct link *l = finger->density; l != NULL; l = l->next) {
for (struct link *l = finger->link_density; l != NULL; l = l->next) {
//message("link: %p next: %p", l, l->next); fflush(stdout);
......
......@@ -271,10 +271,10 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
space_rebuild_recycle(s, &s->cells[k]);
s->cells[k].sorts = NULL;
s->cells[k].nr_tasks = 0;
s->cells[k].nr_density = 0;
s->cells[k].nr_force = 0;
s->cells[k].density = NULL;
s->cells[k].force = NULL;
s->cells[k].nr_link_density = 0;
s->cells[k].nr_link_force = 0;
s->cells[k].link_density = NULL;
s->cells[k].link_force = NULL;
s->cells[k].dx_max = 0.0f;
s->cells[k].sorted = 0;
s->cells[k].count = 0;
......@@ -1219,8 +1219,11 @@ void space_init(struct space *s, double dim[3], struct part *parts, int N,
void space_link_cleanup(struct space *s) {
void cell_clean_links(struct cell * c, void * data) {
c->density = NULL;
c->force = NULL;
c->link_density = NULL;
c->nr_link_density = 0;
c->link_force = NULL;
c->nr_link_force = 0;
}
space_map_cells_pre(s, 1, cell_clean_links, 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