Skip to content
Snippets Groups Projects
Commit be6e7abd authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

avoid tag overflows.

Former-commit-id: 5ef797ef0a287cd624f2d47d4adfa89f7c70d66e
parent 540904ec
No related branches found
No related tags found
No related merge requests found
...@@ -95,9 +95,9 @@ void engine_addtasks_send ( struct engine *e , struct cell *ci , struct cell *cj ...@@ -95,9 +95,9 @@ void engine_addtasks_send ( struct engine *e , struct cell *ci , struct cell *cj
if ( k < ci->nr_density ) { if ( k < ci->nr_density ) {
/* Compute the cell's tag. */ /* Compute the cell's tag. */
tag = (int)( ci->loc[0] / e->s->dim[0] * 1024 ) + tag = (int)( ci->loc[0] / e->s->dim[0] * 512 ) +
((int)( ci->loc[1] / e->s->dim[1] * 1024 ) << 10 ) + ((int)( ci->loc[1] / e->s->dim[1] * 512 ) << 9 ) +
((int)( ci->loc[2] / e->s->dim[2] * 1024 ) << 20 ); ((int)( ci->loc[2] / e->s->dim[2] * 512 ) << 18 );
tag = tag*2; tag = tag*2;
/* Create the tasks. */ /* Create the tasks. */
...@@ -141,9 +141,9 @@ void engine_addtasks_recv ( struct engine *e , struct cell *c , struct task *t_x ...@@ -141,9 +141,9 @@ void engine_addtasks_recv ( struct engine *e , struct cell *c , struct task *t_x
if ( t_xv != NULL || c->nr_density > 0 ) { if ( t_xv != NULL || c->nr_density > 0 ) {
/* Compute the cell's tag. */ /* Compute the cell's tag. */
tag = (int)( c->loc[0] / e->s->dim[0] * 1024 ) + tag = (int)( c->loc[0] / e->s->dim[0] * 512 ) +
((int)( c->loc[1] / e->s->dim[1] * 1024 ) << 10 ) + ((int)( c->loc[1] / e->s->dim[1] * 512 ) << 9 ) +
((int)( c->loc[2] / e->s->dim[2] * 1024 ) << 20 ); ((int)( c->loc[2] / e->s->dim[2] * 512 ) << 18 );
tag = tag*2; tag = tag*2;
/* Create the tasks. */ /* Create the tasks. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment