Esempio n. 1
0
/* read in parameters and coupling constants	*/
int readin(int prompt) {
/* read in parameters for su3 monte carlo	*/
/* argument "prompt" is 1 if prompts are to be given for input	*/

     int status;
     Real x;

    /* On node zero, read parameters and send to all other nodes */
    if(this_node==0){

	printf("\n\n");
	status=0;
    
	/* get couplings and broadcast to nodes	*/
	/* beta, mass */
	IF_OK status += get_f(stdin, prompt,"mass", &par_buf.mass );
	IF_OK status += get_f(stdin, prompt,"u0", &par_buf.u0 );

	/* maximum no. of conjugate gradient iterations */
	IF_OK status += get_i(stdin, prompt,"max_cg_iterations", &par_buf.niter );
	/* maximum no. of conjugate gradient restarts */
	IF_OK status += get_i(stdin, prompt,"max_cg_restarts", &par_buf.nrestart );
    
	/* error per site for conjugate gradient */
	IF_OK status += get_f(stdin, prompt,"error_per_site", &x );
	IF_OK par_buf.rsqmin = x*x;   /* rsqmin is r**2 in conjugate gradient */
	    /* New conjugate gradient normalizes rsqmin by norm of source */
    
	/* error for propagator conjugate gradient */
	IF_OK status += get_f(stdin, prompt,"error_for_propagator", &x );
	IF_OK par_buf.rsqprop = x*x;
	IF_OK status += get_i(stdin, prompt,"Number_of_eigenvals", &par_buf.Nvecs );
	IF_OK status += get_i(stdin, prompt,"Max_Rayleigh_iters", &par_buf.MaxIter );
	IF_OK status += get_i(stdin, prompt,"Restart_Rayleigh", &par_buf.Restart );
	IF_OK status += get_i(stdin, prompt,"Kalkreuter_iters", &par_buf.Kiters );
	IF_OK status += get_f(stdin, prompt,"eigenval_tolerance", 
			      &par_buf.eigenval_tol );
	IF_OK status += get_f(stdin, prompt,"error_decrease", &par_buf.error_decr);

        /* find out what kind of starting lattice to use */
	IF_OK status += ask_starting_lattice(stdin,  prompt, &(par_buf.startflag),
	    par_buf.startfile );

	if( status > 0)par_buf.stopflag=1; else par_buf.stopflag=0;
    } /* end if(this_node==0) */

    /* Node 0 broadcasts parameter buffer to all other nodes */
    broadcast_bytes((char *)&par_buf,sizeof(par_buf));

    if( par_buf.stopflag != 0 )return par_buf.stopflag;

    niter = par_buf.niter;
    nrestart = par_buf.nrestart;
    rsqmin = par_buf.rsqmin;
    rsqprop = par_buf.rsqprop;
    mass = par_buf.mass;
    u0 = par_buf.u0;
    Nvecs = par_buf.Nvecs ;
    MaxIter = par_buf.MaxIter ;
    Restart = par_buf.Restart ;
    Kiters = par_buf.Kiters ;
    eigenval_tol = par_buf.eigenval_tol ;
    error_decr = par_buf.error_decr ;
    startflag = par_buf.startflag;
    strcpy(startfile,par_buf.startfile);

#if ( FERM_ACTION == HISQ || FERM_ACTION == HYPISQ )
    n_naiks = 1;
    eps_naik[0] = 0.0;
#endif

    /* Do whatever is needed to get lattice */
    if( startflag == CONTINUE ){
        rephase( OFF );
    }
    if( startflag != CONTINUE )
      startlat_p = reload_lattice( startflag, startfile );
    /* if a lattice was read in, put in KS phases and AP boundary condition */
    phases_in = OFF;
    rephase( ON );

  /* Set uptions for fermion links */
    
#ifdef DBLSTORE_FN
    /* We want to double-store the links for optimization */
    fermion_links_want_back(1);
#endif
    
#if ( FERM_ACTION == HISQ || FERM_ACTION == HYPISQ )
    fn_links = create_fermion_links_from_site(PRECISION, n_naiks, eps_naik);
#else
    fn_links = create_fermion_links_from_site(PRECISION, 0, NULL);
#endif
    
//    node0_printf("Calling for path table\n");fflush(stdout);
//    /* make table of coefficients and permutations of paths in quark action */
//    init_path_table(fn_links.ap);
//    make_path_table(fn_links.ap, NULL);
//    node0_printf("Done with path table\n");fflush(stdout);

    return(0);
}
Esempio n. 2
0
/* read in parameters and coupling constants    */
int readin(int prompt) {
/* read in parameters for su3 monte carlo       */
/* argument "prompt" is 1 if prompts are to be given for input */

int status;

    /* On node zero, read parameters and send to all other nodes */
    if(this_node==0){

        printf("\n\n");
	status=0;
    
	/* warms, trajecs */
	IF_OK status += get_i(stdin, prompt,"warms", &par_buf.warms );
	IF_OK status += get_i(stdin, prompt,"trajecs", &par_buf.trajecs );
    
	/* trajectories between propagator measurements */
	IF_OK status += 
	    get_i(stdin, prompt,"traj_between_meas", &par_buf.propinterval );
    
	/* get couplings and broadcast to nodes	*/
	/* beta */
	IF_OK status += get_f(stdin, prompt,"beta", &par_buf.beta );

	/* boundary condition flag */
	IF_OK status += get_i(stdin, prompt,"bc_flag", &par_buf.bc_flag );

#if ( defined HMC_ALGORITHM || defined RMD_ALGORITHM )
        /* microcanonical time step */
	IF_OK status +=
            get_f(stdin, prompt,"microcanonical_time_step", &par_buf.epsilon );
#endif  
        /*microcanonical steps per trajectory */
	IF_OK status += get_i(stdin, prompt,"steps_per_trajectory", &par_buf.steps );
    
#ifdef ORA_ALGORITHM
        /*qhb steps per trajectory */
	IF_OK status += get_i(stdin, prompt,"qhb_steps", &par_buf.stepsQ );
#endif   

        /* find out what kind of starting lattice to use */
	IF_OK status += ask_starting_lattice(stdin,  prompt, &(par_buf.startflag),
	    par_buf.startfile );

        /* find out what to do with lattice at end */
	IF_OK status += ask_ending_lattice(stdin,  prompt, &(par_buf.saveflag),
	    par_buf.savefile );
	IF_OK status += ask_ildg_LFN(stdin,  prompt, par_buf.saveflag,
				      par_buf.stringLFN );
 
        /* send parameter structure */
	if( status > 0)par_buf.stopflag=1; else par_buf.stopflag=0;
    } /* end if(this_node==0) */

    /* Node 0 broadcasts parameter buffer to all other nodes */
    broadcast_bytes((char *)&par_buf,sizeof(par_buf));

    if( par_buf.stopflag != 0 )
      normal_exit(0);

    warms = par_buf.warms;
    trajecs = par_buf.trajecs;
    steps = par_buf.steps;
    stepsQ = par_buf.stepsQ;
    propinterval = par_buf.propinterval;
    startflag = par_buf.startflag;
    saveflag = par_buf.saveflag;
    epsilon = par_buf.epsilon;
    beta = par_buf.beta;
    bc_flag = par_buf.bc_flag;
    strcpy(startfile,par_buf.startfile);
    strcpy(savefile,par_buf.savefile);
    strcpy(stringLFN, par_buf.stringLFN);

    c_t11 = 0;

    /* Do whatever is needed to get lattice */
    if( startflag != CONTINUE )
      startlat_p = reload_lattice( startflag, startfile );

    return(0);
} /*readin()*/
Esempio n. 3
0
// -----------------------------------------------------------------
// Read in parameters for SU(3) eigenvalues
int readin(int prompt) {
  // prompt=1 indicates prompts are to be given for input
  int status;

  // On node zero, read parameters and send to all other nodes
  if (this_node == 0) {
    printf("\n\n");
    status = 0;

    // Always calculating massless eigenvalues
    IF_OK status += get_i(stdin, prompt, "nsmear", &par_buf.nsmear);
    IF_OK status += get_f(stdin, prompt, "alpha_hyp0", &par_buf.alpha_hyp0);
    IF_OK status += get_f(stdin, prompt, "alpha_hyp1", &par_buf.alpha_hyp1);
    IF_OK status += get_f(stdin, prompt, "alpha_hyp2", &par_buf.alpha_hyp2);

    IF_OK status += get_f(stdin, prompt, "start", &par_buf.start);
    IF_OK status += get_i(stdin, prompt, "Nvecs", &par_buf.Nvecs);
    IF_OK status += get_i(stdin, prompt, "block", &par_buf.block);
    IF_OK status += get_f(stdin, prompt, "eig_tol", &par_buf.eig_tol);
    IF_OK status += get_i(stdin, prompt, "maxIter", &par_buf.maxIter);

    // Find out what kind of starting lattice to use
    IF_OK status += ask_starting_lattice(stdin, prompt, &par_buf.startflag,
                                         par_buf.startfile);

    if (status > 0)
      par_buf.stopflag = 1;
    else
      par_buf.stopflag = 0;
  }

  // Broadcast parameter buffer from node0 to all other nodes
  broadcast_bytes((char *)&par_buf, sizeof(par_buf));
  if (par_buf.stopflag != 0)
    normal_exit(0);

  nsmear = par_buf.nsmear;
  alpha_smear[0] = par_buf.alpha_hyp0;
  alpha_smear[1] = par_buf.alpha_hyp1;
  alpha_smear[2] = par_buf.alpha_hyp2;

  start = par_buf.start;
  Nvecs = par_buf.Nvecs;
  block = par_buf.block;
  eig_tol = par_buf.eig_tol;
  maxIter = par_buf.maxIter;

  startflag = par_buf.startflag;
  strcpy(startfile, par_buf.startfile);

  // Do whatever is needed to get lattice
  if (startflag == CONTINUE)
    rephase(OFF);

  startlat_p = reload_lattice(startflag, startfile);
  // If a lattice was read in, put in staggered phase factors
  // and antiperiodic boundary condition
  phases_in = OFF;
  rephase(ON);
  return 0;
}
Esempio n. 4
0
/* read in parameters and coupling constants	*/
int readin(int prompt) {
  /* read in parameters for su3 monte carlo	*/
  /* argument "prompt" is 1 if prompts are to be given for input	*/

  int status;
  int i;

  /* On node zero, read parameters and send to all other nodes */
  if(this_node==0){

    printf("\n\n");
    status=0;

    /* Number of kappas */
    IF_OK status += get_i(stdin, prompt,"number_of_kappas", &par_buf.num_kap );
    if( par_buf.num_kap>MAX_KAP ){
      printf("num_kap = %d must be <= %d!\n", par_buf.num_kap, MAX_KAP);
      status++;
    }

    /* boundary condition flag */
    IF_OK status += get_i(stdin, prompt, "bc_flag", &par_buf.bc_flag);

    /* Number of APE smearings */
    IF_OK status += get_i(stdin, prompt, "num_smear", &par_buf.num_smear);

    /* APE smearing parameter (Boulder convention) */
    IF_OK status += get_f(stdin, prompt, "alpha", &par_buf.alpha);

    /* To be save initialize the following to zero */
    for(i=0;i<MAX_KAP;i++){
      kap[i] = 0.0;
      resid[i] = 0.0;
    }

    for(i=0;i<par_buf.num_kap;i++){
      IF_OK status += get_f(stdin, prompt,"kappa", &par_buf.kap[i] );
    }

    /* Clover coefficient */
    IF_OK status += get_f(stdin, prompt,"clov_c", &par_buf.clov_c );

    /* fermion phase factors */
    IF_OK status += get_f(stdin, prompt,"ferm_phases[0]", &par_buf.ferm_phas[0] );
    IF_OK status += get_f(stdin, prompt,"ferm_phases[1]", &par_buf.ferm_phas[1] );
    IF_OK status += get_f(stdin, prompt,"ferm_phases[2]", &par_buf.ferm_phas[2] );

    /* maximum no. of conjugate gradient iterations */
    IF_OK status += get_i(stdin, prompt,"max_cg_iterations", &par_buf.niter );

    /* maximum no. of conjugate gradient restarts */
    IF_OK status += get_i(stdin, prompt,"max_cg_restarts", &par_buf.nrestart );

    /* error for propagator conjugate gradient */
    for(i=0;i<par_buf.num_kap;i++){
      IF_OK status += get_f(stdin, prompt,"error_for_propagator", &par_buf.resid[i] );
    }

    /* find out what kind of starting lattice to use */
    IF_OK status += ask_starting_lattice(stdin,  prompt, &par_buf.startflag,
	par_buf.startfile );

    /* send parameter structure */
    if( status > 0)par_buf.stopflag=1; else par_buf.stopflag=0;
  } /* end if(this_node==0) */

  /* Node 0 broadcasts parameter buffer to all other nodes */
  broadcast_bytes((char *)&par_buf,sizeof(par_buf));

  if( par_buf.stopflag != 0 )
    normal_exit(0);

  startflag = par_buf.startflag;
  bc_flag = par_buf.bc_flag;
  num_kap = par_buf.num_kap;
  clov_c = par_buf.clov_c;
  niter = par_buf.niter;
  nrestart = par_buf.nrestart;
  num_smear = par_buf.num_smear;
  alpha = par_buf.alpha;
  for(i=0;i<par_buf.num_kap;i++){
    kap[i] = par_buf.kap[i];
    resid[i] = par_buf.resid[i];
  }
  for(i=0;i<3;i++){
    ferm_phases[i] = par_buf.ferm_phas[i];
  }
  strcpy(startfile,par_buf.startfile);

  for(i=0;i<par_buf.num_kap;i++){
    wqs[i].c_src = NULL;
    wqs[i].wv_src = NULL;
    wqs[i].type = 0;
    wqs[i].x0 = 0;
    wqs[i].y0 = 0;
    wqs[i].z0 = 0;
    wqs[i].t0 = 0;
    strcpy(wqs[i].descrp,"Schroedinger wall source");
  }

  beta = 1e20;	/* Only needed in io_helpers for setting boundary fields */
  c_t11 = 0;	/* Only needed in io_helpers for setting boundary fields */
		/* These boundary fields are actually never used here */

  /* Do whatever is needed to get lattice */
  if( startflag != CONTINUE ){
    startlat_p = reload_lattice( startflag, startfile );
    invalidate_this_clov(gen_clov);
  }

  /* put in fermion phases */
  if( startflag != CONTINUE) do_phases();
  return(0);
}
Esempio n. 5
0
/* read in parameters and coupling constants	*/
int readin(int prompt) {
    /* read in parameters for su3 monte carlo	*/
    /* argument "prompt" is 1 if prompts are to be given for input	*/

    int status;
    Real x;

    /* On node zero, read parameters and send to all other nodes */
    if(this_node==0) {

        printf("\n\n");
        status=0;

        /* warms, trajecs */
        IF_OK status += get_i(stdin, prompt,"warms", &par_buf.warms );
        IF_OK status += get_i(stdin, prompt,"trajecs", &par_buf.trajecs );

        /* trajectories between propagator measurements */
        IF_OK status +=
            get_i(stdin, prompt,"traj_between_meas", &par_buf.propinterval );

        /* get couplings and broadcast to nodes	*/
        /* beta, kappa */
        IF_OK status += get_f(stdin, prompt,"beta", &par_buf.beta );
        IF_OK status += get_f(stdin, prompt,"kappa", &par_buf.kappa );

        /* microcanonical time step */
        IF_OK status +=
            get_f(stdin, prompt,"microcanonical_time_step", &par_buf.epsilon );

        /*microcanonical steps per trajectory */
        IF_OK status += get_i(stdin, prompt,"steps_per_trajectory", &par_buf.steps );

        /* maximum no. of conjugate gradient iterations */
        IF_OK status += get_i(stdin, prompt,"max_cg_iterations", &par_buf.niter);

        /* error per site for conjugate gradient */
        IF_OK status += get_f(stdin, prompt,"error_per_site", &x );
        IF_OK par_buf.rsqmin = x*x;   /* rsqmin is r**2 in conjugate gradient */

        /* error for propagator conjugate gradient */
        IF_OK status += get_f(stdin, prompt,"error_for_propagator", &x );
        IF_OK par_buf.rsqprop = x*x;


        /* find out what kind of starting lattice to use */
        IF_OK status += ask_starting_lattice(stdin,  prompt, &(par_buf.startflag),
                                             par_buf.startfile );

        /* find out what to do with lattice at end */
        IF_OK status += ask_ending_lattice(stdin,  prompt, &(par_buf.saveflag),
                                           par_buf.savefile );
        IF_OK status += ask_ildg_LFN(stdin,  prompt, par_buf.saveflag,
                                     par_buf.stringLFN );

        /* send parameter structure */
        if( status > 0)par_buf.stopflag=1;
        else par_buf.stopflag=0;
    } /* end if(this_node==0) */

    /* Node 0 broadcasts parameter buffer to all other nodes */
    broadcast_bytes((char *)&par_buf,sizeof(par_buf));

    if( par_buf.stopflag != 0 )
        normal_exit(0);

    warms = par_buf.warms;
    trajecs = par_buf.trajecs;
    steps = par_buf.steps;
    propinterval = par_buf.propinterval;
    startflag = par_buf.startflag;
    saveflag = par_buf.saveflag;
    niter = par_buf.niter;
    rsqmin = par_buf.rsqmin;
    rsqprop = par_buf.rsqprop;
    epsilon = par_buf.epsilon;
    beta = par_buf.beta;
    kappa = par_buf.kappa;
    strcpy(startfile,par_buf.startfile);
    strcpy(savefile,par_buf.savefile);
    strcpy(stringLFN, par_buf.stringLFN);

    /* Do whatever is needed to get lattice */
    if( startflag != CONTINUE )
        startlat_p = reload_lattice( startflag, startfile );

    return(0);
}