Commit 09f3bcc2 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Post-merge fixes

parent fa8062c7
......@@ -2256,7 +2256,8 @@ void engine_init_particles(struct engine *e) {
void engine_step(struct engine *e) {
double snapshot_drift_time = 0.;
struct space *s = e->s;
TIMER_TIC2;
struct clocks_time time1, time2;
......
......@@ -62,7 +62,7 @@ __attribute__((always_inline))
gp->a_grav[1] * gp->a_grav[1] +
gp->a_grav[2] * gp->a_grav[2];
const float ac = ac2 > 0. ? sqrtf(ac) : FLT_MIN;
const float ac = (ac2 > 0.f) ? sqrtf(ac2) : FLT_MIN;
const float dt = sqrt(2.f * const_gravity_eta * gp->epsilon / ac);
......
......@@ -736,13 +736,12 @@ void runner_do_kick_fixdt(struct runner *r, struct cell *c, int timer) {
const double global_dt = r->e->dt_max;
const double timeBase = r->e->timeBase;
const double timeBase_inv = 1.0 / r->e->timeBase;
const int count = c->count;
const int gcount = c->gcount;
struct part *const parts = c->parts;
struct xpart *const xparts = c->xparts;
struct gpart *const gparts = c->gparts;
const double const_G = constants->const_newton_G;
const double const_G = r->e->physical_constants->const_newton_G;
int updated = 0, g_updated = 0;
int ti_end_min = max_nr_timesteps, ti_end_max = 0;
......@@ -858,6 +857,7 @@ void runner_do_kick(struct runner *r, struct cell *c, int timer) {
struct part *const parts = c->parts;
struct xpart *const xparts = c->xparts;
struct gpart *const gparts = c->gparts;
const double const_G = r->e->physical_constants->const_newton_G;
int updated = 0, g_updated = 0;
int ti_end_min = max_nr_timesteps, ti_end_max = 0;
......@@ -883,7 +883,7 @@ void runner_do_kick(struct runner *r, struct cell *c, int timer) {
if (gp->ti_end <= ti_current) {
/* First, finish the force calculation */
gravity_end_force(gp);
gravity_end_force(gp, const_G);
/* Compute the next timestep */
const int new_dti = get_gpart_timestep(gp, e);
......@@ -918,7 +918,7 @@ void runner_do_kick(struct runner *r, struct cell *c, int timer) {
/* And do the same of the extra variable */
hydro_end_force(p);
if (p->gpart != NULL) gravity_end_force(p->gpart);
if (p->gpart != NULL) gravity_end_force(p->gpart, const_G);
/* Compute the next timestep (hydro condition) */
const int new_dti = get_part_timestep(p, xp, e);
......@@ -1058,6 +1058,8 @@ void *runner_main(void *data) {
runner_doself1_density(r, ci);
else if (t->subtype == task_subtype_force)
runner_doself2_force(r, ci);
else if (t->subtype == task_subtype_grav)
runner_doself_grav(r, ci);
else
error("Unknown task subtype.");
break;
......@@ -1066,6 +1068,8 @@ void *runner_main(void *data) {
runner_dopair1_density(r, ci, cj);
else if (t->subtype == task_subtype_force)
runner_dopair2_force(r, ci, cj);
else if (t->subtype == task_subtype_grav)
runner_dopair_grav(r, ci, cj);
else
error("Unknown task subtype.");
break;
......@@ -1079,6 +1083,8 @@ void *runner_main(void *data) {
runner_dosub2_force(r, ci, cj, t->flags, 1);
else if (t->subtype == task_subtype_grav)
runner_dosub_grav(r, ci, cj, 1);
else if (t->subtype == task_subtype_grav)
runner_dosub_grav(r, ci, cj, 1);
else
error("Unknown task subtype.");
break;
......
......@@ -49,9 +49,8 @@
const char *taskID_names[task_type_count] = {
"none", "sort", "self", "pair", "sub",
"init", "ghost", "drift", "kick", "kick_fixdt",
"send", "recv", "grav_pp", "grav_mm", "grav_up",
"grav_down", "grav_external", "part_sort", "gpart_sort", "split_cell",
"rewait"};
"send", "recv", "grav_mm", "grav_up", "grav_external",
"part_sort", "gpart_sort", "split_cell", "rewait"};
const char *subtaskID_names[task_type_count] = {"none", "density",
"force", "grav"};
......@@ -125,9 +124,9 @@ void task_unlock(struct task *t) {
cell_unlocktree(t->ci);
if (t->cj != NULL) cell_unlocktree(t->cj);
break;
case task_type_grav_pp:
//case task_type_grav_pp:
case task_type_grav_mm:
case task_type_grav_down:
//case task_type_grav_down:
cell_gunlocktree(t->ci);
if (t->cj != NULL) cell_gunlocktree(t->cj);
break;
......@@ -185,8 +184,8 @@ int task_lock(struct task *t) {
}
/* Gravity tasks? */
else if (type == task_type_grav_mm || type == task_type_grav_pp ||
type == task_type_grav_down) {
else if (type == task_type_grav_mm) {
//|| type == task_type_grav_pp || type == task_type_grav_down) {
if (ci->ghold || (cj != NULL && cj->ghold)) return 0;
if (cell_glocktree(ci) != 0) return 0;
if (cj != NULL && cell_glocktree(cj) != 0) {
......
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