Commit 6846a55b authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Also time the gravity down pass and the long range interactions.

parent 194b4995
......@@ -385,6 +385,7 @@ INLINE static void gravity_L2P(const struct gravity_tensors *l,
struct gpart *gp) {
#ifdef SWIFT_DEBUG_CHECKS
if (l->mass_interacted == 0.f) error("Interacting with empty field tensor");
gp->mass_interacted += l->mass_interacted;
#endif
......
......@@ -1829,7 +1829,7 @@ void *runner_main(void *data) {
// runner_do_grav_mm(r, t->ci, 1);
break;
case task_type_grav_down:
runner_do_grav_down(r, t->ci);
runner_do_grav_down(r, t->ci, 1);
break;
case task_type_grav_top_level:
// runner_do_grav_top_level(r);
......
......@@ -25,7 +25,9 @@
#include "gravity.h"
#include "part.h"
void runner_do_grav_down(struct runner *r, struct cell *c) {
void runner_do_grav_down(struct runner *r, struct cell *c, int timer) {
TIMER_TIC;
if (c->split) {
......@@ -38,6 +40,8 @@ void runner_do_grav_down(struct runner *r, struct cell *c) {
1);
gravity_field_tensors_add(cp->multipole, &temp);
runner_do_grav_down(r, cp, 0);
}
}
......@@ -53,6 +57,8 @@ void runner_do_grav_down(struct runner *r, struct cell *c) {
if (gpart_is_active(gp, e)) gravity_L2P(c->multipole, gp);
}
}
if (timer) TIMER_TOC(timer_dograv_down);
}
/**
......@@ -554,6 +560,8 @@ void runner_do_grav_long_range(struct runner *r, struct cell *ci, int timer) {
}
#endif
TIMER_TIC;
/* Recover the list of top-level cells */
const struct engine *e = r->e;
struct cell *cells = e->s->cells_top;
......@@ -583,6 +591,8 @@ void runner_do_grav_long_range(struct runner *r, struct cell *ci, int timer) {
if (!cell_are_neighbours(ci, cj)) runner_dopair_grav_mm(r, ci, cj);
}
if (timer) TIMER_TOC(timer_dograv_long_range);
}
#endif /* SWIFT_RUNNER_DOIACT_GRAV_H */
......@@ -49,6 +49,8 @@ enum {
timer_dopair_grav_mm,
timer_dopair_grav_pp,
timer_dograv_external,
timer_dograv_down,
timer_dograv_long_range,
timer_dosource,
timer_dosub_self_density,
timer_dosub_self_gradient,
......
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