Commit 1adbabf9 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

hierarchy --> ghost

parent 878e4771
......@@ -117,8 +117,8 @@ struct cell {
struct link *density, *force, *grav;
int nr_density, nr_force, nr_grav;
/* The hierarchy task to link density to interactions. */
struct task *hierarchy, *init, *drift, *kick;
/* The hierarchical tasks. */
struct task *ghost, *init, *drift, *kick;
/* Task receiving data. */
struct task *recv_xv, *recv_rho;
......
......@@ -95,10 +95,9 @@ struct link *engine_addlink(struct engine *e, struct link *l, struct task *t) {
}
/**
* @brief Generate the hierarchical tasks for a hierarchy of cells - all the O(Npart) tasks.
* @brief Generate the hierarchical tasks for a hierarchy of cells - i.e. all
* the O(Npart) tasks.
*
* Previously this was called the ghost task but has since been renamed to reflect
* it's new more general usage.
* Tasks are only created here. The dependencies will be added later on.
*
* @param e The #engine.
......@@ -107,7 +106,7 @@ struct link *engine_addlink(struct engine *e, struct link *l, struct task *t) {
*/
void engine_make_hierarchical_tasks(struct engine *e, struct cell *c,
struct cell *super) {
struct cell *super) {
struct scheduler *s = &e->sched;
const int is_with_external_gravity =
......@@ -137,8 +136,8 @@ void engine_make_hierarchical_tasks(struct engine *e, struct cell *c,
if (c->count > 0) {
/* Generate the hierarchy task i.e. ghost task. */
c->hierarchy = scheduler_addtask(s, task_type_hierarchy, task_subtype_none, 0,
/* Generate the ghost task. */
c->ghost = scheduler_addtask(s, task_type_ghost, task_subtype_none, 0,
0, c, NULL, 0);
}
......@@ -617,14 +616,14 @@ void engine_addtasks_send(struct engine *e, struct cell *ci, struct cell *cj) {
struct task *t_rho = scheduler_addtask(s, task_type_send, task_subtype_none,
2 * ci->tag + 1, 0, ci, cj, 0);
/* The send_rho task depends on the cell's hierarchy task. */
scheduler_addunlock(s, ci->super->hierarchy, t_rho);
/* The send_rho task depends on the cell's ghost task. */
scheduler_addunlock(s, ci->super->ghost, t_rho);
/* The send_rho task should unlock the super-cell's kick task. */
scheduler_addunlock(s, t_rho, ci->super->kick);
/* The send_xv task should unlock the super-cell's hierarchy task. */
scheduler_addunlock(s, t_xv, ci->super->hierarchy);
/* The send_xv task should unlock the super-cell's ghost task. */
scheduler_addunlock(s, t_xv, ci->super->ghost);
}
......@@ -1222,10 +1221,10 @@ static inline void engine_make_hydro_loops_dependencies(struct scheduler *sched,
struct task *force,
struct cell *c) {
/* init --> density loop --> hierarchy (ghost) --> force loop --> kick */
/* init --> density loop --> ghost --> force loop --> kick */
scheduler_addunlock(sched, c->super->init, density);
scheduler_addunlock(sched, density, c->super->hierarchy);
scheduler_addunlock(sched, c->super->hierarchy, force);
scheduler_addunlock(sched, density, c->super->ghost);
scheduler_addunlock(sched, c->super->ghost, force);
scheduler_addunlock(sched, force, c->super->kick);
}
......@@ -1460,7 +1459,8 @@ void engine_maketasks(struct engine *e) {
engine_make_hierarchical_tasks(e, &cells[k], NULL);
/* Run through the tasks and make force tasks for each density task.
Each force task depends on the cell hierarchy tasks and unlocks the kick task
Each force task depends on the cell hierarchy tasks and unlocks the kick
task
of its super-cell. */
engine_make_extra_hydroloop_tasks(e);
......@@ -1571,7 +1571,7 @@ int engine_marktasks(struct engine *e) {
}
/* Single-cell task? */
else if (t->type == task_type_self || t->type == task_type_hierarchy ||
else if (t->type == task_type_self || t->type == task_type_ghost ||
(t->type == task_type_sub && t->cj == NULL)) {
/* Set this task's skip. */
......@@ -1935,7 +1935,7 @@ void engine_init_particles(struct engine *e) {
mask |= 1 << task_type_self;
mask |= 1 << task_type_pair;
mask |= 1 << task_type_sub;
mask |= 1 << task_type_hierarchy;
mask |= 1 << task_type_ghost;
submask |= 1 << task_subtype_density;
}
......@@ -2115,7 +2115,7 @@ void engine_step(struct engine *e) {
mask |= 1 << task_type_self;
mask |= 1 << task_type_pair;
mask |= 1 << task_type_sub;
mask |= 1 << task_type_hierarchy;
mask |= 1 << task_type_ghost;
submask |= 1 << task_subtype_density;
submask |= 1 << task_subtype_force;
......
......@@ -629,7 +629,7 @@ void runner_doinit(struct runner *r, struct cell *c, int timer) {
* @param c The cell.
*/
void runner_do_cellhierarchy(struct runner *r, struct cell *c) {
void runner_do_ghost(struct runner *r, struct cell *c) {
struct part *p, *parts = c->parts;
struct xpart *xp, *xparts = c->xparts;
......@@ -652,7 +652,7 @@ void runner_do_cellhierarchy(struct runner *r, struct cell *c) {
/* Recurse? */
if (c->split) {
for (int k = 0; k < 8; k++)
if (c->progeny[k] != NULL) runner_do_cellhierarchy(r, c->progeny[k]);
if (c->progeny[k] != NULL) runner_do_ghost(r, c->progeny[k]);
return;
}
......@@ -774,7 +774,7 @@ void runner_do_cellhierarchy(struct runner *r, struct cell *c) {
if (count)
message("Smoothing length failed to converge on %i particles.", count);
TIMER_TOC(timer_do_cellhierarchy);
TIMER_TOC(timer_do_ghost);
}
/**
......@@ -1348,8 +1348,8 @@ void *runner_main(void *data) {
case task_type_init:
runner_doinit(r, ci, 1);
break;
case task_type_hierarchy:
runner_do_cellhierarchy(r, ci);
case task_type_ghost:
runner_do_ghost(r, ci);
break;
case task_type_drift:
runner_dodrift(r, ci, 1);
......
......@@ -916,7 +916,7 @@ void scheduler_reweight(struct scheduler *s) {
} else
t->weight += 1 * wscale * t->ci->count * t->ci->count;
break;
case task_type_hierarchy:
case task_type_ghost:
if (t->ci == t->ci->super) t->weight += wscale * t->ci->count;
break;
case task_type_kick:
......@@ -1082,7 +1082,7 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
switch (t->type) {
case task_type_self:
case task_type_sort:
case task_type_hierarchy:
case task_type_ghost:
case task_type_kick:
case task_type_drift:
case task_type_init:
......
......@@ -350,7 +350,7 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
s->cells[k].count = 0;
s->cells[k].gcount = 0;
s->cells[k].init = NULL;
s->cells[k].hierarchy = NULL;
s->cells[k].ghost = NULL;
s->cells[k].drift = NULL;
s->cells[k].kick = NULL;
s->cells[k].super = &s->cells[k];
......@@ -452,8 +452,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
const int t = ind[k];
ind[k] = ind[nr_parts];
ind[nr_parts] = t;
}
else {
} else {
/* Increment when not exchanging otherwise we need to retest "k".*/
k++;
}
......@@ -488,8 +487,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
const int t = gind[k];
gind[k] = gind[nr_gparts];
gind[nr_gparts] = t;
}
else {
} else {
/* Increment when not exchanging otherwise we need to retest "k".*/
k++;
}
......@@ -508,7 +506,6 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
}
}*/
/* Exchange the strays, note that this potentially re-allocates
the parts arrays. */
size_t nr_parts_exchanged = s->nr_parts - nr_parts;
......
......@@ -48,7 +48,7 @@
/* Task type names. */
const char *taskID_names[task_type_count] = {
"none", "sort", "self", "pair", "sub",
"init", "hierarchy", "drift", "kick", "send",
"init", "ghost", "drift", "kick", "send",
"recv", "grav_pp", "grav_mm", "grav_up", "grav_down",
"grav_external", "part_sort", "gpart_sort", "split_cell", "rewait"};
......
......@@ -39,7 +39,7 @@ enum task_types {
task_type_pair,
task_type_sub,
task_type_init,
task_type_hierarchy,
task_type_ghost,
task_type_drift,
task_type_kick,
task_type_send,
......
......@@ -45,7 +45,7 @@ enum {
timer_dosub_force,
timer_dosub_grav,
timer_dopair_subset,
timer_do_cellhierarchy,
timer_do_ghost,
timer_dorecv_cell,
timer_gettask,
timer_qget,
......
Markdown is supported
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