From be6e7abdfbc455e1b4e6ffd965f9320835b58258 Mon Sep 17 00:00:00 2001
From: Pedro Gonnet <pedro.gonnet@durham.ac.uk>
Date: Sat, 17 Aug 2013 20:52:23 +0000
Subject: [PATCH] avoid tag overflows.

Former-commit-id: 5ef797ef0a287cd624f2d47d4adfa89f7c70d66e
---
 src/engine.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/engine.c b/src/engine.c
index 4c08aa951b..c1591b0d9c 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -95,9 +95,9 @@ void engine_addtasks_send ( struct engine *e , struct cell *ci , struct cell *cj
     if ( k < ci->nr_density ) {
 
         /* Compute the cell's tag. */
-        tag = (int)( ci->loc[0] / e->s->dim[0] * 1024 ) +
-              ((int)( ci->loc[1] / e->s->dim[1] * 1024 ) << 10 ) +
-              ((int)( ci->loc[2] / e->s->dim[2] * 1024 ) << 20 );
+        tag = (int)( ci->loc[0] / e->s->dim[0] * 512 ) +
+              ((int)( ci->loc[1] / e->s->dim[1] * 512 ) << 9 ) +
+              ((int)( ci->loc[2] / e->s->dim[2] * 512 ) << 18 );
         tag = tag*2;
 
         /* Create the tasks. */
@@ -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 ) {
     
         /* Compute the cell's tag. */
-        tag = (int)( c->loc[0] / e->s->dim[0] * 1024 ) +
-              ((int)( c->loc[1] / e->s->dim[1] * 1024 ) << 10 ) +
-              ((int)( c->loc[2] / e->s->dim[2] * 1024 ) << 20 );
+        tag = (int)( c->loc[0] / e->s->dim[0] * 512 ) +
+              ((int)( c->loc[1] / e->s->dim[1] * 512 ) << 9 ) +
+              ((int)( c->loc[2] / e->s->dim[2] * 512 ) << 18 );
         tag = tag*2;
         
         /* Create the tasks. */
-- 
GitLab