Ejemplo n.º 1
0
void main(int argc, char **argv)
{
  /*--- Add rng_type as the argument to the new interface ---*/
  int rng_type;
  int seed, param, block_size, discard_blocks, use_blocks;
  
  /****************** Read and check Arguments ********************/
  if(argc==8 ) /*--- increase argc by 1 ---*/
  {
    argv++;
    rng_type = atoi(*argv++); /*--- get rng_type ---*/
    seed = atoi(*argv++);
    param = atoi(*argv++);
    lattice_size = atoi(*argv++);
    block_size = atoi(*argv++);
    discard_blocks = atoi(*argv++);
    use_blocks = atoi(*argv++);
    check_arguments(lattice_size, block_size, discard_blocks, use_blocks);
#ifdef PARALLEL
    printf("Wolff Algorithm with Parallel RNG\n");
#else
    printf("Wolff Algorithm with Serial RNG\n");
#endif
    printf("lattice_size = %d, block_size = %d, discard_blocks = %d, use_blocks = %d\n", lattice_size, block_size, discard_blocks, use_blocks);
  }
  else
  {
    printf("USAGE: %s rng_type seed param lattice_size block_size discard_blocks use_blocks\n", argv[0]);
    exit(-1);
  }


  minitialize(rng_type, seed, param, use_blocks); /* initalize data  */
  

  /************** 'Thermalize' system so that results are not influenced
    by the initial onditions                              *************/
  thermalize(block_size, discard_blocks);
  
  /********** Perform the actual Wolff algorithm calculations *********/
  wolff(block_size, use_blocks);
}
Ejemplo n.º 2
0
void main(int argc, char **argv)
{
  int seed, param, block_size, discard_blocks, use_blocks;
  
  /****************** Read and check Arguments ********************/
  if(argc==7 )
  {
    argv++;
    seed = atoi(*argv++);
    param = atoi(*argv++);
    lattice_size = atoi(*argv++);
    block_size = atoi(*argv++);
    discard_blocks = atoi(*argv++);
    use_blocks = atoi(*argv++);
    check_arguments(lattice_size, block_size, discard_blocks, use_blocks);
#ifdef PARALLEL
    printf("Wolff Algorithm with Parallel RNG\n");
#else
    printf("Wolff Algorithm with Serial RNG\n");
#endif
    printf("lattice_size = %d, block_size = %d, discard_blocks = %d, use_blocks = %d\n", lattice_size, block_size, discard_blocks, use_blocks);
  }
  else
  {
    printf("USAGE: %s seed param lattice_size block_size discard_blocks use_blocks\n", argv[0]);
    exit(-1);
  }


  initialize(seed, param, use_blocks); /* initalize data  */
  

  /************** 'Thermalize' system so that results are not influenced
    by the initial onditions                              *************/
  thermalize(block_size, discard_blocks);
  
  /********** Perform the actual Wolff algorithm calculations *********/
  wolff(block_size, use_blocks);
}