Commit e39f6a63 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

set initial cell ownership relative to parts array.


Former-commit-id: 9afddac98ec7caa1d9087df5463f2ecd8546da35
parent 02379f18
...@@ -783,6 +783,7 @@ void engine_init ( struct engine *e , struct space *s , float dt , int nr_thread ...@@ -783,6 +783,7 @@ void engine_init ( struct engine *e , struct space *s , float dt , int nr_thread
/* Init the scheduler. */ /* Init the scheduler. */
scheduler_init( &e->sched , e->s , nr_queues , scheduler_flag_steal ); scheduler_init( &e->sched , e->s , nr_queues , scheduler_flag_steal );
s->nr_queues = nr_queues;
/* Append a kick1 task to each cell. */ /* Append a kick1 task to each cell. */
scheduler_reset( &e->sched , s->tot_cells ); scheduler_reset( &e->sched , s->tot_cells );
......
...@@ -686,10 +686,12 @@ void space_split ( struct space *s , struct cell *c ) { ...@@ -686,10 +686,12 @@ void space_split ( struct space *s , struct cell *c ) {
if ( c->progeny[k]->maxdepth > maxdepth ) if ( c->progeny[k]->maxdepth > maxdepth )
maxdepth = c->progeny[k]->maxdepth; maxdepth = c->progeny[k]->maxdepth;
} }
c->h_max = h_max;
c->dt_min = dt_min; /* Set the values for this cell. */
c->dt_max = dt_max; c->h_max = h_max;
c->maxdepth = maxdepth; c->dt_min = dt_min;
c->dt_max = dt_max;
c->maxdepth = maxdepth;
} }
...@@ -723,6 +725,9 @@ void space_split ( struct space *s , struct cell *c ) { ...@@ -723,6 +725,9 @@ void space_split ( struct space *s , struct cell *c ) {
c->dt_max = dt_max; c->dt_max = dt_max;
} }
/* Set ownership accorind to the start of the parts array. */
c->owner = ( c->parts - s->parts ) * s->nr_queues / s->nr_parts;
} }
...@@ -838,6 +843,7 @@ void space_init ( struct space *s , double dim[3] , struct part *parts , int N , ...@@ -838,6 +843,7 @@ void space_init ( struct space *s , double dim[3] , struct part *parts , int N ,
s->nr_parts = N; s->nr_parts = N;
s->parts = parts; s->parts = parts;
s->cell_min = h_max; s->cell_min = h_max;
s->nr_queues = 1;
/* Allocate and link the xtra parts array. */ /* Allocate and link the xtra parts array. */
if ( posix_memalign( (void *)&s->xparts , 32 , N * sizeof(struct xpart) ) != 0 ) if ( posix_memalign( (void *)&s->xparts , 32 , N * sizeof(struct xpart) ) != 0 )
......
...@@ -93,6 +93,9 @@ struct space { ...@@ -93,6 +93,9 @@ struct space {
/* General-purpose lock for this space. */ /* General-purpose lock for this space. */
lock_type lock; lock_type lock;
/* Number of queues in the system. */
int nr_queues;
}; };
......
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