Ejemplo n.º 1
0
/*----------------------------------------------------------------------*/
void make_lattice(){
register int i;               /* scratch */
int x,y,z,t;            /* coordinates */
    /* allocate space for lattice, fill in parity, coordinates and index.  */
    lattice = (site *)malloc( sites_on_node * sizeof(site) );
    if(lattice==NULL){
        printf("NODE %d: no room for lattice\n",this_node);
        terminate(1);
    }
   /* Allocate address vectors */
    for(i=0;i<8;i++){
      /**gen_pt[i] = (char **)malloc(sites_on_node*sizeof(char *) );
        if(gen_pt[i]==NULL){
            printf("NODE %d: no room for pointer vector\n",this_node);
            terminate(1);
	    } **/
      gen_pt[i] = NULL;
    }

    for(t=0;t<nt;t++)for(z=0;z<nz;z++)for(y=0;y<ny;y++)for(x=0;x<nx;x++){
        if(node_number(x,y,z,t)==mynode()){
            i=node_index(x,y,z,t);
            lattice[i].x=x;     lattice[i].y=y; lattice[i].z=z; lattice[i].t=t;
            lattice[i].index = x+nx*(y+ny*(z+nz*t));
            if( (x+y+z+t)%2 == 0)lattice[i].parity=EVEN;
            else                 lattice[i].parity=ODD;
#ifdef SITERAND
            initialize_prn( &(lattice[i].site_prn) , iseed, lattice[i].index);
#endif
        }
    }
}
Ejemplo n.º 2
0
int
setup()
{
  int prompt;

  /* print banner, get volume, nflavors1,nflavors2, seed */
  prompt = initial_set();
  if(prompt == 2)return prompt;
  /* initialize the node random number generator */
  initialize_prn( &node_prn, iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();
  node0_printf("Made lattice\n"); fflush(stdout);
  /* Mark t_longlink and t_fatlink unallocted */
  // init_ferm_links(&fn_links, &ks_act_paths);
  /* set up neighbor pointers and comlink structures
     code for this routine is in com_machine.c  */
  make_nn_gathers();
  node0_printf("Made nn gathers\n"); fflush(stdout);
  /* set up 3rd nearest neighbor pointers and comlink structures
     code for this routine is below  */
  make_3n_gathers();
  node0_printf("Made 3nn gathers\n"); fflush(stdout);
  /* set up K-S phase vectors, boundary conditions */
  phaseset();

  node0_printf("Finished setup\n"); fflush(stdout);
  return( prompt );
}
Ejemplo n.º 3
0
int setup()   {
  int prompt;

  /* print banner, get volume */
  prompt=initial_set();
  if(prompt == 2)return prompt;

  /* initialize the node random number generator */
  initialize_prn( &node_prn, param.iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();
  /* Initialize fermion links as unallocated */
//  init_ferm_links(&fn_links, &ks_act_paths);
//  init_ferm_links(&fn_links_dmdu0, &ks_act_paths_dmdu0);
  /* set up nearest neighbor gathers */
  make_nn_gathers();
  /* set up 3rd nearest neighbor pointers and comlink structures
     code for this routine is below  */
  make_3n_gathers();
  /* set up K-S phase vectors, boundary conditions */
  phaseset();
  return(prompt);
}
Ejemplo n.º 4
0
int
setup()
{
  int initial_set();
  int prompt;
  
  /* print banner, get initial parameters */
  prompt = initial_set();
  if(prompt == 2)return prompt;
  /* initialize the node random number generator */
  initialize_prn( &node_prn, iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();

  node0_printf("Made lattice\n"); fflush(stdout);
  /* set up neighbor pointers and comlink structures
     code for this routine is in com_machine.c  */
  make_nn_gathers();
  node0_printf("Made nn gathers\n"); fflush(stdout);
  
  node0_printf("Finished setup\n"); fflush(stdout);
  return prompt;
}
Ejemplo n.º 5
0
int setup(void)   {
  int prompt, dir;

  /* print banner, get volume */
  prompt=initial_set();
  if(prompt == 2)return prompt;

  /* initialize the node random number generator */
  initialize_prn( &node_prn, param.iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();
  FORALLUPDIR(dir){
    boundary_phase[dir] = 0.;
  }
  /* set up nearest neighbor gathers */
  make_nn_gathers();
  /* set up 3rd nearest neighbor pointers and comlink structures
     code for this routine is below  */
  make_3n_gathers();
  /* set up K-S phase vectors, boundary conditions */
  phaseset();
  twist_in = OFF;
  /* Create clover structure */
  gen_clov = create_clov();

  return(prompt);
}
Ejemplo n.º 6
0
int
setup(void)
{
  int prompt;

  
  /* print banner, get volume, seed */
  prompt = initial_set();
  /* initialize the node random number generator */
  initialize_prn( &node_prn, iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();
  node0_printf("Made lattice\n"); fflush(stdout);

  /* set up neighbor pointers and comlink structures */
  make_nn_gathers();
  node0_printf("Made nn gathers\n"); fflush(stdout);
  /* set up 3rd nearest neighbor pointers and comlink structures
     code for this routine is below  */
  make_3n_gathers();
  node0_printf("Made 3nn gathers\n"); fflush(stdout);
  /* set up K-S phase vectors, boundary conditions */
  phaseset();
  
  node0_printf("Finished setup\n"); fflush(stdout);
  return( prompt );
}
Ejemplo n.º 7
0
int  setup()   {
    int initial_set();
    void make_gen_pt();
    void make_3n_gathers(),
        setup_layout();
    int prompt;
//#ifdef HAVE_QDP
//    int i;
//#endif

	/* print banner, get volume, seed */
    prompt=initial_set();
   	/* initialize the node random number generator */
    initialize_prn( &node_prn, iseed, volume+mynode() );
	/* Initialize the layout functions, which decide where sites live */
    setup_layout();
	/* allocate space for lattice, set up coordinate fields */
    make_lattice();
    node0_printf("Made lattice\n"); fflush(stdout);
    //init_ferm_links(&fn_links, &ks_act_paths);
	/* set up neighbor pointers and comlink structures
	   code for this routine is in com_machine.c  */
    make_nn_gathers();
node0_printf("Made nn gathers\n"); fflush(stdout);
#ifdef FN
	/* set up 3rd nearest neighbor pointers and comlink structures
	   code for this routine is below  */
    make_3n_gathers();
node0_printf("Made 3nn gathers\n"); fflush(stdout);
#endif
	/* set up K-S phase vectors, boundary conditions */
    phaseset();

//#if HAVE_QOP
//  /* Initialize QOP */
//  if(initialize_qop() != QOP_SUCCESS){
//    node0_printf("setup: Error initializing QOP\n");
//    terminate(1);
//  }
//#endif

//#ifdef HAVE_QDP
//    make_rand_seed();
//node0_printf("Made random seed\n"); fflush(stdout);
//
//  for(i=0; i<4; ++i) {
//    shiftdirs[i] = QDP_neighbor[i];
//    shiftdirs[i+4] = neighbor3[i];
//  }
//  for(i=0; i<8; ++i) {
//    shiftfwd[i] = QDP_forward;
//    shiftbck[i] = QDP_backward;
//  }
//#endif

node0_printf("Finished setup\n"); fflush(stdout);
    return( prompt );
}
Ejemplo n.º 8
0
int  setup()   {
int prompt;

        /* print banner, get volume, nflavors, seed */
    prompt=initial_set();
        /* initialize the node random number generator */
    initialize_prn(&node_prn,iseed,volume+mynode());
        /* Initialize the layout functions, which decide where sites live */
    setup_layout();
        /* allocate space for lattice, set up coordinate fields */
    make_lattice();
        /* set up neighbor pointers and comlink structures */
    make_nn_gathers();

    return(prompt);
}
Ejemplo n.º 9
0
int
setup()
{
  int prompt;
#ifdef HAVE_QDP
  int i;
#endif
  
  /* print banner, get volume, seed */
  prompt = initial_set();
  /* initialize the node random number generator */
  initialize_prn( &node_prn, iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();
  node0_printf("Made lattice\n"); fflush(stdout);

  /* Mark fermion links as unallocated */
  init_ferm_links(&fn_links);
#ifdef DM_DU0
  init_ferm_links(&fn_links_dmdu0);
#endif
  /* set up neighbor pointers and comlink structures */
  make_nn_gathers();
  node0_printf("Made nn gathers\n"); fflush(stdout);
  /* set up 3rd nearest neighbor pointers and comlink structures
     code for this routine is below  */
  make_3n_gathers();
  node0_printf("Made 3nn gathers\n"); fflush(stdout);
  /* set up K-S phase vectors, boundary conditions */
  phaseset();
  
#ifdef HAVE_QDP
  for(i=0; i<4; ++i) {
    shiftdirs[i] = QDP_neighbor[i];
    shiftdirs[i+4] = neighbor3[i];
  }
  for(i=0; i<8; ++i) {
    shiftfwd[i] = QDP_forward;
    shiftbck[i] = QDP_backward;
  }
#endif

  node0_printf("Finished setup\n"); fflush(stdout);
  return( prompt );
}
Ejemplo n.º 10
0
void make_lattice() {
  register int i;
  int x, y, z, t;

  // Allocate space for lattice
  node0_printf("Mallocing %.1f MBytes per core for lattice\n",
               (double)sites_on_node * sizeof(site) / 1e6);
  lattice = malloc(sites_on_node * sizeof(*lattice));
  if (lattice == NULL) {
    printf("node%d: no room for lattice\n", this_node);
    terminate(1);
  }

  // Allocate address vectors
  for (i = 0; i < N_POINTERS; i++) {
    gen_pt[i] = malloc(sites_on_node * sizeof(char *));
    if (gen_pt[i] == NULL) {
      printf("node%d: no room for pointer array\n", this_node);
      terminate(1);
    }
  }

  // Fill in parity, coordinates and index
  for (t = 0; t < nt; t++) {
    for (z = 0; z < nz; z++) {
      for (y = 0; y < ny; y++) {
        for (x = 0; x < nx; x++) {
          if (node_number(x, y, z, t) == mynode()) {
            i = node_index(x, y, z, t);
            lattice[i].x = x;
            lattice[i].y = y;
            lattice[i].z = z;
            lattice[i].t = t;
            lattice[i].index = x + nx * (y + ny * (z + nz * t));
            if ((x + y + z + t) % 2 == 0)
              lattice[i].parity = EVEN;
            else
              lattice[i].parity = ODD;
#ifdef SITERAND
            initialize_prn(&(lattice[i].site_prn), iseed, lattice[i].index);
#endif
          }
        }
      }
    }
  }
}
Ejemplo n.º 11
0
int setup(void)   {
  int prompt;

  /* print banner, get volume */
  prompt=initial_set();
  if(prompt == 2)return prompt;
  /* initialize the node random number generator */
  initialize_prn( &node_prn, param.iseed, volume+mynode() );
  /* Initialize the layout functions, which decide where sites live */
  setup_layout();
  /* allocate space for lattice, set up coordinate fields */
  make_lattice();
  /* set up nearest neighbor gathers */
  make_nn_gathers();

  return(prompt);
}
Ejemplo n.º 12
0
// -----------------------------------------------------------------
int setup() {
  int prompt;

  // Print banner, get volume, seed
  prompt = initial_set();
  // Initialize the node random number generator
  initialize_prn(&node_prn, iseed, volume + mynode());
  // Initialize the layout functions, which decide where sites live
  setup_layout();
  // Allocate space for lattice, set up coordinate fields
  make_lattice();
  // Set up neighbor pointers and comlink structures
  make_nn_gathers();
  // Allocate space for fields
  make_fields();
  // Set up staggered phase vectors, boundary conditions
  phaseset();
  return prompt;
}