Commit dee26e62 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Fixed segfault in MPI mode.

parent 4511d85d
...@@ -557,8 +557,9 @@ void cell_init_parts(struct cell *c, void *data) { ...@@ -557,8 +557,9 @@ void cell_init_parts(struct cell *c, void *data) {
struct part *p = c->parts; struct part *p = c->parts;
struct xpart *xp = c->xparts; struct xpart *xp = c->xparts;
const int count = c->count;
for (int i = 0; i < c->count; ++i) { for (int i = 0; i < count; ++i) {
p[i].ti_begin = 0; p[i].ti_begin = 0;
p[i].ti_end = 0; p[i].ti_end = 0;
xp[i].v_full[0] = p[i].v[0]; xp[i].v_full[0] = p[i].v[0];
......
...@@ -1720,14 +1720,14 @@ void engine_init_particles(struct engine *e) { ...@@ -1720,14 +1720,14 @@ void engine_init_particles(struct engine *e) {
struct space *s = e->s; struct space *s = e->s;
message("Initialising particles"); if(e->nodeID == 0) message("Initialising particles");
engine_prepare(e);
/* Make sure all particles are ready to go */ /* Make sure all particles are ready to go */
/* i.e. clean-up any stupid state in the ICs */ /* i.e. clean-up any stupid state in the ICs */
space_map_cells_pre(s, 1, cell_init_parts, NULL); space_map_cells_pre(s, 1, cell_init_parts, NULL);
engine_prepare(e);
engine_marktasks(e); engine_marktasks(e);
// printParticle(e->s->parts, 1000, e->s->nr_parts); // printParticle(e->s->parts, 1000, e->s->nr_parts);
......
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