#include #include #include #include #ifdef PARALLEL #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_BFM #include #endif //-------------------------------------------------------------- #define HAVE_DOEXT USING_NAMESPACE_CPS using namespace std; const char* cname = ""; DoArg do_arg; #ifdef HAVE_DOEXT DoArgExt doext_arg; #endif EvoArg evo_arg; ActionEOFAArg eofa_arg; #ifdef USE_BFM void init_bfm(int *argc, char **argv[]) { cps_qdp_init(argc, argv); Chroma::initialize(argc, argv); multi1d nrow(Nd); for(int i=0; i procs = QDP::Layout::logicalSize(); multi1d ncoor = QDP::Layout::nodeCoord(); for(int i=0; i<4; ++i){ bfm_arg.ncoor[i] = ncoor[i]; } bfm_arg.local_comm[0] = procs[0] > 1 ? 0 : 1; bfm_arg.local_comm[1] = procs[1] > 1 ? 0 : 1; bfm_arg.local_comm[2] = procs[2] > 1 ? 0 : 1; bfm_arg.local_comm[3] = procs[3] > 1 ? 0 : 1; if(GJP.Gparity()){ bfm_arg.gparity = 1; if(!UniqueID()){ printf("G-parity directions: "); } for(int d=0; d<3; d++){ if(GJP.Bc(d) == BND_CND_GPARITY){ bfm_arg.gparity_dir[d] = 1; if(!UniqueID()){ printf("%d ", d); } } } for(int d=0; d<4; d++){ bfm_arg.nodes[d] = procs[d]; } if(!UniqueID()){ printf("\n"); } } // mobius_scale = b + c in Andrew's notation #ifdef USE_NEW_BFM_GPARITY bfm_arg.mobius_scale = 2.0; bfm_arg.threads = 64; #else bfmarg::mobius_scale = 2.0; #endif #if TARGET == BGQ bfmarg::Threads(64); #else bfmarg::Threads(1); #endif bfmarg::Reproduce(0); bfmarg::ReproduceChecksum(0); bfmarg::ReproduceMasterCheck(0); bfmarg::Verbose(0); } #endif 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[]) { const char* fname = "main()"; Float dtime; Start(&argc, &argv); CommandLine::is(argc, argv); if(!do_arg.Decode(CommandLine::arg(), "do_arg")){ do_arg.Encode("bum_arg", "bum_arg"); printf("Bum do_arg\n"); exit(-1); } #ifdef HAVE_DOEXT if(!doext_arg.Decode(CommandLine::arg(), "doext_arg")){ printf("Bum doext_arg\n"); exit(-1); } #endif if(!evo_arg.Decode(CommandLine::arg(), "evo_arg")){ printf("Bum evo_arg\n"); exit(-1); } if(!eofa_arg.Decode(CommandLine::arg(), "eofa_arg")){ printf("Bum eofa_arg\n"); exit(-1); } #ifdef USE_QUDA if(!QudaParam.Decode(CommandLine::arg(), "QudaParam")){ printf("Bum quda_Arg\n"); exit(-1); } #endif Chdir(evo_arg.work_directory); GJP.Initialize(do_arg); #ifdef HAVE_DOEXT GJP.InitializeExt(doext_arg); #endif GJP.ZMobius_PC_Type(ZMOB_PC_ORIG); LRG.setSerial(); LRG.Initialize(); #ifdef USE_BFM init_bfm(&argc, &argv); #else { int threads; const char* nthr_str = getenv("OMP_NUM_THREADS"); if(nthr_str) { sscanf(nthr_str, "%d", &threads); GJP.SetNthreads(threads); } if(!UniqueID()){ printf("GJP.Nthreads() = %d\n", GJP.Nthreads()); } } #endif if(do_arg.start_conf_kind != START_CONF_FILE) { checkpoint(evo_arg.traj_start); } // Outer config loop int traj = evo_arg.traj_start; int g_int = evo_arg.gauge_unload_period; //!< Create fictitous Hamiltonian (mom + action) AlgMomentum mom; int n_step = eofa_arg.num_mass.num_mass_len; char lat_file[256]; char eigs_file[256]; char plaq_file[256]; std::vector> eigs(n_step, std::vector(2)); for(int conf=0; conf