Skip to content
Snippets Groups Projects
Commit 2f24853d authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

Merge branch 'subset_sorting' of gitlab.cosma.dur.ac.uk:swift/swiftsim into subset_sorting

parents ca250f50 51ea5f44
No related branches found
No related tags found
1 merge request!343Subset sorting
...@@ -1504,11 +1504,9 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) { ...@@ -1504,11 +1504,9 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) {
* *
* @param r The runner thread. * @param r The runner thread.
* @param c The cell. * @param c The cell.
* @param clear_sorts Should we clear the sort flag and hence trigger a sort ?
* @param timer Are we timing this ? * @param timer Are we timing this ?
*/ */
void runner_do_recv_part(struct runner *r, struct cell *c, int clear_sorts, void runner_do_recv_part(struct runner *r, struct cell *c, int timer) {
int timer) {
#ifdef WITH_MPI #ifdef WITH_MPI
...@@ -1524,8 +1522,10 @@ void runner_do_recv_part(struct runner *r, struct cell *c, int clear_sorts, ...@@ -1524,8 +1522,10 @@ void runner_do_recv_part(struct runner *r, struct cell *c, int clear_sorts,
timebin_t time_bin_max = 0; timebin_t time_bin_max = 0;
float h_max = 0.f; float h_max = 0.f;
/* Clear this cell's sorted mask. */ #ifdef SWIFT_DEBUG_CHECKS
if (clear_sorts) c->sorted = 0; if(c->nodeID == engine_rank)
error("Updating a local cell!");
#endif
/* If this cell is a leaf, collect the particle data. */ /* If this cell is a leaf, collect the particle data. */
if (!c->split) { if (!c->split) {
...@@ -1552,7 +1552,7 @@ void runner_do_recv_part(struct runner *r, struct cell *c, int clear_sorts, ...@@ -1552,7 +1552,7 @@ void runner_do_recv_part(struct runner *r, struct cell *c, int clear_sorts,
else { else {
for (int k = 0; k < 8; k++) { for (int k = 0; k < 8; k++) {
if (c->progeny[k] != NULL) { if (c->progeny[k] != NULL) {
runner_do_recv_part(r, c->progeny[k], clear_sorts, 0); runner_do_recv_part(r, c->progeny[k], 0);
ti_end_min = min(ti_end_min, c->progeny[k]->ti_end_min); ti_end_min = min(ti_end_min, c->progeny[k]->ti_end_min);
ti_end_max = max(ti_end_max, c->progeny[k]->ti_end_max); ti_end_max = max(ti_end_max, c->progeny[k]->ti_end_max);
h_max = max(h_max, c->progeny[k]->h_max); h_max = max(h_max, c->progeny[k]->h_max);
...@@ -1603,6 +1603,11 @@ void runner_do_recv_gpart(struct runner *r, struct cell *c, int timer) { ...@@ -1603,6 +1603,11 @@ void runner_do_recv_gpart(struct runner *r, struct cell *c, int timer) {
timebin_t time_bin_min = num_time_bins; timebin_t time_bin_min = num_time_bins;
timebin_t time_bin_max = 0; timebin_t time_bin_max = 0;
#ifdef SWIFT_DEBUG_CHECKS
if(c->nodeID == engine_rank)
error("Updating a local cell!");
#endif
/* If this cell is a leaf, collect the particle data. */ /* If this cell is a leaf, collect the particle data. */
if (!c->split) { if (!c->split) {
...@@ -1676,6 +1681,11 @@ void runner_do_recv_spart(struct runner *r, struct cell *c, int timer) { ...@@ -1676,6 +1681,11 @@ void runner_do_recv_spart(struct runner *r, struct cell *c, int timer) {
timebin_t time_bin_min = num_time_bins; timebin_t time_bin_min = num_time_bins;
timebin_t time_bin_max = 0; timebin_t time_bin_max = 0;
#ifdef SWIFT_DEBUG_CHECKS
if(c->nodeID == engine_rank)
error("Updating a local cell!");
#endif
/* If this cell is a leaf, collect the particle data. */ /* If this cell is a leaf, collect the particle data. */
if (!c->split) { if (!c->split) {
...@@ -1942,11 +1952,11 @@ void *runner_main(void *data) { ...@@ -1942,11 +1952,11 @@ void *runner_main(void *data) {
cell_unpack_ti_ends(ci, t->buff); cell_unpack_ti_ends(ci, t->buff);
free(t->buff); free(t->buff);
} else if (t->subtype == task_subtype_xv) { } else if (t->subtype == task_subtype_xv) {
runner_do_recv_part(r, ci, 1, 1); runner_do_recv_part(r, ci, 1);
} else if (t->subtype == task_subtype_rho) { } else if (t->subtype == task_subtype_rho) {
runner_do_recv_part(r, ci, 0, 1); runner_do_recv_part(r, ci, 1);
} else if (t->subtype == task_subtype_gradient) { } else if (t->subtype == task_subtype_gradient) {
runner_do_recv_part(r, ci, 0, 1); runner_do_recv_part(r, ci, 1);
} else if (t->subtype == task_subtype_gpart) { } else if (t->subtype == task_subtype_gpart) {
runner_do_recv_gpart(r, ci, 1); runner_do_recv_gpart(r, ci, 1);
} else if (t->subtype == task_subtype_spart) { } else if (t->subtype == task_subtype_spart) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment