#include #include #include #include #include #include #if (VERSION_SUB >17 || VERSION_MAJOR > 4) #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef DO_SCU_CHECKSUMS #ifdef HAVE_QCDOCOS_SCU_CHECKSUM_H #include #endif //-------------------------------------------------------------- USING_NAMESPACE_CPS using namespace std; const int MAX_FILENAME = 256; HmcArg hmc_arg; HmcArg hmc_arg_pass; ActionGaugeArg gauge_arg; ActionQuotientArg quo_arg; ActionRationalQuotientArg rat_quo_arg; ActionRationalQuotientArg rat_quo_arg_new; IntABArg ab1_arg; IntABArg ab2_arg; IntABArg ab3_arg; IntABArg sum_arg; EvoArg evo_arg; DoArg do_arg; PbpArg pbp_arg; NoArg no_arg; FloatArray w_spect_mass_list; void checkpoint(int traj); inline int Chdir(const char *dir){ if (chdir(dir) !=0){ printf("cannot change directory to %s\n",dir); exit(-1); } return 0; } int main(int argc, char *argv[]) { // char plaq_file[256]; // char pbp_file[256]; // char hmc_file[256]; char *cname=argv[0]; char *fname="main()"; Float dtime; CommonArg common_arg_plaq; CommonArg common_arg_pbp; CommonArg common_arg_hmc; WspectArg w_spect_arg; CgArg w_spect_cg_arg; WspectOutput w_spect_output; FixGaugeArg w_spect_fg_arg; Start(&argc,&argv); if ( argc < 6 ) { if(!UniqueID()){ printf("Args:\tdo_arg.vml rat_quo_arg.vml gauge_arg.vml current_dir \n"); exit(-1); for(int i =0; i 7 ) sscanf(argv[7],"%d",&traj); evo_arg.traj_start = traj; // int w_int = evo_arg.measure_w_spect_interval; int g_int = evo_arg.gauge_unload_period; hmc_arg_pass = hmc_arg; sum_arg.A_steps = 1; sum_arg.B_steps = 1; //!< Create fictitous Hamiltonian (mom + action) AlgMomentum mom; AlgActionGauge gauge(mom, gauge_arg); // AlgActionQuotient quotient(mom, quo_arg); AlgActionRationalQuotient rat_quo(mom, rat_quo_arg); int n_step = rat_quo_arg.bsn_mass.bsn_mass_len; char lat_file[256]; char rng_file[256]; char gauge_file[256]; char rw_file[256]; char vml_file[256]; char pbp_file[256]; Float *rw_fac,*norm; rw_fac = new Float[n_step]; norm = new Float[n_step]; sprintf(gauge_file,"gauge.H"); for(int conf=0; conf< evo_arg.gauge_configurations; conf ++ ) { sprintf(lat_file,"%s.%d",evo_arg.gauge_file_stem,traj); sprintf(rw_file,"reweight.%d",traj); sprintf(pbp_file,"%s.%d",evo_arg.pbp_stem,traj); common_arg_pbp.set_filename(pbp_file); pbp_arg.src_u_s = 0; pbp_arg.src_l_s = GJP.SnodeSites() * GJP.Snodes() - 1; pbp_arg.snk_u_s = GJP.SnodeSites() * GJP.Snodes() - 1; pbp_arg.snk_l_s = 0; sprintf(vml_file,"rat_quo_arg.%d",traj); if ( !rat_quo_arg.Encode(vml_file,"rat_quo_arg") ){ printf("bad rat_quo_arg encode\n"); exit(-1); } FILE *fp = Fopen(rw_file,"a"); // sprintf(rng_file,"%s.%d",evo_arg.rng_file_stem,traj); { GwilsonFdwf lat; ReadLatticeParallel(lat,lat_file); AlgPbp pbp(lat,&common_arg_pbp,&pbp_arg); for(int pbp_counter = 0; pbp_counter < evo_arg.measure_pbp; pbp_counter++) { pbp.run(); } } FILE *fp2 = Fopen(gauge_file,"a"); Float S_g = gauge.energy(); glb_sum(&S_g); Fprintf(fp2,"%d\t%0.14e\n",traj,S_g); Fclose(fp2); // LRG.Read(rng_file,32); for(int i =0;i