diff --git a/src/cell.c b/src/cell.c index 60e2e9393fe62f381b598a807fc7a631b7d8dbd5..fd58f900a63ab7bc392f906e43224ce3d79dbaad 100644 --- a/src/cell.c +++ b/src/cell.c @@ -1309,12 +1309,12 @@ void cell_check_multipole_drift_point(struct cell *c, void *data) { const integertime_t ti_drift = *(integertime_t *)data; - if (c->grav.ti_old_multipole != ti_drift) + if (c->grav.ti_old_multipole != ti_drift && c->nodeID == engine_rank) error( "Cell multipole in an incorrect time-zone! " "c->grav.ti_old_multipole=%lld " - "ti_drift=%lld (depth=%d)", - c->grav.ti_old_multipole, ti_drift, c->depth); + "ti_drift=%lld (depth=%d, node=%d)", + c->grav.ti_old_multipole, ti_drift, c->depth, c->nodeID); #else error("Calling debugging code without debugging flag activated."); diff --git a/src/engine.c b/src/engine.c index 6d32ce43620821b2847546be73727ad2dfedf22d..ab2adfa027779e0f8d609e27c806c38e9755a4ea 100644 --- a/src/engine.c +++ b/src/engine.c @@ -5869,12 +5869,15 @@ void engine_unskip(struct engine *e) { void engine_do_drift_all_mapper(void *map_data, int num_elements, void *extra_data) { - struct engine *e = (struct engine *)extra_data; - struct cell *cells = (struct cell *)map_data; + const struct engine *e = (const struct engine *)extra_data; + struct space *s = e->s; + int *local_cells = (int *)map_data; for (int ind = 0; ind < num_elements; ind++) { - struct cell *c = &cells[ind]; - if (c != NULL && c->nodeID == e->nodeID) { + struct cell *c = &s->cells_top[local_cells[ind]]; + + if (c->nodeID == e->nodeID) { + /* Drift all the particles */ cell_drift_part(c, e, 1); @@ -5910,8 +5913,9 @@ void engine_drift_all(struct engine *e) { } #endif - threadpool_map(&e->threadpool, engine_do_drift_all_mapper, e->s->cells_top, - e->s->nr_cells, sizeof(struct cell), 0, e); + threadpool_map(&e->threadpool, engine_do_drift_all_mapper, + e->s->local_cells_with_tasks_top, + e->s->nr_local_cells_with_tasks, sizeof(int), 0, e); /* Synchronize particle positions */ space_synchronize_particle_positions(e->s);