#include CPS_START_NAMESPACE //-------------------------------------------------------------------- // CVS keywords // // $Author: zs $ // $Date: 2004/08/18 11:58:11 $ // $Header: /space/cvs/cps/cps++/tests/various/convert/main.C,v 1.5 2004/08/18 11:58:11 zs Exp $ // $Id: main.C,v 1.5 2004/08/18 11:58:11 zs Exp $ // $Name: v5_0_16_hantao_io_test_v7 $ // $Locker: $ // $RCSfile: main.C,v $ // $Revision: 1.5 $ // $Source: /space/cvs/cps/cps++/tests/various/convert/main.C,v $ // $State: Exp $ // //-------------------------------------------------------------------- CPS_END_NAMESPACE #include #include // exit() #include #include #include #include #include CPS_START_NAMESPACE GlobalJobParameter GJP; LatRanGen LRG; Verbose VRB; Error ERR; main(void) { char *cname = "(none)" ; char *fname = "main()"; //------------------------------------------------------------------------- // Initializes all Global Job Parameters //------------------------------------------------------------------------- DoArg do_arg; do_arg.x_node_sites = 2 ; do_arg.y_node_sites = 6 ; do_arg.z_node_sites = 10 ; do_arg.t_node_sites = 14 ; do_arg.s_node_sites = 1 ; do_arg.x_nodes = 2; do_arg.y_nodes = 2; do_arg.z_nodes = 2; do_arg.t_nodes = 2; do_arg.x_bc = BND_CND_PRD; do_arg.y_bc = BND_CND_PRD; do_arg.z_bc = BND_CND_PRD; do_arg.t_bc = BND_CND_APRD; do_arg.start_conf_kind = START_CONF_DISORD; do_arg.start_seed_kind = START_SEED_FIXED; do_arg.beta = 6.0; GJP.Initialize(do_arg); //------------------------------------------------------------------------- // Set verbose level //------------------------------------------------------------------------- VRB.DeactivateLevel(VERBOSE_RNGSEED_LEVEL); VRB.ActivateLevel(VERBOSE_FUNC_LEVEL); { GwilsonFnone lat ; IFloat *base, comp ; unsigned x,y,z,t,mu,row,col,r ; unsigned offset ; base = (IFloat *)lat.GaugeField() ; comp = 0.0 ; // component label offset = 0 ; //------------------------------------------------------------------------- // Loop over lattice in Canonical order labelling components serially //------------------------------------------------------------------------- for (t=0; t CANONICAL //------------------------------------------------------------------------- lat.Convert(CANONICAL) ; //------------------------------------------------------------------------- // CANONICAL -> STAG // // Loop over components in CANONICAL order but generate addresses using // STAG formula (actually the same) and check to make sure phases are // correct. //------------------------------------------------------------------------- lat.Convert(STAG) ; comp = 0.0 ; for (t=0; t STAG //------------------------------------------------------------------------- lat.Convert(STAG) ; //------------------------------------------------------------------------- // STAG -> CANONICAL // // Loop over components in CANONICAL order and check labelling //------------------------------------------------------------------------- lat.Convert(CANONICAL) ; offset = 0 ; comp = 0.0 ; for (t=0; t WILSON // // Loop over components in CANONICAL order but generate addresses using // WILSON formula and check to make sure components are correct. //------------------------------------------------------------------------- lat.Convert(WILSON) ; offset = 0 ; comp = 0.0 ; for (t=0; t WILSON //------------------------------------------------------------------------- lat.Convert(WILSON) ; //------------------------------------------------------------------------- // WILSON -> CANONICAL // // Loop over components in CANONICAL order and check labelling //------------------------------------------------------------------------- lat.Convert(CANONICAL) ; offset = 0 ; comp = 0.0 ; for (t=0; t G_WILSON_HB // // Loop over components in CANONICAL order but generate addresses using // G_WILSON_HB formula and check to make sure components are correct. //------------------------------------------------------------------------- lat.Convert(G_WILSON_HB) ; offset = 0 ; comp = 0.0 ; for (t=0; t G_WILSON_HB //------------------------------------------------------------------------- lat.Convert(G_WILSON_HB) ; //------------------------------------------------------------------------- // G_WILSON_HB -> CANONICAL // // Loop over components in CANONICAL order and check labelling //------------------------------------------------------------------------- lat.Convert(CANONICAL) ; offset = 0 ; comp = 0.0 ; for (t=0; t CANONICAL //------------------------------------------------------------------------- lat.Convert(CANONICAL, (Vector *) f1, (Vector *) f2) ; //------------------------------------------------------------------------- // CANONICAL -> WILSON // // Loop over components in CANONICAL order but generate addresses using // WILSON formula and check to make sure components are correct. //------------------------------------------------------------------------- lat.Convert(WILSON, (Vector *) f1, (Vector *) f2) ; idx = 0 ; comp = 0.0 ; for (t=0; t>= 1 ; idx = spin + lat.SpinComponents()*idx ; idx = color + lat.Colors()*idx ; idx = r + 2*idx ; if (*(f1+idx) != comp) VRB.Warn(cname,fname, "f1(%d,%d,%d,%d)\t%u\t%f != %f\n", x,y,z,t,idx,*(f1+idx),comp) ; if (*(f2+idx) != comp) VRB.Warn(cname,fname, "f2(%d,%d,%d,%d)\t%u\t%f != %f\n", x,y,z,t,idx,*(f2+idx),comp) ; comp += 1.0 ; } //------------------------------------------------------------------------- // check that Convert() traps on WILSON -> WILSON //------------------------------------------------------------------------- lat.Convert(WILSON, (Vector *) f1, (Vector *) f2) ; //------------------------------------------------------------------------- // WILSON -> CANONICAL // // Loop over components in CANONICAL order and check labelling //------------------------------------------------------------------------- lat.Convert(CANONICAL, (Vector *) f1, (Vector *) f2) ; idx = 0 ; comp = 0.0 ; for (t=0; t