 
   float  *node_mon0 = sh_mass;
   float3 *node_mon1 = sh_pos; 
-  
+
   float  *sh_pot = sh_mass;
   float3 *sh_acc = sh_pos;
 

} 

template<int DIM2>
__device__ int calc_prefix(int* prefix, int tid, int value) {
  int  x;
  
  const int DIM = 1 << DIM2;

  prefix[tid] = value;


  int *directS = shmem;                              //  0*DIM,  1*DIM,  1*DIM
  int *nodesS  = directS + DIM;                      //  1*DIM, 10*DIM,  9*DIM
  int *prefixS = nodesS  + DIM*9;                    // 10*DIM, 12*DIM,  2*DIM

  int *prefix  = prefixS;
  int *prefix0 = prefixS;
  int *prefix1 = prefixS + DIM;

  const int NJMAX = DIM*3;
  int    *body_list = (int*   )&nodesS   [  DIM]; //  2*DIM,   5*DIM,  2*DIM
  float  *sh_mass   = (float* )&body_list[NJMAX]; //  5*DIM,   6*DIM,  1*DIM
  float3 *sh_pos    = (float3*)&sh_mass  [  DIM]; //  6*DIM,   9*DIM   3*DIM
  int    *sh_body   = nodesS + DIM*8;             //  9*DIM,  10*DIM,  1*DIM

  int *approxM = approxL;
  int *directM = directS;
  int * nodesM =  nodesS;
