diff --git a/src/scheduler.c b/src/scheduler.c index 4f7af597cddf275892f33fa18b6ff3aed8d26cc5..24efe915a8a5e1f7a9cf066fd356d54e1dfc7b0d 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -1366,21 +1366,35 @@ void scheduler_reweight(struct scheduler *s, int verbose) { (sizeof(int) * 8 - intrinsics_clz(t->ci->stars.count)); break; + case task_type_stars_resort: + cost = wscale * intrinsics_popcount(t->flags) * scount_i * + (sizeof(int) * 8 - intrinsics_clz(t->ci->stars.count)); + break; + case task_type_self: if (t->subtype == task_subtype_grav) { cost = 1.f * (wscale * gcount_i) * gcount_i; } else if (t->subtype == task_subtype_external_grav) cost = 1.f * wscale * gcount_i; - else if (t->subtype == task_subtype_stars_density) - cost = 1.f * wscale * scount_i * count_i; - else if (t->subtype == task_subtype_stars_feedback) + else if (t->subtype == task_subtype_stars_density || + t->subtype == task_subtype_stars_feedback) cost = 1.f * wscale * scount_i * count_i; - else if (t->subtype == task_subtype_bh_density) + else if (t->subtype == task_subtype_bh_density || + t->subtype == task_subtype_bh_swallow || + t->subtype == task_subtype_bh_feedback) cost = 1.f * wscale * bcount_i * count_i; - else if (t->subtype == task_subtype_bh_feedback) - cost = 1.f * wscale * bcount_i * count_i; - else // hydro loops + else if (t->subtype == task_subtype_do_gas_swallow) + cost = 1.f * wscale * count_i; + else if (t->subtype == task_subtype_do_bh_swallow) + cost = 1.f * wscale * bcount_i; + else if (t->subtype == task_subtype_density || + t->subtype == task_subtype_gradient || + t->subtype == task_subtype_force || + t->subtype == task_subtype_limiter) cost = 1.f * (wscale * count_i) * count_i; + else + error("Untreated sub-type for selfs: %s", + subtaskID_names[t->subtype]); break; case task_type_pair: @@ -1401,6 +1415,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) { sid_scale[t->flags]; } else if (t->subtype == task_subtype_bh_density || + t->subtype == task_subtype_bh_swallow || t->subtype == task_subtype_bh_feedback) { if (t->ci->nodeID != nodeID) cost = 3.f * wscale * count_i * bcount_j * sid_scale[t->flags]; @@ -1410,11 +1425,24 @@ void scheduler_reweight(struct scheduler *s, int verbose) { cost = 2.f * wscale * (bcount_i * count_j + bcount_j * count_i) * sid_scale[t->flags]; - } else { // hydro loops + } else if (t->subtype == task_subtype_do_gas_swallow) { + cost = 1.f * wscale * (count_i + count_j); + + } else if (t->subtype == task_subtype_do_bh_swallow) { + cost = 1.f * wscale * (bcount_i + bcount_j); + + } else if (t->subtype == task_subtype_density || + t->subtype == task_subtype_gradient || + t->subtype == task_subtype_force || + t->subtype == task_subtype_limiter) { if (t->ci->nodeID != nodeID || t->cj->nodeID != nodeID) cost = 3.f * (wscale * count_i) * count_j * sid_scale[t->flags]; else cost = 2.f * (wscale * count_i) * count_j * sid_scale[t->flags]; + + } else { + error("Untreated sub-type for pairs: %s", + subtaskID_names[t->subtype]); } break; @@ -1434,6 +1462,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) { } } else if (t->subtype == task_subtype_bh_density || + t->subtype == task_subtype_bh_swallow || t->subtype == task_subtype_bh_feedback) { if (t->ci->nodeID != nodeID) { cost = 3.f * (wscale * count_i) * bcount_j * sid_scale[t->flags]; @@ -1444,26 +1473,48 @@ void scheduler_reweight(struct scheduler *s, int verbose) { sid_scale[t->flags]; } - } else { // hydro loops + } else if (t->subtype == task_subtype_do_gas_swallow) { + cost = 1.f * wscale * (count_i + count_j); + + } else if (t->subtype == task_subtype_do_bh_swallow) { + cost = 1.f * wscale * (bcount_i + bcount_j); + + } else if (t->subtype == task_subtype_density || + t->subtype == task_subtype_gradient || + t->subtype == task_subtype_force || + t->subtype == task_subtype_limiter) { if (t->ci->nodeID != nodeID || t->cj->nodeID != nodeID) { cost = 3.f * (wscale * count_i) * count_j * sid_scale[t->flags]; } else { cost = 2.f * (wscale * count_i) * count_j * sid_scale[t->flags]; } + + } else { + error("Untreated sub-type for sub-pairs: %s", + subtaskID_names[t->subtype]); } break; case task_type_sub_self: - if (t->subtype == task_subtype_stars_density) { - cost = 1.f * (wscale * scount_i) * count_i; - } else if (t->subtype == task_subtype_stars_feedback) { + if (t->subtype == task_subtype_stars_density || + t->subtype == task_subtype_stars_feedback) { cost = 1.f * (wscale * scount_i) * count_i; - } else if (t->subtype == task_subtype_bh_density) { - cost = 1.f * (wscale * bcount_i) * count_i; - } else if (t->subtype == task_subtype_bh_feedback) { + } else if (t->subtype == task_subtype_bh_density || + t->subtype == task_subtype_bh_swallow || + t->subtype == task_subtype_bh_feedback) { cost = 1.f * (wscale * bcount_i) * count_i; - } else { + } else if (t->subtype == task_subtype_do_gas_swallow) { + cost = 1.f * wscale * count_i; + } else if (t->subtype == task_subtype_do_bh_swallow) { + cost = 1.f * wscale * bcount_i; + } else if (t->subtype == task_subtype_density || + t->subtype == task_subtype_gradient || + t->subtype == task_subtype_force || + t->subtype == task_subtype_limiter) { cost = 1.f * (wscale * count_i) * count_i; + } else { + error("Untreated sub-type for sub-selfs: %s", + subtaskID_names[t->subtype]); } break; case task_type_ghost: @@ -1478,6 +1529,9 @@ void scheduler_reweight(struct scheduler *s, int verbose) { case task_type_bh_density_ghost: if (t->ci == t->ci->hydro.super) cost = wscale * bcount_i; break; + case task_type_bh_swallow_ghost2: + if (t->ci == t->ci->hydro.super) cost = wscale * bcount_i; + break; case task_type_drift_part: cost = wscale * count_i; break; @@ -1499,6 +1553,9 @@ void scheduler_reweight(struct scheduler *s, int verbose) { case task_type_grav_long_range: cost = wscale * gcount_i; break; + case task_type_grav_mesh: + cost = wscale * gcount_i; + break; case task_type_grav_mm: cost = wscale * (gcount_i + gcount_j); break; @@ -1523,6 +1580,12 @@ void scheduler_reweight(struct scheduler *s, int verbose) { case task_type_timestep: cost = wscale * (count_i + gcount_i + scount_i + bcount_i); break; + case task_type_timestep_limiter: + cost = wscale * count_i; + break; + case task_type_timestep_sync: + cost = wscale * count_i; + break; case task_type_send: if (count_i < 1e5) cost = 10.f * (wscale * count_i) * count_i;