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

minor fixes here and there, compiles now.

parent b4ff16e8
......@@ -1325,10 +1325,10 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
const integertime_t ti_current = e->ti_current;
/* Store the current dx_max and h_max values. */
ci->dx_max_old = ci->dx_max;
ci->dx_max_old = ci->dx_max_part;
ci->h_max_old = ci->h_max;
if (cj != NULL) {
cj->dx_max_old = cj->dx_max;
cj->dx_max_old = cj->dx_max_part;
cj->h_max_old = cj->h_max;
}
......@@ -1348,7 +1348,7 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
}
/* Activate drift task, if it is present. */
if (ci->drift != NULL) scheduler_activate(s, ci->drift);
if (ci->drift_part != NULL) scheduler_activate(s, ci->drift_part);
}
}
......@@ -1579,8 +1579,8 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
atomic_or(&cj->sorts->flags, (1 << sid));
/* Activate the drifts if the cells are local. */
if (ci->nodeID == engine_rank) scheduler_activate(s, ci->drift);
if (cj->nodeID == engine_rank) scheduler_activate(s, cj->drift);
if (ci->nodeID == engine_rank) scheduler_activate(s, ci->drift_part);
if (cj->nodeID == engine_rank) scheduler_activate(s, cj->drift_part);
if (ci->dx_max_sort > space_maxreldx * ci->dmin) {
for (struct cell *finger = ci; finger != NULL; finger = finger->parent) {
......
......@@ -1892,12 +1892,13 @@ void engine_count_and_link_tasks(struct engine *e) {
else if (t->type == task_type_drift_part) {
for (struct cell *finger = t->ci->parent; finger != NULL;
finger = finger->parent)
if (finger->drift_part != NULL) scheduler_addunlock(sched, t, finger->drift_part);
}
else if (t->type == task_type_drift_gpart) {
if (finger->drift_part != NULL)
scheduler_addunlock(sched, t, finger->drift_part);
} else if (t->type == task_type_drift_gpart) {
for (struct cell *finger = t->ci->parent; finger != NULL;
finger = finger->parent)
if (finger->drift_gpart != NULL) scheduler_addunlock(sched, t, finger->drift_gpart);
if (finger->drift_gpart != NULL)
scheduler_addunlock(sched, t, finger->drift_gpart);
}
/* Link self tasks to cells. */
......@@ -2568,7 +2569,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
if (t->subtype != task_subtype_density) continue;
/* Too much particle movement? */
if (max(ci->h_max, cj->h_max) + ci->dx_max + cj->dx_max > cj->dmin)
if (max(ci->h_max, cj->h_max) + ci->dx_max_part + cj->dx_max_part >
cj->dmin)
*rebuild_space = 1;
/* Set the correct sorting flags */
......@@ -2594,7 +2596,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
error("bad flags in sort task.");
#endif
scheduler_activate(s, ci->sorts);
if (ci->nodeID == engine_rank) scheduler_activate(s, ci->drift);
if (ci->nodeID == engine_rank) scheduler_activate(s, ci->drift_part);
}
if (cj->dx_max_sort > space_maxreldx * cj->dmin) {
for (struct cell *finger = cj; finger != NULL;
......@@ -3203,7 +3205,7 @@ void engine_skip_drift(struct engine *e) {
struct task *t = &tasks[i];
/* Skip everything that updates the particles */
if (t->type == task_type_drift) t->skip = 1;
if (t->type == task_type_drift_part) t->skip = 1;
}
}
......
......@@ -132,9 +132,9 @@ void scheduler_add_subcell_tasks(struct scheduler *s, struct cell *c,
lock_lock(&c->lock);
/* Add a drift task if not present. */
if (c->drift == NULL)
c->drift =
scheduler_addtask(s, task_type_drift, task_subtype_none, 0, 0, c, NULL);
if (c->drift_part == NULL)
c->drift_part = scheduler_addtask(s, task_type_drift_part,
task_subtype_none, 0, 0, c, NULL);
/* Add a sort task if not present. Note that the sort flags will be
populated in cell_activate_subcell_tasks. */
......@@ -147,7 +147,7 @@ void scheduler_add_subcell_tasks(struct scheduler *s, struct cell *c,
lock_unlock_blind(&c->lock);
/* The provided task should depend on both the drift and the sort. */
scheduler_addunlock(s, c->drift, t);
scheduler_addunlock(s, c->drift_part, t);
scheduler_addunlock(s, c->sorts, t);
}
......
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