diff --git a/src/engine.c b/src/engine.c index e9e3f15c2eb3f37a777e3652f564bd97a3a18a53..cbfe71e2ae9d65bfe3af8a7c8fc652b2f96ff008 100644 --- a/src/engine.c +++ b/src/engine.c @@ -823,7 +823,7 @@ void engine_addtasks_recv(struct engine *e, struct cell *c, struct task *t_xv, } for (struct link *l = c->force; l != NULL; l = l->next) { scheduler_addunlock(s, t_rho, l->t); - //scheduler_addunlock(s, l->t, c->time); + // scheduler_addunlock(s, l->t, c->time); } if (c->sorts != NULL) scheduler_addunlock(s, t_xv, c->sorts); #endif @@ -2457,14 +2457,14 @@ void engine_collect_timestep(struct engine *e) { c->g_updated = 0; } - /* Aggregate the data from the different nodes. */ +/* Aggregate the data from the different nodes. */ #ifdef WITH_MPI { integertime_t in_i[1], out_i[1]; in_i[0] = 0; out_i[0] = ti_end_min; - if (MPI_Allreduce(out_i, in_i, 1, MPI_LONG_LONG_INT, MPI_MIN, MPI_COMM_WORLD) != - MPI_SUCCESS) + if (MPI_Allreduce(out_i, in_i, 1, MPI_LONG_LONG_INT, MPI_MIN, + MPI_COMM_WORLD) != MPI_SUCCESS) error("Failed to aggregate t_end_min."); ti_end_min = in_i[0]; } @@ -2642,8 +2642,8 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) { if (e->nodeID == 0) message("Converting internal energy variable."); /* Apply the conversion */ - //space_map_cells_pre(s, 0, cell_convert_hydro, NULL); - for(size_t i = 0; i < s->nr_parts; ++i) + // space_map_cells_pre(s, 0, cell_convert_hydro, NULL); + for (size_t i = 0; i < s->nr_parts; ++i) hydro_convert_quantities(&s->parts[i], &s->xparts[i]); /* Correct what we did (e.g. in PE-SPH, need to recompute rho_bar) */ diff --git a/src/runner.c b/src/runner.c index d961d31455cbf74eda8d2572ddf0920dbb0cbfa4..612e75c86fc3033a8a87bafe46bf27964be46ce3 100644 --- a/src/runner.c +++ b/src/runner.c @@ -869,7 +869,15 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) { const integertime_t ti_end = get_integer_time_end(ti_current, p->time_bin); +<<<<<<< HEAD if (ti_end - ti_begin != ti_step) error("Particle in wrong time-bin, ti_end=%lld, ti_begin=%lld, ti_step=%lld time_bin=%d ti_current=%lld", ti_end, ti_begin, ti_step, p->time_bin, ti_current); +======= + if (ti_end - ti_begin != ti_step && ti_current > 0) + error( + "Particle in wrong time-bin, ti_end=%lld, ti_begin=%lld, " + "ti_step=%lld time_bin=%d ti_current=%lld", + ti_end, ti_begin, ti_step, p->time_bin, ti_current); +>>>>>>> 674f1bc38893e37847ea3c773e3f34ae27ed8a65 #endif /* do the kick */ @@ -951,8 +959,16 @@ void runner_do_kick2(struct runner *r, struct cell *c, int timer) { get_integer_time_begin(ti_current, p->time_bin); #ifdef SWIFT_DEBUG_CHECKS +<<<<<<< HEAD if (ti_begin + ti_step != ti_current) error("Particle in wrong time-bin, ti_begin=%lld, ti_step=%lld time_bin=%d ti_current=%lld", ti_begin, ti_step, p->time_bin, ti_current); +======= + if (ti_begin + ti_step != ti_current && ti_current > 0) + error( + "Particle in wrong time-bin, ti_begin=%lld, ti_step=%lld " + "time_bin=%d ti_current=%lld", + ti_begin, ti_step, p->time_bin, ti_current); +>>>>>>> 674f1bc38893e37847ea3c773e3f34ae27ed8a65 #endif /* Finish the time-step with a second half-kick */ @@ -1224,8 +1240,8 @@ void runner_do_recv_cell(struct runner *r, struct cell *c, int timer) { h_max = max(h_max, parts[k].h); #ifdef SWIFT_DEBUG_CHECKS - if(parts[k].ti_drift != ti_current) - error("Received un-drifted particle !"); + if (parts[k].ti_drift != ti_current) + error("Received un-drifted particle !"); #endif } for (size_t k = 0; k < nr_gparts; k++) { diff --git a/src/scheduler.c b/src/scheduler.c index 7575e3711ba03cefbf8f672cc330de9984b3edd9..4bdaf5efe43b9e5a5cc56c16cd54fd0aa854da82 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -73,8 +73,8 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta, struct task **unlocks_new; int *unlock_ind_new; const int size_unlocks_new = s->size_unlocks * 2; - if ((unlocks_new = (struct task **)malloc( - sizeof(struct task *) *size_unlocks_new)) == NULL || + if ((unlocks_new = (struct task **)malloc(sizeof(struct task *) * + size_unlocks_new)) == NULL || (unlock_ind_new = (int *)malloc(sizeof(int) * size_unlocks_new)) == NULL) error("Failed to re-allocate unlocks."); @@ -114,13 +114,11 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta, static void scheduler_splittask(struct task *t, struct scheduler *s) { /* Static constants. */ - static const int pts[7][8] = {{-1, 12, 10, 9, 4, 3, 1, 0}, - {-1, -1, 11, 10, 5, 4, 2, 1}, - {-1, -1, -1, 12, 7, 6, 4, 3}, - {-1, -1, -1, -1, 8, 7, 5, 4}, - {-1, -1, -1, -1, -1, 12, 10, 9}, - {-1, -1, -1, -1, -1, -1, 11, 10}, - {-1, -1, -1, -1, -1, -1, -1, 12}}; + static const int pts[7][8] = { + {-1, 12, 10, 9, 4, 3, 1, 0}, {-1, -1, 11, 10, 5, 4, 2, 1}, + {-1, -1, -1, 12, 7, 6, 4, 3}, {-1, -1, -1, -1, 8, 7, 5, 4}, + {-1, -1, -1, -1, -1, 12, 10, 9}, {-1, -1, -1, -1, -1, -1, 11, 10}, + {-1, -1, -1, -1, -1, -1, -1, 12}}; static const float sid_scale[13] = { 0.1897f, 0.4025f, 0.1897f, 0.4025f, 0.5788f, 0.4025f, 0.1897f, 0.4025f, 0.1897f, 0.4025f, 0.5788f, 0.4025f, 0.5788f}; @@ -1081,7 +1079,7 @@ void scheduler_start(struct scheduler *s) { struct cell *ci = t->ci; struct cell *cj = t->cj; - if (cj == NULL) {/* self */ + if (cj == NULL) { /* self */ if (ci->ti_end_min == ti_current && t->skip && t->type != task_type_sort && t->type) @@ -1102,7 +1100,7 @@ void scheduler_start(struct scheduler *s) { taskID_names[t->type], subtaskID_names[t->subtype], ti_current, ci->ti_end_min, t->flags); - } else {/* pair */ + } else { /* pair */ /* Don't check MPI stuff */ if (t->type != task_type_send && t->type != task_type_recv) { @@ -1453,7 +1451,7 @@ void scheduler_init(struct scheduler *s, struct space *space, int nr_tasks, /* Init the unlocks. */ if ((s->unlocks = (struct task **)malloc( - sizeof(struct task *) *scheduler_init_nr_unlocks)) == NULL || + sizeof(struct task *) * scheduler_init_nr_unlocks)) == NULL || (s->unlock_ind = (int *)malloc(sizeof(int) * scheduler_init_nr_unlocks)) == NULL) error("Failed to allocate unlocks."); diff --git a/src/space.c b/src/space.c index 96419920e516c83824f14617a968b849f6a45b48..08dd41cdea5bf598c2b17d47f35e6fc0221c2a06 100644 --- a/src/space.c +++ b/src/space.c @@ -1461,7 +1461,7 @@ void space_map_cells_pre(struct space *s, int full, /* Call the recursive function on all higher-level cells. */ for (int cid = 0; cid < s->nr_cells; cid++) - rec_map_cells_pre(&s->cells_top[cid], full, fun, data); + rec_map_cells_pre(&s->cells_top[cid], full, fun, data); } /**