static void create_asqtad_links(int both, ferm_links_t *fn, ks_action_paths *ap) { Real *act_path_coeff = ap->act_path_coeff; double remaptime; char myname[] = "create_asqtad_links"; if( phases_in != 1){ node0_printf("create_asqtad_links: BOTCH: needs phases in\n"); terminate(1); } /* Initialize QOP */ if(initialize_qop() != QOP_SUCCESS){ printf("%s(%d): Error initializing QOP\n",myname,this_node); terminate(1); } /* Use MILC link fattening routines */ load_fatlinks(fn, ap); load_longlinks(fn, ap); /* Map to MILC fat and long links to QOP including possible change of precision */ create_qop_links_from_milc_fn(fn); }
static int bicgilu_cl_qop(quark_invert_control *qic, Real clov, MYREAL *kappas[], int nkappa[], wilson_vector *milc_srcs[], wilson_vector **milc_sols[], int nsrc, int *final_restart, Real* final_rsq_ptr, int milc_parity ) { int isrc, ikappa; QOP_FermionLinksWilson *qop_links; QOP_DiracFermion **qop_sol[MAXSRC], *qop_src[MAXSRC]; int iterations_used = 0; QOP_invert_arg_t qop_invert_arg; QOP_resid_arg_t ***qop_resid_arg; double remaptime; int i; site *s; if(nsrc > MAXSRC){ printf("bicgilu_cl_qop: too many sources\n"); terminate(1); } /* Initialize QOP */ if(initialize_qop() != QOP_SUCCESS){ printf("bicbilu_cl_qop: Error initializing QOP\n"); terminate(1); } /* Create QOP links object */ qop_links = create_qop_wilson_fermion_links( clov ); /* Set qop_invert_arg */ set_qop_invert_arg( & qop_invert_arg, qic, milc_parity ); /* Pointers for residual errors */ qop_resid_arg = create_qop_resid_arg( nsrc, nkappa, (qic->resid)*(qic->resid)); remaptime = -dclock(); /* Pointers for solution vectors */ for(isrc = 0; isrc < nsrc; isrc++){ qop_sol[isrc] = (QOP_DiracFermion **)malloc(sizeof(QOP_DiracFermion *)*nkappa[isrc]); if(qop_sol[isrc] == NULL){ printf("bicgilu_cl_qop: Can't allocate qop_sol\n"); terminate(1); } } /* Map MILC source and sink to QOP fields */ for(isrc = 0; isrc < nsrc; isrc++){ gamma5_flip(milc_srcs[isrc], milc_parity); /* compensate for QOP gamma */ qop_src[isrc] = create_D_from_field( milc_srcs[isrc], milc_parity); gamma5_flip(milc_srcs[isrc], milc_parity); /* restore the source */ for(ikappa = 0; ikappa < nkappa[isrc]; ikappa++){ /* Adjust normalization for MILC conventions */ gamma5_flip(milc_sols[isrc][ikappa], milc_parity); /* compensate for QOP gamma */ FORALLSITES(i,s){ scalar_mult_wvec( milc_sols[isrc][ikappa]+i, 2.*kappas[isrc][ikappa], milc_sols[isrc][ikappa]+i); } qop_sol[isrc][ikappa] = create_D_from_field( milc_sols[isrc][ikappa], milc_parity); } }
static void create_asqtad_links(int both, ferm_links_t *fn, ks_action_paths *ap) { Real *act_path_coeff = ap->act_path_coeff; su3_matrix **t_fl = &fn->fat; su3_matrix **t_ll = &fn->lng; char myname[] = "create_asqtad_links"; QOP_info_t info; QOP_asqtad_coeffs_t coeffs; #ifdef LLTIME double nflopfl = 61632; double nflopll = 1804; double nflop = nflopfl + nflopll; #endif double dtime; double remaptime = -dclock(); LOAD_QOP_ASQTAD_COEFFS(&coeffs, 0.5, act_path_coeff); if( phases_in != 1){ node0_printf("load_fermion_links_fn: BOTCH: needs phases in\n"); terminate(1); } /* Initialize QOP */ if(initialize_qop() != QOP_SUCCESS){ printf("%s(%d): Error initializing QOP\n",myname,this_node); terminate(1); } remaptime += dclock(); dtime = -dclock(); DESTROY_QOP_ASQTAD_FERMION_LINKS(fn); fn->QOP_L = CREATE_L_FROM_SITE_GAUGE( &info, &coeffs, F_OFFSET(link), EVENANDODD ); dtime += dclock(); remaptime -= dclock(); /* Allocate space for t_fl if NULL */ if(*t_fl == NULL){ *t_fl = (su3_matrix *)special_alloc(sites_on_node*4*sizeof(su3_matrix)); if(*t_fl==NULL){ printf("%s(%d): no room for t_fl\n",myname,this_node); terminate(1); } } /* Allocate space for t_ll if NULL and we are doing both fat and long */ if(*t_ll == NULL && both){ *t_ll = (su3_matrix *)special_alloc(sites_on_node*4*sizeof(su3_matrix)); if(*t_ll==NULL){ printf("%s(%d): no room for t_ll\n",myname,this_node); terminate(1); } } UNLOAD_L_TO_FIELDS( *t_fl, *t_ll, fn->QOP_L, EVENANDODD ); remaptime += dclock(); #ifdef LLTIME node0_printf("LLTIME(total): time = %e (Asqtad opt) mflops = %e\n",dtime, (Real)nflop*volume/(1e6*dtime*numnodes()) ); #endif #ifdef LLTIME #ifdef REMAP node0_printf("LLREMAP: time = %e\n",remaptime); #endif #endif }
static int bicgilu_cl_qop_qdp(int prop_type, int nsrc, int nkappa[], quark_invert_control *qic, void *dmps[], wilson_vector *milc_srcs[], wilson_vector **milc_sols[], int *final_restart, Real* final_rsq_ptr, int milc_parity ) { int isrc, ikappa; QOP_FermionLinksWilson *qop_links; QOP_DiracFermion **qop_sol[MAXSRC], *qop_src[MAXSRC]; int iterations_used = 0; double remaptime; int i; site *s; static float t_kappa; float *kappas[1] = { &t_kappa }; char myname[] = "bicgilu_cl_qop_qdp"; /* Check dimension */ if(nsrc > MAXSRC){ printf("%s: too many sources\n",myname); terminate(1); } /* Initialize QOP */ if(initialize_qop() != QOP_SUCCESS){ printf("%s: Error initializing QOP\n",myname); terminate(1); } /* Create QOP links object (double precision) and extract kappa */ if(prop_type == CLOVER_TYPE){ /* If there are multiple kappas, we assume that the Clov_c and u0 are the same for all kappas in this solve */ dirac_clover_param *dcp = (dirac_clover_param *)dmps[0]; /* Cast pass-through pointer */ Real Clov_c = dcp->Clov_c; /* Perturbative clover coeff */ Real U0 = dcp->U0; /* Tadpole correction to Clov_c */ Real clov = Clov_c/(U0*U0*U0); /* Full clover coefficient */ t_kappa = dcp->Kappa; qop_links = create_qop_wilson_fermion_links( clov ); } else { /* IFLA (OK) type */ newaction_ifla_param *nap = (newaction_ifla_param *)dmps[0]; /* Cast pass-through pointer */ t_kappa = nap->kapifla; qop_links = create_qop_wilson_fermion_links( 0 ); } remaptime = -dclock(); /* Pointers for solution vectors */ for(isrc = 0; isrc < nsrc; isrc++){ qop_sol[isrc] = (QOP_DiracFermion **)malloc(sizeof(QOP_DiracFermion *)*nkappa[isrc]); if(qop_sol[isrc] == NULL){ printf("bicgilu_cl_qop_qdp: Can't allocate qop_sol\n"); terminate(1); } } /* Map MILC source and sink to double-precision QOP fields */ for(isrc = 0; isrc < nsrc; isrc++){ gamma5_flip(milc_srcs[isrc], milc_parity); /* compensate for QOP gamma */ qop_src[isrc] = create_D_from_field( milc_srcs[isrc], milc_parity); gamma5_flip(milc_srcs[isrc], milc_parity); /* restore the source */ for(ikappa = 0; ikappa < nkappa[isrc]; ikappa++){ /* Adjust normalization for MILC conventions */ gamma5_flip(milc_sols[isrc][ikappa], milc_parity); /* compensate for QOP gamma */ FORALLSITES(i,s){ scalar_mult_wvec( milc_sols[isrc][ikappa]+i, 2.*kappas[isrc][ikappa], milc_sols[isrc][ikappa]+i); } qop_sol[isrc][ikappa] = create_D_from_field( milc_sols[isrc][ikappa], milc_parity); } }