From 7d16b4ae317533709614e8476d233959d557ac5f Mon Sep 17 00:00:00 2001 From: Pedro Gonnet Date: Thu, 27 Jul 2017 09:27:53 +0200 Subject: [PATCH 1/2] only drift the cells that are being sent. --- src/cell.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cell.c b/src/cell.c index 7edee4d9a..8386161a1 100644 --- a/src/cell.c +++ b/src/cell.c @@ -1745,9 +1745,9 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) { if (l == NULL) error("Missing link to send_xv task."); scheduler_activate(s, l->t); - /* 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); + /* Drift the cell which will be sent; note that not all sent + particles will be drifted, only those that are needed. */ + cell_activate_drift_part(cj, s); if (cell_is_active(cj, e)) { struct link *l = NULL; @@ -1802,9 +1802,9 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) { if (l == NULL) error("Missing link to send_xv task."); scheduler_activate(s, l->t); - /* 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); + /* Drift the cell which will be sent; note that not all sent + particles will be drifted, only those that are needed. */ + cell_activate_drift_part(ci, s); if (cell_is_active(ci, e)) { -- GitLab From d6361097b1b7c5fe55a85bcaf7a7d88b45dd20cf Mon Sep 17 00:00:00 2001 From: Pedro Gonnet Date: Thu, 27 Jul 2017 09:29:36 +0200 Subject: [PATCH 2/2] remove tests for undrifted particles in send/recv as not all sent/recvd particles are drifted, only those that are needed. note that undrifted particles will still be caught in the interaction functions. --- src/runner.c | 5 ----- src/scheduler.c | 5 ----- 2 files changed, 10 deletions(-) diff --git a/src/runner.c b/src/runner.c index 5af652d8a..f77715086 100644 --- a/src/runner.c +++ b/src/runner.c @@ -1544,11 +1544,6 @@ void runner_do_recv_part(struct runner *r, struct cell *c, int clear_sorts, time_bin_min = min(time_bin_min, parts[k].time_bin); time_bin_max = max(time_bin_max, parts[k].time_bin); h_max = max(h_max, parts[k].h); - -#ifdef SWIFT_DEBUG_CHECKS - if (parts[k].ti_drift != ti_current) - error("Received un-drifted particle !"); -#endif } /* Convert into a time */ diff --git a/src/scheduler.c b/src/scheduler.c index e14fc017d..161be4180 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -1363,11 +1363,6 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) { } else if (t->subtype == task_subtype_xv || t->subtype == task_subtype_rho || t->subtype == task_subtype_gradient) { -#ifdef SWIFT_DEBUG_CHECKS - for (int k = 0; k < t->ci->count; k++) - if (t->ci->parts[k].ti_drift != s->space->e->ti_current) - error("Sending un-drifted particle !"); -#endif err = MPI_Isend(t->ci->parts, t->ci->count, part_mpi_type, t->cj->nodeID, t->flags, MPI_COMM_WORLD, &t->req); // message( "sending %i parts with tag=%i from %i to %i." , -- GitLab