Commit a5096a40 authored by Loic Hausammann's avatar Loic Hausammann
Browse files

Spliting hydro/stars

parent 561825dd
...@@ -2325,6 +2325,9 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) { ...@@ -2325,6 +2325,9 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
if (c->ghost_in != NULL) scheduler_activate(s, c->ghost_in); if (c->ghost_in != NULL) scheduler_activate(s, c->ghost_in);
if (c->ghost_out != NULL) scheduler_activate(s, c->ghost_out); if (c->ghost_out != NULL) scheduler_activate(s, c->ghost_out);
if (c->ghost != NULL) scheduler_activate(s, c->ghost); if (c->ghost != NULL) scheduler_activate(s, c->ghost);
if (c->star_ghost_in != NULL) scheduler_activate(s, c->star_ghost_in);
if (c->star_ghost_out != NULL) scheduler_activate(s, c->star_ghost_out);
if (c->star_ghost != NULL) scheduler_activate(s, c->star_ghost);
if (c->kick1 != NULL) scheduler_activate(s, c->kick1); if (c->kick1 != NULL) scheduler_activate(s, c->kick1);
if (c->kick2 != NULL) scheduler_activate(s, c->kick2); if (c->kick2 != NULL) scheduler_activate(s, c->kick2);
if (c->timestep != NULL) scheduler_activate(s, c->timestep); if (c->timestep != NULL) scheduler_activate(s, c->timestep);
......
...@@ -430,7 +430,7 @@ void engine_make_hierarchical_tasks_stars(struct engine *e, struct cell *c) { ...@@ -430,7 +430,7 @@ void engine_make_hierarchical_tasks_stars(struct engine *e, struct cell *c) {
struct scheduler *s = &e->sched; struct scheduler *s = &e->sched;
/* Are we in a super-cell ? */ /* Are we in a super-cell ? */
if (c->super_hydro == c) { if (c->super == c) {
/* Local tasks only... */ /* Local tasks only... */
if (c->nodeID == e->nodeID) { if (c->nodeID == e->nodeID) {
...@@ -2958,7 +2958,7 @@ static inline void engine_make_stars_loops_dependencies(struct scheduler *sched, ...@@ -2958,7 +2958,7 @@ static inline void engine_make_stars_loops_dependencies(struct scheduler *sched,
struct task *density, struct task *density,
struct cell *c) { struct cell *c) {
/* density loop --> ghost */ /* density loop --> ghost */
scheduler_addunlock(sched, density, c->super_hydro->star_ghost_in); scheduler_addunlock(sched, density, c->super->star_ghost_in);
} }
/** /**
...@@ -2971,14 +2971,13 @@ static inline void engine_make_stars_loops_dependencies(struct scheduler *sched, ...@@ -2971,14 +2971,13 @@ static inline void engine_make_stars_loops_dependencies(struct scheduler *sched,
* With all the relevant tasks for a given cell available, we construct * With all the relevant tasks for a given cell available, we construct
* all the dependencies for that cell. * all the dependencies for that cell.
*/ */
void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements, void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
void *extra_data) { void *extra_data) {
struct engine *e = (struct engine *)extra_data; struct engine *e = (struct engine *)extra_data;
struct scheduler *sched = &e->sched; struct scheduler *sched = &e->sched;
const int nodeID = e->nodeID; const int nodeID = e->nodeID;
const int with_cooling = (e->policy & engine_policy_cooling); const int with_cooling = (e->policy & engine_policy_cooling);
const int with_stars = (e->policy & engine_policy_stars);
for (int ind = 0; ind < num_elements; ind++) { for (int ind = 0; ind < num_elements; ind++) {
struct task *t = &((struct task *)map_data)[ind]; struct task *t = &((struct task *)map_data)[ind];
...@@ -3008,8 +3007,6 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements, ...@@ -3008,8 +3007,6 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements,
/* Now, build all the dependencies for the hydro */ /* Now, build all the dependencies for the hydro */
engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->ci, engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->ci,
with_cooling); with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
scheduler_addunlock(sched, t3, t->ci->super->end_force); scheduler_addunlock(sched, t3, t->ci->super->end_force);
#else #else
...@@ -3021,8 +3018,7 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements, ...@@ -3021,8 +3018,7 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements,
engine_addlink(e, &t->ci->force, t2); engine_addlink(e, &t->ci->force, t2);
/* Now, build all the dependencies for the hydro */ /* Now, build all the dependencies for the hydro */
if (with_stars) engine_make_hydro_loops_dependencies(sched, t, t2, t->ci, with_cooling);
engine_make_stars_loops_dependencies(sched, t, t->ci);
scheduler_addunlock(sched, t2, t->ci->super->end_force); scheduler_addunlock(sched, t2, t->ci->super->end_force);
#endif #endif
} }
...@@ -3058,18 +3054,12 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements, ...@@ -3058,18 +3054,12 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements,
if (t->ci->nodeID == nodeID) { if (t->ci->nodeID == nodeID) {
engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->ci, engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->ci,
with_cooling); with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
scheduler_addunlock(sched, t3, t->ci->super->end_force); scheduler_addunlock(sched, t3, t->ci->super->end_force);
} }
if (t->cj->nodeID == nodeID) { if (t->cj->nodeID == nodeID) {
if (t->ci->super_hydro != t->cj->super_hydro) if (t->ci->super_hydro != t->cj->super_hydro)
engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->cj, engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->cj,
with_cooling); with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
if (t->ci->super != t->cj->super) if (t->ci->super != t->cj->super)
scheduler_addunlock(sched, t3, t->cj->super->end_force); scheduler_addunlock(sched, t3, t->cj->super->end_force);
} }
...@@ -3088,16 +3078,12 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements, ...@@ -3088,16 +3078,12 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements,
/* that are local and are not descendant of the same super_hydro-cells */ /* that are local and are not descendant of the same super_hydro-cells */
if (t->ci->nodeID == nodeID) { if (t->ci->nodeID == nodeID) {
engine_make_hydro_loops_dependencies(sched, t, t2, t->ci, with_cooling); engine_make_hydro_loops_dependencies(sched, t, t2, t->ci, with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
scheduler_addunlock(sched, t2, t->ci->super->end_force); scheduler_addunlock(sched, t2, t->ci->super->end_force);
} }
if (t->cj->nodeID == nodeID) { if (t->cj->nodeID == nodeID) {
if (t->ci->super_hydro != t->cj->super_hydro) if (t->ci->super_hydro != t->cj->super_hydro)
engine_make_hydro_loops_dependencies(sched, t, t2, t->cj, engine_make_hydro_loops_dependencies(sched, t, t2, t->cj,
with_cooling); with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
if (t->ci->super != t->cj->super) if (t->ci->super != t->cj->super)
scheduler_addunlock(sched, t2, t->cj->super->end_force); scheduler_addunlock(sched, t2, t->cj->super->end_force);
} }
...@@ -3133,8 +3119,6 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements, ...@@ -3133,8 +3119,6 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements,
if (t->ci->nodeID == nodeID) { if (t->ci->nodeID == nodeID) {
engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->ci, engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->ci,
with_cooling); with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
scheduler_addunlock(sched, t3, t->ci->super->end_force); scheduler_addunlock(sched, t3, t->ci->super->end_force);
} }
...@@ -3151,8 +3135,6 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements, ...@@ -3151,8 +3135,6 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements,
/* that are local and are not descendant of the same super_hydro-cells */ /* that are local and are not descendant of the same super_hydro-cells */
if (t->ci->nodeID == nodeID) { if (t->ci->nodeID == nodeID) {
engine_make_hydro_loops_dependencies(sched, t, t2, t->ci, with_cooling); engine_make_hydro_loops_dependencies(sched, t, t2, t->ci, with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
scheduler_addunlock(sched, t2, t->ci->super->end_force); scheduler_addunlock(sched, t2, t->ci->super->end_force);
} }
#endif #endif
...@@ -3193,16 +3175,12 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements, ...@@ -3193,16 +3175,12 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements,
if (t->ci->nodeID == nodeID) { if (t->ci->nodeID == nodeID) {
engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->ci, engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->ci,
with_cooling); with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
scheduler_addunlock(sched, t3, t->ci->super->end_force); scheduler_addunlock(sched, t3, t->ci->super->end_force);
} }
if (t->cj->nodeID == nodeID) { if (t->cj->nodeID == nodeID) {
if (t->ci->super_hydro != t->cj->super_hydro) if (t->ci->super_hydro != t->cj->super_hydro)
engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->cj, engine_make_hydro_loops_dependencies(sched, t, t2, t3, t->cj,
with_cooling); with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
if (t->ci->super != t->cj->super) if (t->ci->super != t->cj->super)
scheduler_addunlock(sched, t3, t->cj->super->end_force); scheduler_addunlock(sched, t3, t->cj->super->end_force);
} }
...@@ -3221,16 +3199,12 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements, ...@@ -3221,16 +3199,12 @@ void engine_make_extra_loop_tasks_mapper(void *map_data, int num_elements,
/* that are local and are not descendant of the same super_hydro-cells */ /* that are local and are not descendant of the same super_hydro-cells */
if (t->ci->nodeID == nodeID) { if (t->ci->nodeID == nodeID) {
engine_make_hydro_loops_dependencies(sched, t, t2, t->ci, with_cooling); engine_make_hydro_loops_dependencies(sched, t, t2, t->ci, with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
scheduler_addunlock(sched, t2, t->ci->super->end_force); scheduler_addunlock(sched, t2, t->ci->super->end_force);
} }
if (t->cj->nodeID == nodeID) { if (t->cj->nodeID == nodeID) {
if (t->ci->super_hydro != t->cj->super_hydro) if (t->ci->super_hydro != t->cj->super_hydro)
engine_make_hydro_loops_dependencies(sched, t, t2, t->cj, engine_make_hydro_loops_dependencies(sched, t, t2, t->cj,
with_cooling); with_cooling);
if (with_stars)
engine_make_stars_loops_dependencies(sched, t, t->ci);
if (t->ci->super != t->cj->super) if (t->ci->super != t->cj->super)
scheduler_addunlock(sched, t2, t->cj->super->end_force); scheduler_addunlock(sched, t2, t->cj->super->end_force);
} }
...@@ -3298,6 +3272,7 @@ void engine_maketasks(struct engine *e) { ...@@ -3298,6 +3272,7 @@ void engine_maketasks(struct engine *e) {
#endif #endif
const size_t self_grav_tasks_per_cell = 125; const size_t self_grav_tasks_per_cell = 125;
const size_t ext_grav_tasks_per_cell = 1; const size_t ext_grav_tasks_per_cell = 1;
const size_t star_tasks_per_cell = 1;
if (e->policy & engine_policy_hydro) if (e->policy & engine_policy_hydro)
e->size_links += s->tot_cells * hydro_tasks_per_cell; e->size_links += s->tot_cells * hydro_tasks_per_cell;
...@@ -3305,6 +3280,8 @@ void engine_maketasks(struct engine *e) { ...@@ -3305,6 +3280,8 @@ void engine_maketasks(struct engine *e) {
e->size_links += s->tot_cells * ext_grav_tasks_per_cell; e->size_links += s->tot_cells * ext_grav_tasks_per_cell;
if (e->policy & engine_policy_self_gravity) if (e->policy & engine_policy_self_gravity)
e->size_links += s->tot_cells * self_grav_tasks_per_cell; e->size_links += s->tot_cells * self_grav_tasks_per_cell;
if (e->policy & engine_policy_stars)
e->size_links += s->tot_cells * star_tasks_per_cell;
/* Allocate the new link list */ /* Allocate the new link list */
if ((e->links = (struct link *)malloc(sizeof(struct link) * e->size_links)) == if ((e->links = (struct link *)malloc(sizeof(struct link) * e->size_links)) ==
...@@ -3827,6 +3804,12 @@ void engine_marktasks_mapper(void *map_data, int num_elements, ...@@ -3827,6 +3804,12 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
scheduler_activate(s, t); scheduler_activate(s, t);
} }
/* Star ghost tasks ? */
else if (t->type == task_type_star_ghost ||
t->type == task_type_star_ghost_in || t->type == task_type_star_ghost_out) {
if (cell_is_active_star(t->ci, e)) scheduler_activate(s, t);
}
/* Time-step? */ /* Time-step? */
else if (t->type == task_type_timestep) { else if (t->type == task_type_timestep) {
t->ci->updated = 0; t->ci->updated = 0;
......
...@@ -224,7 +224,6 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) { ...@@ -224,7 +224,6 @@ void runner_do_star_ghost(struct runner *r, struct cell *c, int timer) {
/* Avoid floating point exception from f_prime = 0 */ /* Avoid floating point exception from f_prime = 0 */
h_new = h_old - f / (f_prime + FLT_MIN); h_new = h_old - f / (f_prime + FLT_MIN);
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
if ((f > 0.f && h_new > h_old) || (f < 0.f && h_new < h_old)) if ((f > 0.f && h_new > h_old) || (f < 0.f && h_new < h_old))
error( error(
...@@ -2429,6 +2428,9 @@ void *runner_main(void *data) { ...@@ -2429,6 +2428,9 @@ void *runner_main(void *data) {
runner_do_extra_ghost(r, ci, 1); runner_do_extra_ghost(r, ci, 1);
break; break;
#endif #endif
case task_type_star_ghost:
runner_do_star_ghost(r, ci, 1);
break;
case task_type_drift_part: case task_type_drift_part:
runner_do_drift_part(r, ci, 1); runner_do_drift_part(r, ci, 1);
break; break;
......
...@@ -934,7 +934,7 @@ void runner_dosub_subset_star_density(struct runner *r, struct cell *ci, struct ...@@ -934,7 +934,7 @@ void runner_dosub_subset_star_density(struct runner *r, struct cell *ci, struct
} }
/* Otherwise, compute the pair directly. */ /* Otherwise, compute the pair directly. */
else if (cell_is_active_hydro(ci, e) || cell_is_active_hydro(cj, e)) { else if (cell_is_active_star(ci, e) || cell_is_active_star(cj, e)) {
/* Do any of the cells need to be drifted first? */ /* Do any of the cells need to be drifted first? */
if (!cell_are_part_drifted(cj, e)) error("Cell should be drifted!"); if (!cell_are_part_drifted(cj, e)) error("Cell should be drifted!");
......
...@@ -1271,6 +1271,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) { ...@@ -1271,6 +1271,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
const float count_j = (t->cj != NULL) ? t->cj->count : 0.f; const float count_j = (t->cj != NULL) ? t->cj->count : 0.f;
const float gcount_i = (t->ci != NULL) ? t->ci->gcount : 0.f; const float gcount_i = (t->ci != NULL) ? t->ci->gcount : 0.f;
const float gcount_j = (t->cj != NULL) ? t->cj->gcount : 0.f; const float gcount_j = (t->cj != NULL) ? t->cj->gcount : 0.f;
const float scount_i = (t->ci != NULL) ? t->ci->scount : 0.f;
switch (t->type) { switch (t->type) {
case task_type_sort: case task_type_sort:
...@@ -1324,6 +1325,9 @@ void scheduler_reweight(struct scheduler *s, int verbose) { ...@@ -1324,6 +1325,9 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
case task_type_extra_ghost: case task_type_extra_ghost:
if (t->ci == t->ci->super_hydro) cost = wscale * count_i; if (t->ci == t->ci->super_hydro) cost = wscale * count_i;
break; break;
case task_type_star_ghost:
if (t->ci == t->ci->super_hydro) cost = wscale * scount_i;
break;
case task_type_drift_part: case task_type_drift_part:
cost = wscale * count_i; cost = wscale * count_i;
break; break;
......
...@@ -182,6 +182,9 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements, ...@@ -182,6 +182,9 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements,
c->ghost_in = NULL; c->ghost_in = NULL;
c->ghost_out = NULL; c->ghost_out = NULL;
c->ghost = NULL; c->ghost = NULL;
c->star_ghost_in = NULL;
c->star_ghost_out = NULL;
c->star_ghost = NULL;
c->kick1 = NULL; c->kick1 = NULL;
c->kick2 = NULL; c->kick2 = NULL;
c->timestep = NULL; c->timestep = NULL;
......
...@@ -72,47 +72,32 @@ MPI_Comm subtaskMPI_comms[task_subtype_count]; ...@@ -72,47 +72,32 @@ MPI_Comm subtaskMPI_comms[task_subtype_count];
/** /**
* @brief Computes the overlap between the parts array of two given cells. * @brief Computes the overlap between the parts array of two given cells.
* *
* @param ci The first #cell. * TYPE is the type of parts (e.g. #part, #gpart, #spart)
* @param cj The second #cell.
*/
__attribute__((always_inline)) INLINE static size_t task_cell_overlap_part(
const struct cell *restrict ci, const struct cell *restrict cj) {
if (ci == NULL || cj == NULL) return 0;
if (ci->parts <= cj->parts &&
ci->parts + ci->count >= cj->parts + cj->count) {
return cj->count;
} else if (cj->parts <= ci->parts &&
cj->parts + cj->count >= ci->parts + ci->count) {
return ci->count;
}
return 0;
}
/**
* @brief Computes the overlap between the gparts array of two given cells.
* *
* @param ci The first #cell. * @param ci The first #cell.
* @param cj The second #cell. * @param cj The second #cell.
*/ */
__attribute__((always_inline)) INLINE static size_t task_cell_overlap_gpart( #define TASK_CELL_OVERLAP(TYPE, ARRAY, COUNT) \
const struct cell *restrict ci, const struct cell *restrict cj) { __attribute__((always_inline)) INLINE static size_t task_cell_overlap_##TYPE( \
const struct cell *restrict ci, const struct cell *restrict cj) { \
if (ci == NULL || cj == NULL) return 0; \
if (ci == NULL || cj == NULL) return 0; \
if (ci->gparts <= cj->gparts && \
ci->gparts + ci->gcount >= cj->gparts + cj->gcount) { if (ci->ARRAY <= cj->ARRAY && \
return cj->gcount; ci->ARRAY + ci->COUNT >= cj->ARRAY + cj->COUNT) { \
} else if (cj->gparts <= ci->gparts && return cj->COUNT; \
cj->gparts + cj->gcount >= ci->gparts + ci->gcount) { } else if (cj->ARRAY <= ci->ARRAY && \
return ci->gcount; cj->ARRAY + cj->COUNT >= ci->ARRAY + ci->COUNT) { \
} return ci->COUNT; \
} \
return 0; \
return 0; \
} }
TASK_CELL_OVERLAP(part, parts, count);
TASK_CELL_OVERLAP(gpart, gparts, gcount);
TASK_CELL_OVERLAP(spart, sparts, scount);
/** /**
* @brief Returns the #task_actions for a given task. * @brief Returns the #task_actions for a given task.
* *
...@@ -136,6 +121,10 @@ __attribute__((always_inline)) INLINE static enum task_actions task_acts_on( ...@@ -136,6 +121,10 @@ __attribute__((always_inline)) INLINE static enum task_actions task_acts_on(
return task_action_part; return task_action_part;
break; break;
case task_type_star_ghost:
return task_action_spart;
break;
case task_type_self: case task_type_self:
case task_type_pair: case task_type_pair:
case task_type_sub_self: case task_type_sub_self:
...@@ -221,9 +210,11 @@ float task_overlap(const struct task *restrict ta, ...@@ -221,9 +210,11 @@ float task_overlap(const struct task *restrict ta,
const int ta_part = (ta_act == task_action_part || ta_act == task_action_all); const int ta_part = (ta_act == task_action_part || ta_act == task_action_all);
const int ta_gpart = const int ta_gpart =
(ta_act == task_action_gpart || ta_act == task_action_all); (ta_act == task_action_gpart || ta_act == task_action_all);
const int ta_spart = (ta_act == task_action_spart || ta_act == task_action_all);
const int tb_part = (tb_act == task_action_part || tb_act == task_action_all); const int tb_part = (tb_act == task_action_part || tb_act == task_action_all);
const int tb_gpart = const int tb_gpart =
(tb_act == task_action_gpart || tb_act == task_action_all); (tb_act == task_action_gpart || tb_act == task_action_all);
const int tb_spart = (tb_act == task_action_spart || tb_act == task_action_all);
/* In the case where both tasks act on parts */ /* In the case where both tasks act on parts */
if (ta_part && tb_part) { if (ta_part && tb_part) {
...@@ -262,6 +253,26 @@ float task_overlap(const struct task *restrict ta, ...@@ -262,6 +253,26 @@ float task_overlap(const struct task *restrict ta,
return ((float)size_intersect) / (size_union - size_intersect); return ((float)size_intersect) / (size_union - size_intersect);
} }
/* In the case where both tasks act on sparts */
else if (ta_spart && tb_spart) {
/* Compute the union of the cell data. */
size_t size_union = 0;
if (ta->ci != NULL) size_union += ta->ci->scount;
if (ta->cj != NULL) size_union += ta->cj->scount;
if (tb->ci != NULL) size_union += tb->ci->scount;
if (tb->cj != NULL) size_union += tb->cj->scount;
/* Compute the intersection of the cell data. */
const size_t size_intersect = task_cell_overlap_spart(ta->ci, tb->ci) +
task_cell_overlap_spart(ta->ci, tb->cj) +
task_cell_overlap_spart(ta->cj, tb->ci) +
task_cell_overlap_spart(ta->cj, tb->cj);
return ((float)size_intersect) / (size_union - size_intersect);
}
/* Else, no overlap */ /* Else, no overlap */
return 0.f; return 0.f;
......
...@@ -99,6 +99,7 @@ enum task_actions { ...@@ -99,6 +99,7 @@ enum task_actions {
task_action_none, task_action_none,
task_action_part, task_action_part,
task_action_gpart, task_action_gpart,
task_action_spart,
task_action_all, task_action_all,
task_action_multipole, task_action_multipole,
task_action_count task_action_count
......
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