diff --git a/examples/analyse_tasks.py b/examples/analyse_tasks.py index a72ee0ce637b6ac2da4b8b95dac5bacab3d40a99..78d03ae5436a1fc56abcd6f6b99a4920011fa6db 100755 --- a/examples/analyse_tasks.py +++ b/examples/analyse_tasks.py @@ -54,10 +54,12 @@ infile = args.input TASKTYPES = ["none", "sort", "self", "pair", "sub_self", "sub_pair", "init_grav", "init_grav_out", "ghost_in", "ghost", "ghost_out", "extra_ghost", "drift_part", "drift_gpart", "end_force", "kick1", "kick2", "timestep", "send", "recv", "grav_long_range", "grav_mm", "grav_down_in", - "grav_down", "grav_mesh", "cooling", "sourceterms", "count"] + "grav_down", "grav_mesh", "cooling", "sourceterms", + "stars_ghost_in", "stars_ghost", "stars_ghost_out", + "count"] SUBTYPES = ["none", "density", "gradient", "force", "grav", "external_grav", - "tend", "xv", "rho", "gpart", "multipole", "spart", "count"] + "tend", "xv", "rho", "gpart", "multipole", "spart", "stars_density", "count"] SIDS = ["(-1,-1,-1)", "(-1,-1, 0)", "(-1,-1, 1)", "(-1, 0,-1)", "(-1, 0, 0)", "(-1, 0, 1)", "(-1, 1,-1)", "(-1, 1, 0)", diff --git a/examples/plot_tasks.py b/examples/plot_tasks.py index 9eecf6f4ca15148f544ea48cb65c97cd3802a48d..5c5a683ca043eabd6ed5af094620da719a2404f6 100755 --- a/examples/plot_tasks.py +++ b/examples/plot_tasks.py @@ -112,17 +112,20 @@ pl.rcParams.update(PLOT_PARAMS) TASKTYPES = ["none", "sort", "self", "pair", "sub_self", "sub_pair", "init_grav", "init_grav_out", "ghost_in", "ghost", "ghost_out", "extra_ghost", "drift_part", "drift_gpart", "end_force", "kick1", "kick2", "timestep", "send", "recv", "grav_long_range", "grav_mm", "grav_down_in", - "grav_down", "grav_mesh", "cooling", "sourceterms", "count"] + "grav_down", "grav_mesh", "cooling", "sourceterms", + "stars_ghost_in", "stars_ghost", "stars_ghost_out", + "count"] SUBTYPES = ["none", "density", "gradient", "force", "grav", "external_grav", - "tend", "xv", "rho", "gpart", "multipole", "spart", "count"] + "tend", "xv", "rho", "gpart", "multipole", "spart", "stars_density", "count"] # Task/subtypes of interest. FULLTYPES = ["self/force", "self/density", "self/grav", "sub_self/force", "sub_self/density", "pair/force", "pair/density", "pair/grav", "sub_pair/force", "sub_pair/density", "recv/xv", "send/xv", "recv/rho", "send/rho", - "recv/tend", "send/tend", "recv/gpart", "send/gpart"] + "recv/tend", "send/tend", "recv/gpart", "send/gpart", "self/stars_density", + "pair/stars_density", "sub_self/stars_density", "sub_pair/stars_density"] # A number of colours for the various types. Recycled when there are # more task types than colours... diff --git a/src/active.h b/src/active.h index ed882229f28b5bc5289a951ab4e60e7098ce2457..5b8c2684822ebbc1d1c86b6ebb0d7d6a869959a4 100644 --- a/src/active.h +++ b/src/active.h @@ -177,8 +177,6 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active_gravity( /** * @brief Does a cell contain any s-particle finishing their time-step now ? * - * WARNING: TODO: need to be implemented - * * @param c The #cell. * @param e The #engine containing information about the current time. * @return 1 if the #cell contains at least an active particle, 0 otherwise. @@ -186,6 +184,8 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active_gravity( __attribute__((always_inline)) INLINE static int cell_is_active_stars( const struct cell *c, const struct engine *e) { + // LOIC: Need star-specific implementation + return cell_is_active_gravity(c, e); } diff --git a/src/cell.c b/src/cell.c index 89991aede2a94e29f4d25fe3b00c265d1c1479cf..24a647e1b9e709bb8f05158c64dbb9b81956fe1f 100644 --- a/src/cell.c +++ b/src/cell.c @@ -1115,7 +1115,7 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, ptrdiff_t sparts_offset, if (gparts[j].type == swift_type_gas) { parts[-gparts[j].id_or_neg_offset - parts_offset].gpart = &gparts[j]; - } else if (gparts[j].type == swift_type_star) { + } else if (gparts[j].type == swift_type_stars) { sparts[-gparts[j].id_or_neg_offset - sparts_offset].gpart = &gparts[j]; } @@ -1125,7 +1125,7 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, ptrdiff_t sparts_offset, gbuff[k] = temp_buff; if (gparts[k].type == swift_type_gas) { parts[-gparts[k].id_or_neg_offset - parts_offset].gpart = &gparts[k]; - } else if (gparts[k].type == swift_type_star) { + } else if (gparts[k].type == swift_type_stars) { sparts[-gparts[k].id_or_neg_offset - sparts_offset].gpart = &gparts[k]; } @@ -2028,7 +2028,7 @@ void cell_activate_subcell_hydro_tasks(struct cell *ci, struct cell *cj, */ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj, struct scheduler *s) { - // LOIC: to implement + // LOIC: to implement } /** diff --git a/src/cell.h b/src/cell.h index 5622054fb591c3077be68b7541548b9f620dad31..f2f8a9ca62dca70afb2dc707e15df7948a6dc03d 100644 --- a/src/cell.h +++ b/src/cell.h @@ -599,13 +599,12 @@ cell_can_recurse_in_self_hydro_task(const struct cell *c) { * @brief Can a sub-pair star task recurse to a lower level based * on the status of the particles in the cell. * - * WARNING: TODO: need to be implemented - * * @param c The #cell. */ __attribute__((always_inline)) INLINE static int cell_can_recurse_in_pair_stars_task(const struct cell *c) { + // LOIC: To implement return 0; } @@ -613,13 +612,12 @@ cell_can_recurse_in_pair_stars_task(const struct cell *c) { * @brief Can a sub-self stars task recurse to a lower level based * on the status of the particles in the cell. * - * WARNING: TODO: need to be implemented - * * @param c The #cell. */ __attribute__((always_inline)) INLINE static int cell_can_recurse_in_self_stars_task(const struct cell *c) { + // LOIC: To implement return 0; } @@ -666,6 +664,7 @@ __attribute__((always_inline)) INLINE static int cell_can_split_self_hydro_task( __attribute__((always_inline)) INLINE static int cell_can_split_pair_stars_task( const struct cell *c) { + // LOIC: To implement return 0; } @@ -678,6 +677,7 @@ __attribute__((always_inline)) INLINE static int cell_can_split_pair_stars_task( __attribute__((always_inline)) INLINE static int cell_can_split_self_stars_task( const struct cell *c) { + // LOIC: To implement return 0; } diff --git a/src/engine.c b/src/engine.c index 6b5e6dddfe377354962010ae750f1d9f9f707f09..9d918db11a1ad09ece2e6d6895118c8c0605659d 100644 --- a/src/engine.c +++ b/src/engine.c @@ -3982,94 +3982,10 @@ void engine_marktasks_mapper(void *map_data, int num_elements, /* Only interested in stars_density tasks as of here. */ if (t->subtype == task_subtype_stars_density) { - // LOIC: Need implementing - /* Too much particle movement? */ if (cell_need_rebuild_for_pair(ci, cj)) *rebuild_space = 1; -#ifdef WITH_MPI - error("MPI with stars not implemented"); - /* /\* Activate the send/recv tasks. *\/ */ - /* if (ci->nodeID != engine_rank) { */ - - /* /\* If the local cell is active, receive data from the foreign - * cell. *\/ */ - /* if (cj_active_hydro) { */ - /* scheduler_activate(s, ci->recv_xv); */ - /* if (ci_active_hydro) { */ - /* scheduler_activate(s, ci->recv_rho); */ - /* } */ - /* } */ - - /* /\* If the foreign cell is active, we want its ti_end values. *\/ - */ - /* if (ci_active_hydro) scheduler_activate(s, ci->recv_ti); */ - - /* /\* Is the foreign cell active and will need stuff from us? *\/ */ - /* if (ci_active_hydro) { */ - - /* struct link *l = */ - /* scheduler_activate_send(s, cj->send_xv, ci->nodeID); */ - - /* /\* Drift the cell which will be sent at the level at which it is - */ - /* sent, i.e. drift the cell specified in the send task (l->t) */ - /* itself. *\/ */ - /* cell_activate_drift_part(l->t->ci, s); */ - - /* /\* If the local cell is also active, more stuff will be needed. - * *\/ */ - /* if (cj_active_hydro) { */ - /* scheduler_activate_send(s, cj->send_rho, ci->nodeID); */ - - /* } */ - /* } */ - - /* /\* If the local cell is active, send its ti_end values. *\/ */ - /* if (cj_active_hydro) */ - /* scheduler_activate_send(s, cj->send_ti, ci->nodeID); */ - - /* } else if (cj->nodeID != engine_rank) { */ - - /* /\* If the local cell is active, receive data from the foreign - * cell. *\/ */ - /* if (ci_active_hydro) { */ - /* scheduler_activate(s, cj->recv_xv); */ - /* if (cj_active_hydro) { */ - /* scheduler_activate(s, cj->recv_rho); */ - /* } */ - /* } */ - - /* /\* If the foreign cell is active, we want its ti_end values. *\/ - */ - /* if (cj_active_hydro) scheduler_activate(s, cj->recv_ti); */ - - /* /\* Is the foreign cell active and will need stuff from us? *\/ */ - /* if (cj_active_hydro) { */ - - /* struct link *l = */ - /* scheduler_activate_send(s, ci->send_xv, cj->nodeID); */ - - /* /\* Drift the cell which will be sent at the level at which it is - */ - /* sent, i.e. drift the cell specified in the send task (l->t) */ - /* itself. *\/ */ - /* cell_activate_drift_part(l->t->ci, s); */ - - /* /\* If the local cell is also active, more stuff will be needed. - * *\/ */ - /* if (ci_active_hydro) { */ - - /* scheduler_activate_send(s, ci->send_rho, cj->nodeID); */ - - /* } */ - /* } */ - - /* /\* If the local cell is active, send its ti_end values. *\/ */ - /* if (ci_active_hydro) */ - /* scheduler_activate_send(s, ci->send_ti, cj->nodeID); */ - /* } */ -#endif + // LOIC: Need implementing MPI case } /* Only interested in gravity tasks as of here. */ diff --git a/src/scheduler.c b/src/scheduler.c index cf816470b6c43553534ff469449a94f1f06402d7..50ca40c2771c3f152d12b240a74bf53d9b4e35a7 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -817,6 +817,8 @@ static void scheduler_splittask_hydro(struct task *t, struct scheduler *s) { */ static void scheduler_splittask_stars(struct task *t, struct scheduler *s) { + // LOIC: This is un-tested. Need to verify that it works. + /* Iterate on this task until we're done with it. */ int redo = 1; while (redo) { @@ -1767,6 +1769,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) { break; case task_type_self: + // LOIC: Need to do something for stars here if (t->subtype == task_subtype_grav) cost = 1.f * (wscale * gcount_i) * gcount_i; else if (t->subtype == task_subtype_external_grav) @@ -1776,6 +1779,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) { break; case task_type_pair: + // LOIC: Need to do something for stars here if (t->subtype == task_subtype_grav) { if (t->ci->nodeID != nodeID || t->cj->nodeID != nodeID) cost = 3.f * (wscale * gcount_i) * gcount_j; @@ -1790,6 +1794,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) { break; case task_type_sub_pair: + // LOIC: Need to do something for stars here if (t->ci->nodeID != nodeID || t->cj->nodeID != nodeID) { if (t->flags < 0) cost = 3.f * (wscale * count_i) * count_j; @@ -1804,6 +1809,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) { break; case task_type_sub_self: + // LOIC: Need to do something for stars here cost = 1.f * (wscale * count_i) * count_i; break; case task_type_ghost: