diff --git a/src/cell.c b/src/cell.c index 19734e8cdb0b07b0f7c7ca6bc9cc6738aaf6cf5f..3fe5e21e7c888f2358395a27e13710db460fd74c 100644 --- a/src/cell.c +++ b/src/cell.c @@ -184,6 +184,7 @@ int cell_pack(struct cell *restrict c, struct pcell *restrict pc, pc->hydro.ti_end_max = c->hydro.ti_end_max; pc->grav.ti_end_min = c->grav.ti_end_min; pc->grav.ti_end_max = c->grav.ti_end_max; + pc->stars.ti_end_min = c->stars.ti_end_min; pc->hydro.ti_old_part = c->hydro.ti_old_part; pc->grav.ti_old_part = c->grav.ti_old_part; pc->grav.ti_old_multipole = c->grav.ti_old_multipole; @@ -287,6 +288,7 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c, c->hydro.ti_end_max = pc->hydro.ti_end_max; c->grav.ti_end_min = pc->grav.ti_end_min; c->grav.ti_end_max = pc->grav.ti_end_max; + c->stars.ti_end_min = pc->stars.ti_end_min; c->hydro.ti_old_part = pc->hydro.ti_old_part; c->grav.ti_old_part = pc->grav.ti_old_part; c->grav.ti_old_multipole = pc->grav.ti_old_multipole; @@ -415,6 +417,7 @@ int cell_pack_end_step(struct cell *restrict c, pcells[0].hydro.ti_end_max = c->hydro.ti_end_max; pcells[0].grav.ti_end_min = c->grav.ti_end_min; pcells[0].grav.ti_end_max = c->grav.ti_end_max; + pcells[0].stars.ti_end_min = c->stars.ti_end_min; pcells[0].hydro.dx_max_part = c->hydro.dx_max_part; pcells[0].stars.dx_max_part = c->stars.dx_max_part; @@ -452,6 +455,7 @@ int cell_unpack_end_step(struct cell *restrict c, c->hydro.ti_end_max = pcells[0].hydro.ti_end_max; c->grav.ti_end_min = pcells[0].grav.ti_end_min; c->grav.ti_end_max = pcells[0].grav.ti_end_max; + c->stars.ti_end_min = pcells[0].stars.ti_end_min; c->hydro.dx_max_part = pcells[0].hydro.dx_max_part; c->stars.dx_max_part = pcells[0].stars.dx_max_part; diff --git a/src/cell.h b/src/cell.h index 986bc99194702518c7b3a2f08fec95a45a7f4f3c..97ca22e584c67de20ca0826425f60523b8158ffa 100644 --- a/src/cell.h +++ b/src/cell.h @@ -147,6 +147,9 @@ struct pcell { /*! Maximal smoothing length. */ double h_max; + /*! Minimal integer end-of-timestep in this cell for stars tasks */ + integertime_t ti_end_min; + } stars; /*! Maximal depth in that part of the tree */ @@ -198,6 +201,9 @@ struct pcell_step { /*! Maximal distance any #part has travelled since last rebuild */ float dx_max_part; + /*! Minimal integer end-of-timestep in this cell (stars) */ + integertime_t ti_end_min; + } stars; }; diff --git a/src/engine_marktasks.c b/src/engine_marktasks.c index 8b27a5b60892a6d906af9652ff3a4c506e6059cb..ad36c532da9b582e9f3cdb3287e8cbd121642b67 100644 --- a/src/engine_marktasks.c +++ b/src/engine_marktasks.c @@ -180,13 +180,12 @@ void engine_marktasks_mapper(void *map_data, int num_elements, #endif const int ci_active_hydro = cell_is_active_hydro(ci, e); const int cj_active_hydro = cell_is_active_hydro(cj, e); + const int ci_active_gravity = cell_is_active_gravity(ci, e); const int cj_active_gravity = cell_is_active_gravity(cj, e); - // MATTHIEU: This is broken here. In cases with ext-potential this - // crashes. - const int ci_active_stars = 0; // cell_is_active_stars(ci, e); - const int cj_active_stars = 0; // cell_is_active_stars(cj, e); + const int ci_active_stars = cell_is_active_stars(ci, e); + const int cj_active_stars = cell_is_active_stars(cj, e); /* Only activate tasks that involve a local active cell. */ if ((t_subtype == task_subtype_density ||