bug fix for index calculation
authorAbhinav Bhatele <bhatele@illinois.edu>
Mon, 10 Aug 2009 05:34:55 +0000 (05:34 +0000)
committerAbhinav Bhatele <bhatele@illinois.edu>
Mon, 10 Aug 2009 05:34:55 +0000 (05:34 +0000)
examples/bigsim/sdag/jacobi3d/jacobi3d.C

index 3c1c6b6da3abf7eb217a290593f1b3fbdec70938..62fcb824d4324145249053cffde417bef0a787db 100644 (file)
@@ -67,7 +67,7 @@ int myrand(int numpes) {
 #if USE_3D_ARRAYS
 #define index(a, b, c) a][b][c 
 #else
-#define index(a, b, c) (a*(blockDimY+2)*(blockDimZ+2) + b*(blockDimZ+2) + c)
+#define index(a, b, c) ( (a)*(blockDimY+2)*(blockDimZ+2) + (b)*(blockDimZ+2) + (c) )
 #endif
 
 #define MAX_ITER               26