Commit 66ae5260 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Solved the bug ! h_max was uninitialized in the kick leading to no particle...

Solved the bug ! h_max was uninitialized in the kick leading to no particle interaction in the next pairs.
parent f77733b7
......@@ -397,7 +397,7 @@ int main(int argc, char *argv[]) {
/* Take a step. */
engine_step(&e);
if (j == 1) break;
//if (j == 1) break;
if (with_outputs && j % 100 == 0) {
......
......@@ -984,6 +984,8 @@ void runner_dokick(struct runner *r, struct cell *c, int timer) {
if (p->t_end < t_end_min) t_end_min = p->t_end;
if (p->t_end > t_end_max) t_end_max = p->t_end;
if (p->h > h_max) h_max = p->h;
}
}
......
......@@ -780,8 +780,22 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj) {
#endif
TIMER_TIC
for (int p=0; p<ci->count; ++p)
if(ci->parts[p].id == 1000 && t_current > 0)
message("Particle is here -- i t_current=%f ci->t_end_min=%f cj->t_end_min=%f, ci->count=%d", t_current, ci->t_end_min, cj->t_end_min, ci->count);
for (int p=0; p<cj->count; ++p)
if(cj->parts[p].id == 1000 && t_current > 0)
message("Particle is here -- j t_current=%f ci->t_end_min=%f cj->t_end_min=%f cj->count=%d", t_current, ci->t_end_min, cj->t_end_min, cj->count);
/* Anything to do here? */
if (ci->t_end_min > t_current && cj->t_end_min > t_current) return;
if (ci->t_end_min > t_current && cj->t_end_min > t_current) {
message("No active particles, skipping....");
return;
}
/* Get the sort ID. */
sid = space_getsid(e->s, &ci, &cj, shift);
......@@ -1378,6 +1392,12 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
#endif
TIMER_TIC
for (int p=0; p<c->count; ++p)
if(c->parts[p].id == 1000)
message("Particle is here -- i");
/* Set up indt if needed. */
if (c->t_end_min > t_current)
return;
......@@ -1601,6 +1621,11 @@ void DOSELF2(struct runner *r, struct cell *restrict c) {
#endif
TIMER_TIC
for (int p=0; p<c->count; ++p)
if(c->parts[p].id == 1000)
message("Particle is here -- i");
/* Set up indt if needed. */
if (c->t_end_min > t_current)
return;
......
......@@ -1019,6 +1019,8 @@ void scheduler_start(struct scheduler *s, unsigned int mask) {
scheduler_print_tasks(s, "tasks_start.dat");
s->mask = mask;
/* Loop over the tasks and enqueue whoever is ready. */
// tic = getticks();
for (int k = 0; k < s->nr_tasks; k++) {
......@@ -1027,6 +1029,10 @@ void scheduler_start(struct scheduler *s, unsigned int mask) {
scheduler_enqueue(s, t);
pthread_cond_broadcast(&s->sleep_cond);
}
/* else if(! (((1 << t->type) & s->mask) && !t->skip)) { */
/* error("error"); */
/* } */
}
// message( "enqueueing tasks took %.3f ms." , (double)( getticks() - tic ) /
// CPU_TPS * 1000 );
......@@ -1051,6 +1057,8 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
/* Ignore skipped tasks and tasks not in the mask. */
if (t->skip || (1 << t->type) & ~(s->mask)) {
if(t->type==task_type_pair && t->subtype == task_subtype_density)
error("Found a pair");
return;
}
......
......@@ -282,7 +282,7 @@ void task_do_rewait(struct task *t) {
/* Skip tasks not in the mask */
if( !((1<<t2->type) & mask) ) continue;
/* Skip sort tasks that have already been performed */
/* Skip sort tasks that have already been */
if(t2->type == task_type_sort && t2->flags == 0) continue;
if(store == NULL && t2->type==task_type_pair && t2->subtype==task_subtype_density) {
......
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