 
 
     const int blockDim2 = NTHREAD2;
-    __shared__ int shmem[11*(1 << blockDim2)];
+    __shared__ int shmem[10*(1 << blockDim2)];
     //    __shared__ int shmem[24*(1 << blockDim2)]; is possible on FERMI
     //    int             lmem[LMEM_STACK_SIZE];
 


  int *directS = shmem;                              //  0*DIM,  1*DIM,  1*DIM
  int *nodesS  = directS + DIM;                      //  1*DIM, 10*DIM,  9*DIM
  int *prefix  = nodesS  + DIM*9;                    // 10*DIM, 11*DIM,  1*DIM

  const int NJMAX = DIM*3;
  int    *body_list = (int*   )&nodesS   [  DIM]; //  2*DIM,   5*DIM,  2*DIM

  __syncthreads();


#if 0  /* below breaks the code */
  //Sum the interaction counters
  int *sh_dire = (int*)&sh_mass;
  int *sh_appr = (int*  )&sh_pot;
  sh_dire[tid] = direCount;
  sh_appr[tid] = apprCount;

  __syncthreads();


  if (ty == 0) 
  {
#pragma unroll
    for (int i = 1; i < DIMy; i++)
    {
      const int idx = (i << DIM2x) + tx;
      direCount  += sh_dire[idx];
      apprCount  += sh_appr[idx];
    }
  }
  __syncthreads();
#endif

  return acc_i;
}
