diff --git a/examples/main.c b/examples/main.c index 2542be95e0b02465fa5b1bdac9b2c2757633a787..7bb7208d6afa01b045b56748025b78b034bb4c57 100644 --- a/examples/main.c +++ b/examples/main.c @@ -751,7 +751,7 @@ int main(int argc, char *argv[]) { /* Check once and for all that we don't have unwanted links */ if (!with_stars && !dry_run) { for (size_t k = 0; k < Ngpart; ++k) - if (gparts[k].type == swift_type_star) error("Linking problem"); + if (gparts[k].type == swift_type_stars) error("Linking problem"); } if (!with_hydro && !dry_run) { for (size_t k = 0; k < Ngpart; ++k) @@ -777,8 +777,9 @@ int main(int argc, char *argv[]) { if (myrank == 0) message( - "Read %lld gas particles, %lld star particles and %lld gparts from " - "the ICs.", + "Read %lld gas particles, %lld stars particles and %lld gparts from " + "the " + "ICs.", N_total[0], N_total[2], N_total[1]); /* Verify that the fields to dump actually exist */ @@ -909,7 +910,7 @@ int main(int argc, char *argv[]) { if (myrank == 0) { long long N_DM = N_total[1] - N_total[2] - N_total[0]; message( - "Running on %lld gas particles, %lld star particles and %lld DM " + "Running on %lld gas particles, %lld stars particles and %lld DM " "particles (%lld gravity particles)", N_total[0], N_total[2], N_total[1] > 0 ? N_DM : 0, N_total[1]); message( diff --git a/examples/parameter_example.yml b/examples/parameter_example.yml index 5fb48eb17d1c210d2a320917e1fd5d1ad67ddd94..b9b67b4d2c9d7a4f0102790d85fa37733d369a71 100644 --- a/examples/parameter_example.yml +++ b/examples/parameter_example.yml @@ -54,6 +54,8 @@ Scheduler: cell_sub_size_self_hydro: 32000 # (Optional) Maximal number of interactions per sub-self hydro task (this is the default value). cell_sub_size_pair_grav: 256000000 # (Optional) Maximal number of interactions per sub-pair gravity task (this is the default value). cell_sub_size_self_grav: 32000 # (Optional) Maximal number of interactions per sub-self gravity task (this is the default value). + cell_sub_size_pair_stars: 256000000 # (Optional) Maximal number of interactions per sub-pair stars task (this is the default value). + cell_sub_size_self_stars: 32000 # (Optional) Maximal number of interactions per sub-self stars task (this is the default value). cell_split_size: 400 # (Optional) Maximal number of particles per cell (this is the default value). cell_subdepth_grav: 2 # (Optional) Maximal depth the gravity tasks can be pushed down (this is the default value). max_top_level_cells: 12 # (Optional) Maximal number of top-level cells in any dimension. The number of top-level cells will be the cube of this (this is the default value). diff --git a/src/cell.h b/src/cell.h index f29a9d3d34cfde3c1493e4778cc3b2faa908e8a5..f84b5ad312fe94919f0f37150bda8800c00c5b30 100644 --- a/src/cell.h +++ b/src/cell.h @@ -649,6 +649,30 @@ __attribute__((always_inline)) INLINE static int cell_can_split_self_hydro_task( return c->split && (space_stretch * kernel_gamma * c->h_max < 0.5f * c->dmin); } +/** + * @brief Can a pair stars task associated with a cell be split into smaller + * sub-tasks. + * + * @param c The #cell. + */ +__attribute__((always_inline)) INLINE static int cell_can_split_pair_stars_task( + const struct cell *c) { + + return 0; +} + +/** + * @brief Can a self stars task associated with a cell be split into smaller + * sub-tasks. + * + * @param c The #cell. + */ +__attribute__((always_inline)) INLINE static int cell_can_split_self_stars_task( + const struct cell *c) { + + return 0; +} + /** * @brief Can a pair gravity task associated with a cell be split into smaller * sub-tasks. diff --git a/src/engine.c b/src/engine.c index 990ba8e4decdea58c066d2872d45b32c72cb93ab..413f29f834b729bcac3e051e56927b65f5119c70 100644 --- a/src/engine.c +++ b/src/engine.c @@ -3332,7 +3332,7 @@ void engine_link_stars_tasks_mapper(void *map_data, int num_elements, /* Make the self-density tasks depend on the drift only. */ scheduler_addunlock(sched, t->ci->super->drift_part, t); - /* Now, build all the dependencies for the hydro */ + /* Now, build all the dependencies for the stars */ engine_make_stars_loops_dependencies(sched, t, t->ci); scheduler_addunlock(sched, t->ci->stars_ghost_out, t->ci->super->end_force); } @@ -3350,13 +3350,13 @@ void engine_link_stars_tasks_mapper(void *map_data, int num_elements, scheduler_addunlock(sched, t->cj->super->sorts, t); } - /* Now, build all the dependencies for the hydro for the cells */ - /* that are local and are not descendant of the same super_hydro-cells */ + /* Now, build all the dependencies for the stars for the cells */ + /* that are local and are not descendant of the same super-cells */ if (t->ci->nodeID == nodeID) { engine_make_stars_loops_dependencies(sched, t, t->ci); } if (t->cj->nodeID == nodeID) { - if (t->ci->super_hydro != t->cj->super) + if (t->ci->super != t->cj->super) engine_make_stars_loops_dependencies(sched, t, t->cj); } @@ -3370,8 +3370,8 @@ void engine_link_stars_tasks_mapper(void *map_data, int num_elements, scheduler_addunlock(sched, t->ci->super->drift_part, t); scheduler_addunlock(sched, t->ci->super->sorts, t); - /* Now, build all the dependencies for the hydro for the cells */ - /* that are local and are not descendant of the same super_hydro-cells */ + /* Now, build all the dependencies for the stars for the cells */ + /* that are local and are not descendant of the same super-cells */ if (t->ci->nodeID == nodeID) { engine_make_stars_loops_dependencies(sched, t, t->ci); } else @@ -3392,8 +3392,8 @@ void engine_link_stars_tasks_mapper(void *map_data, int num_elements, scheduler_addunlock(sched, t->cj->super->sorts, t); } - /* Now, build all the dependencies for the hydro for the cells */ - /* that are local and are not descendant of the same super_hydro-cells */ + /* Now, build all the dependencies for the stars for the cells */ + /* that are local and are not descendant of the same super-cells */ if (t->ci->nodeID == nodeID) { engine_make_stars_loops_dependencies(sched, t, t->ci); } @@ -3434,7 +3434,7 @@ void engine_maketasks(struct engine *e) { tic2 = getticks(); - /* Construct the star hydro loop over neighbours */ + /* Construct the stars hydro loop over neighbours */ if (e->policy & engine_policy_stars) { threadpool_map(&e->threadpool, engine_make_starsloop_tasks_mapper, NULL, s->nr_cells, 1, 0, e); diff --git a/src/scheduler.c b/src/scheduler.c index 391ebe47876490d852bbf70a76bae95930318b03..fd28cc5f4cb8b0f4155f95c96cd36d9abdb7f7ce 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -808,6 +808,477 @@ static void scheduler_splittask_hydro(struct task *t, struct scheduler *s) { } /* iterate over the current task. */ } +/** + * @brief Split a stars task if too large. + * + * @param t The #task + * @param s The #scheduler we are working in. + */ +static void scheduler_splittask_stars(struct task *t, struct scheduler *s) { + + /* Iterate on this task until we're done with it. */ + int redo = 1; + while (redo) { + + /* Reset the redo flag. */ + redo = 0; + + /* Non-splittable task? */ + if ((t->ci == NULL) || (t->type == task_type_pair && t->cj == NULL) || + t->ci->scount == 0 || (t->cj != NULL && t->cj->scount == 0)) { + t->type = task_type_none; + t->subtype = task_subtype_none; + t->cj = NULL; + t->skip = 1; + break; + } + + /* Self-interaction? */ + if (t->type == task_type_self) { + + /* Get a handle on the cell involved. */ + struct cell *ci = t->ci; + + /* Foreign task? */ + if (ci->nodeID != s->nodeID) { + t->skip = 1; + break; + } + + /* Is this cell even split and the task does not violate h ? */ + if (cell_can_split_self_stars_task(ci)) { + + /* Make a sub? */ + if (scheduler_dosub && ci->scount < space_subsize_self_stars) { + + /* convert to a self-subtask. */ + t->type = task_type_sub_self; + + /* Otherwise, make tasks explicitly. */ + } else { + + /* Take a step back (we're going to recycle the current task)... */ + redo = 1; + + /* Add the self tasks. */ + int first_child = 0; + while (ci->progeny[first_child] == NULL) first_child++; + t->ci = ci->progeny[first_child]; + for (int k = first_child + 1; k < 8; k++) + if (ci->progeny[k] != NULL && ci->progeny[k]->scount) + scheduler_splittask_stars( + scheduler_addtask(s, task_type_self, t->subtype, 0, 0, + ci->progeny[k], NULL), + s); + + /* Make a task for each pair of progeny */ + for (int j = 0; j < 8; j++) + if (ci->progeny[j] != NULL && ci->progeny[j]->scount) + for (int k = j + 1; k < 8; k++) + if (ci->progeny[k] != NULL && ci->progeny[k]->scount) + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, + sub_sid_flag[j][k], 0, ci->progeny[j], + ci->progeny[k]), + s); + } + } /* Cell is split */ + + } /* Self interaction */ + + /* Pair interaction? */ + else if (t->type == task_type_pair) { + + /* Get a handle on the cells involved. */ + struct cell *ci = t->ci; + struct cell *cj = t->cj; + + /* Foreign task? */ + if (ci->nodeID != s->nodeID && cj->nodeID != s->nodeID) { + t->skip = 1; + break; + } + + /* Get the sort ID, use space_getsid and not t->flags + to make sure we get ci and cj swapped if needed. */ + double shift[3]; + const int sid = space_getsid(s->space, &ci, &cj, shift); + + /* Should this task be split-up? */ + if (cell_can_split_pair_stars_task(ci) && + cell_can_split_pair_stars_task(cj)) { + + /* Replace by a single sub-task? */ + if (scheduler_dosub && /* Use division to avoid integer overflow. */ + ci->scount * sid_scale[sid] < space_subsize_pair_stars / cj->scount && + !sort_is_corner(sid)) { + + /* Make this task a sub task. */ + t->type = task_type_sub_pair; + + /* Otherwise, split it. */ + } else { + + /* Take a step back (we're going to recycle the current task)... */ + redo = 1; + + /* For each different sorting type... */ + switch (sid) { + + case 0: /* ( 1 , 1 , 1 ) */ + t->ci = ci->progeny[7]; + t->cj = cj->progeny[0]; + t->flags = 0; + break; + + case 1: /* ( 1 , 1 , 0 ) */ + t->ci = ci->progeny[6]; + t->cj = cj->progeny[0]; + t->flags = 1; + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 1, 0, + ci->progeny[7], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 0, 0, + ci->progeny[6], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 2, 0, + ci->progeny[7], cj->progeny[0]), + s); + break; + + case 2: /* ( 1 , 1 , -1 ) */ + t->ci = ci->progeny[6]; + t->cj = cj->progeny[1]; + t->flags = 2; + break; + + case 3: /* ( 1 , 0 , 1 ) */ + t->ci = ci->progeny[5]; + t->cj = cj->progeny[0]; + t->flags = 3; + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 3, 0, + ci->progeny[7], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 0, 0, + ci->progeny[5], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 6, 0, + ci->progeny[7], cj->progeny[0]), + s); + break; + + case 4: /* ( 1 , 0 , 0 ) */ + t->ci = ci->progeny[4]; + t->cj = cj->progeny[0]; + t->flags = 4; + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 5, 0, + ci->progeny[5], cj->progeny[0]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 7, 0, + ci->progeny[6], cj->progeny[0]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 8, 0, + ci->progeny[7], cj->progeny[0]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 3, 0, + ci->progeny[4], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 4, 0, + ci->progeny[5], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 6, 0, + ci->progeny[6], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 7, 0, + ci->progeny[7], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 1, 0, + ci->progeny[4], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 2, 0, + ci->progeny[5], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 4, 0, + ci->progeny[6], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 5, 0, + ci->progeny[7], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 0, 0, + ci->progeny[4], cj->progeny[3]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 1, 0, + ci->progeny[5], cj->progeny[3]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 3, 0, + ci->progeny[6], cj->progeny[3]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 4, 0, + ci->progeny[7], cj->progeny[3]), + s); + break; + + case 5: /* ( 1 , 0 , -1 ) */ + t->ci = ci->progeny[4]; + t->cj = cj->progeny[1]; + t->flags = 5; + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 5, 0, + ci->progeny[6], cj->progeny[3]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 2, 0, + ci->progeny[4], cj->progeny[3]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 8, 0, + ci->progeny[6], cj->progeny[1]), + s); + break; + + case 6: /* ( 1 , -1 , 1 ) */ + t->ci = ci->progeny[5]; + t->cj = cj->progeny[2]; + t->flags = 6; + break; + + case 7: /* ( 1 , -1 , 0 ) */ + t->ci = ci->progeny[4]; + t->cj = cj->progeny[3]; + t->flags = 6; + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 8, 0, + ci->progeny[5], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 7, 0, + ci->progeny[4], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 7, 0, + ci->progeny[5], cj->progeny[3]), + s); + break; + + case 8: /* ( 1 , -1 , -1 ) */ + t->ci = ci->progeny[4]; + t->cj = cj->progeny[3]; + t->flags = 8; + break; + + case 9: /* ( 0 , 1 , 1 ) */ + t->ci = ci->progeny[3]; + t->cj = cj->progeny[0]; + t->flags = 9; + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 9, 0, + ci->progeny[7], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 0, 0, + ci->progeny[3], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 8, 0, + ci->progeny[7], cj->progeny[0]), + s); + break; + + case 10: /* ( 0 , 1 , 0 ) */ + t->ci = ci->progeny[2]; + t->cj = cj->progeny[0]; + t->flags = 10; + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 11, 0, + ci->progeny[3], cj->progeny[0]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 7, 0, + ci->progeny[6], cj->progeny[0]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 6, 0, + ci->progeny[7], cj->progeny[0]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 9, 0, + ci->progeny[2], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 10, 0, + ci->progeny[3], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 8, 0, + ci->progeny[6], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 7, 0, + ci->progeny[7], cj->progeny[1]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 1, 0, + ci->progeny[2], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 2, 0, + ci->progeny[3], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 10, 0, + ci->progeny[6], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 11, 0, + ci->progeny[7], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 0, 0, + ci->progeny[2], cj->progeny[5]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 1, 0, + ci->progeny[3], cj->progeny[5]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 9, 0, + ci->progeny[6], cj->progeny[5]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 10, 0, + ci->progeny[7], cj->progeny[5]), + s); + break; + + case 11: /* ( 0 , 1 , -1 ) */ + t->ci = ci->progeny[2]; + t->cj = cj->progeny[1]; + t->flags = 11; + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 11, 0, + ci->progeny[6], cj->progeny[5]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 2, 0, + ci->progeny[2], cj->progeny[5]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 6, 0, + ci->progeny[6], cj->progeny[1]), + s); + break; + + case 12: /* ( 0 , 0 , 1 ) */ + t->ci = ci->progeny[1]; + t->cj = cj->progeny[0]; + t->flags = 12; + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 11, 0, + ci->progeny[3], cj->progeny[0]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 5, 0, + ci->progeny[5], cj->progeny[0]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 2, 0, + ci->progeny[7], cj->progeny[0]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 9, 0, + ci->progeny[1], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 12, 0, + ci->progeny[3], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 8, 0, + ci->progeny[5], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 5, 0, + ci->progeny[7], cj->progeny[2]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 3, 0, + ci->progeny[1], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 6, 0, + ci->progeny[3], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 12, 0, + ci->progeny[5], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 11, 0, + ci->progeny[7], cj->progeny[4]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 0, 0, + ci->progeny[1], cj->progeny[6]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 3, 0, + ci->progeny[3], cj->progeny[6]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 9, 0, + ci->progeny[5], cj->progeny[6]), + s); + scheduler_splittask_stars( + scheduler_addtask(s, task_type_pair, t->subtype, 12, 0, + ci->progeny[7], cj->progeny[6]), + s); + break; + } /* switch(sid) */ + } + + /* Otherwise, break it up if it is too large? */ + } else if (scheduler_doforcesplit && ci->split && cj->split && + (ci->scount > space_maxsize / cj->scount)) { + + /* Replace the current task. */ + t->type = task_type_none; + + for (int j = 0; j < 8; j++) + if (ci->progeny[j] != NULL && ci->progeny[j]->scount) + for (int k = 0; k < 8; k++) + if (cj->progeny[k] != NULL && cj->progeny[k]->scount) { + struct task *tl = + scheduler_addtask(s, task_type_pair, t->subtype, 0, 0, + ci->progeny[j], cj->progeny[k]); + scheduler_splittask_stars(tl, s); + tl->flags = space_getsid(s->space, &t->ci, &t->cj, shift); + } + } + } /* pair interaction? */ + } /* iterate over the current task. */ +} + /** * @brief Split a gravity task if too large. * @@ -990,7 +1461,7 @@ void scheduler_splittasks_mapper(void *map_data, int num_elements, } else if (t->type == task_type_grav_mesh) { /* For future use */ } else if (t->subtype == task_subtype_stars_density) { - /* For future use */ + scheduler_splittask_stars(t, s); } else { #ifdef SWIFT_DEBUG_CHECKS error("Unexpected task sub-type"); diff --git a/src/space.c b/src/space.c index e3701dc9249d8b7170b3f0f99bd4e57b5138c1b0..a8058e5189903eb0ee0141b95d78febf8d10d267 100644 --- a/src/space.c +++ b/src/space.c @@ -66,6 +66,8 @@ int space_subsize_pair_hydro = space_subsize_pair_hydro_default; int space_subsize_self_hydro = space_subsize_self_hydro_default; int space_subsize_pair_grav = space_subsize_pair_grav_default; int space_subsize_self_grav = space_subsize_self_grav_default; +int space_subsize_pair_stars = space_subsize_pair_stars_default; +int space_subsize_self_stars = space_subsize_self_stars_default; int space_subdepth_grav = space_subdepth_grav_default; int space_maxsize = space_maxsize_default; #ifdef SWIFT_DEBUG_CHECKS @@ -185,6 +187,7 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements, c->stars_ghost_in = NULL; c->stars_ghost_out = NULL; c->stars_ghost = NULL; + c->stars_density = NULL; c->kick1 = NULL; c->kick2 = NULL; c->timestep = NULL; @@ -2847,6 +2850,12 @@ void space_init(struct space *s, struct swift_params *params, space_subsize_self_grav = parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_grav", space_subsize_self_grav_default); + space_subsize_pair_stars = + parser_get_opt_param_int(params, "Scheduler:cell_sub_size_pair_stars", + space_subsize_pair_stars_default); + space_subsize_self_stars = + parser_get_opt_param_int(params, "Scheduler:cell_sub_size_self_stars", + space_subsize_self_stars_default); space_splitsize = parser_get_opt_param_int( params, "Scheduler:cell_split_size", space_splitsize_default); space_subdepth_grav = parser_get_opt_param_int( @@ -2860,6 +2869,8 @@ void space_init(struct space *s, struct swift_params *params, space_subsize_pair_hydro, space_subsize_self_hydro); message("sub_size_pair_grav set to %d, sub_size_self_grav set to %d", space_subsize_pair_grav, space_subsize_self_grav); + message("sub_size_pair_stars set to %d, sub_size_self_stars set to %d", + space_subsize_pair_stars, space_subsize_self_stars); } /* Apply h scaling */ diff --git a/src/space.h b/src/space.h index f8e722e5a95c95fa1c1313259b898a64a2e1329f..a8d831704e4317b1cf00a9512b53e1fc74e1d23f 100644 --- a/src/space.h +++ b/src/space.h @@ -48,6 +48,8 @@ struct cosmology; #define space_subsize_self_hydro_default 32000 #define space_subsize_pair_grav_default 256000000 #define space_subsize_self_grav_default 32000 +#define space_subsize_pair_stars_default 256000000 +#define space_subsize_self_stars_default 32000 #define space_subdepth_grav_default 2 #define space_max_top_level_cells_default 12 #define space_stretch 1.10f @@ -63,6 +65,8 @@ extern int space_subsize_pair_hydro; extern int space_subsize_self_hydro; extern int space_subsize_pair_grav; extern int space_subsize_self_grav; +extern int space_subsize_pair_stars; +extern int space_subsize_self_stars; extern int space_subdepth_grav; /**