Skip to content
Snippets Groups Projects
Commit e64b67bc authored by Loic Hausammann's avatar Loic Hausammann
Browse files

fix logic feedback

parent e356434c
No related branches found
No related tags found
3 merge requests!787Eagle stellar evolution matthieu,!781Eagle stellar evolution,!778Fix default models
...@@ -344,18 +344,25 @@ void engine_marktasks_mapper(void *map_data, int num_elements, ...@@ -344,18 +344,25 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
} }
} }
/* Stars density */ /* Stars density and feedback */
if (t_subtype == task_subtype_stars_density && const int stars_density = t_subtype == task_subtype_stars_density &&
((ci_active_stars && ci->nodeID == engine_rank) || ((ci_active_stars && ci->nodeID == engine_rank) ||
(cj_active_stars && cj->nodeID == engine_rank))) { (cj_active_stars && cj->nodeID == engine_rank));
const int stars_feedback = t_subtype == task_subtype_stars_feedback &&
((ci_active_stars && cj->nodeID == engine_rank) ||
(cj_active_stars && ci->nodeID == engine_rank));
if (stars_density || stars_feedback) {
scheduler_activate(s, t); scheduler_activate(s, t);
const int should_do = t_subtype == task_subtype_stars_density ||
cj->nodeID != ci->nodeID;
/* Set the correct sorting flags */ /* Set the correct sorting flags */
if (t_type == task_type_pair) { if (t_type == task_type_pair) {
/* Do ci */ /* Do ci */
if (ci_active_stars) { if (ci_active_stars && should_do) {
/* Store some values. */ /* Store some values. */
atomic_or(&cj->hydro.requires_sorts, 1 << t->flags); atomic_or(&cj->hydro.requires_sorts, 1 << t->flags);
atomic_or(&ci->stars.requires_sorts, 1 << t->flags); atomic_or(&ci->stars.requires_sorts, 1 << t->flags);
...@@ -375,7 +382,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements, ...@@ -375,7 +382,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
} }
/* Do cj */ /* Do cj */
if (cj_active_stars) { if (cj_active_stars && should_do) {
/* Store some values. */ /* Store some values. */
atomic_or(&ci->hydro.requires_sorts, 1 << t->flags); atomic_or(&ci->hydro.requires_sorts, 1 << t->flags);
atomic_or(&cj->stars.requires_sorts, 1 << t->flags); atomic_or(&cj->stars.requires_sorts, 1 << t->flags);
...@@ -395,19 +402,11 @@ void engine_marktasks_mapper(void *map_data, int num_elements, ...@@ -395,19 +402,11 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
} }
/* Store current values of dx_max and h_max. */ /* Store current values of dx_max and h_max. */
else if (t_type == task_type_sub_pair) { else if (t_type == task_type_sub_pair && should_do) {
cell_activate_subcell_stars_tasks(t->ci, t->cj, s); cell_activate_subcell_stars_tasks(t->ci, t->cj, s);
} }
} }
/* Stars feedback */
if (t_subtype == task_subtype_stars_feedback &&
((ci_active_stars && ci->nodeID == engine_rank) ||
(cj_active_stars && cj->nodeID == engine_rank))) {
scheduler_activate(s, t);
}
/* Gravity */ /* Gravity */
if ((t_subtype == task_subtype_grav) && if ((t_subtype == task_subtype_grav) &&
((ci_active_gravity && ci_nodeID == nodeID) || ((ci_active_gravity && ci_nodeID == nodeID) ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment