Commit bdb4fb7e authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Fixes and documentation of a few more places where the implementation will...

Fixes and documentation of a few more places where the implementation will need to be updated in the future.
parent 7ec321b8
......@@ -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)",
......
......@@ -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...
......
......@@ -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);
}
......
......@@ -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
}
/**
......
......@@ -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;
}
......
......@@ -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. */
......
......@@ -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:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment