fermion_links_t * create_fermion_links_hisq(int precision, int n_naiks, double eps_naik[], int phases_in, su3_matrix *links){ fermion_links_t *fl; ks_action_paths_hisq *ap; info_t info = INFO_ZERO; char myname[] = "create_fermion_links_hisq"; /* Precision for MILC is ignored: use the prevailing precision */ if(precision != PRECISION) if(mynode() == 0)printf("%s: Warning. Precision request replaced by %d\n", myname, PRECISION); if( phases_in != 1){ if(mynode() == 0)printf("BOTCH: %s needs phases in\n",myname); terminate(1); } fl = create_fermion_links_t(); /* Create the path tables */ /* (We copy the pointers into the fn_ap_links_t objects and the responsibility for freeing space is handed over to "destroy_hisq_links_t") */ ap = create_path_table_hisq(); make_path_table_hisq(ap, n_naiks, eps_naik); /* Complete the structure */ fl->flg = create_milc_hisq_links_t(&info, ap, links, &fl->options); #ifdef FLTIME if(mynode()==0)printf("FLTIME: time = %e (HISQ %s) mflops = %e\n", info.final_sec,milc_prec[PRECISION-1], info.final_flop/(1e6*info.final_sec) ); #endif return fl; }
// Returns 0 if the path table did not change. 1 if it did. int make_path_table(ks_action_paths *ap, ks_action_paths *ap_dmdu0) { int index_naik = -1, index_onelink = -1; #ifdef INDEX_NAIK index_naik = INDEX_NAIK; index_onelink = INDEX_ONELINK; #endif if(ap->constructed) return 0; node0_printf("MAKING PATH TABLES\n"); num_q_paths_1 = make_path_table_hisq( QUARK_ACTION_DESCRIPTION_1, quark_action_npaths_1, MAX_NUM_1, path_length_in_1, path_coeff_1, path_ind_1, act_path_coeff_1, q_paths_1, 0.0, -1, -1 ); ap->p1.num_q_paths = num_q_paths_1; ap->p1.q_paths = q_paths_1; ap->p1.act_path_coeff = act_path_coeff_1; #ifdef DM_DU0 ap_dmdu0->p1.num_q_paths = num_q_paths_1; ap_dmdu0->p1.q_paths = q_paths_1; ap_dmdu0->p1.act_path_coeff = act_path_coeff_dmdu0; // To be completed #endif #if ( UNITARIZATION_METHOD==UNITARIZE_NONE ) node0_printf("Unitarization method = UNITARIZE_NONE\n"); #elif ( UNITARIZATION_METHOD==UNITARIZE_APE ) node0_printf("UNITARIZE_APE: derivative is not ready for this method\n"); #elif ( UNITARIZATION_METHOD==UNITARIZE_ROOT ) node0_printf("Unitarization method = UNITARIZE_ROOT\n"); #elif ( UNITARIZATION_METHOD==UNITARIZE_RATIONAL ) node0_printf("Unitarization method = UNITARIZE_RATIONAL\n"); #elif ( UNITARIZATION_METHOD==UNITARIZE_ANALYTIC ) node0_printf("Unitarization method = UNITARIZE_ANALYTIC\n"); #elif ( UNITARIZATION_METHOD==UNITARIZE_STOUT ) node0_printf("Unitarization method = UNITARIZE_STOUT\n"); #else node0_printf("Unknown unitarization method\n"); terminate(0); #endif #if ( UNITARIZATION_GROUP==UNITARIZE_SU3 ) node0_printf("Unitarizaton group = SU(3)\n"); #elif ( UNITARIZATION_GROUP==UNITARIZE_U3 ) node0_printf("Unitarizaton group = U(3)\n"); #else node0_printf("Unknown unitarization group. Set U(3) or SU(3)\n"); terminate(0); #endif ap->umethod = UNITARIZATION_METHOD; ap_dmdu0->umethod = UNITARIZATION_METHOD; ap->ugroup = UNITARIZATION_GROUP; num_q_paths_2 = make_path_table_hisq( QUARK_ACTION_DESCRIPTION_2, quark_action_npaths_2, MAX_NUM_2, path_length_in_2, path_coeff_2, path_ind_2, act_path_coeff_2, q_paths_2, 0.0, -1, -1 ); ap->p2.num_q_paths = num_q_paths_2; ap->p2.q_paths = q_paths_2; ap->p2.act_path_coeff = act_path_coeff_2; #ifdef DM_DU0 ap_dmdu0->p2.num_q_paths = num_q_paths_2; ap_dmdu0->p2.q_paths = q_paths_2; ap_dmdu0->p2.act_path_coeff = act_path_coeff_dmdu0; // To be completed #endif num_q_paths_3 = make_path_table_hisq( QUARK_ACTION_DESCRIPTION_3, quark_action_npaths_3, MAX_NUM_3, path_length_in_3, path_coeff_3, path_ind_3, act_path_coeff_3, q_paths_3, 0.0, -1, -1 ); ap->p3.num_q_paths = num_q_paths_3; ap->p3.q_paths = q_paths_3; ap->p3.act_path_coeff = act_path_coeff_3; ap->constructed = 1; return 1; }
//originally make_path_table in quark_stuff_hisq.c static void QOP_make_paths_and_dirs_hisq(QOP_hisq_coeffs_t *coef, QOP_hisq_unitarize_method_t umethod) { int disp[4] = {0,0,0,0}; for(int i=0; i<4; i++) { disp[i] = 3; neighbor3[i] = QDP_create_shift(disp); disp[i] = 0; } for(int i=0; i<4; ++i) { shiftdirs[i] = QDP_neighbor[i]; shiftdirs[i+4] = neighbor3[i]; } REAL path_coeff_1[NUM_BASIC_PATHS_1] = {coef->fat7_one_link, coef->fat7_three_staple, coef->fat7_five_staple, coef->fat7_seven_staple}; REAL path_coeff_2[NUM_BASIC_PATHS_2] = {coef->asqtad_one_link, coef->asqtad_naik, coef->asqtad_three_staple, coef->asqtad_five_staple, coef->asqtad_seven_staple, coef->asqtad_lepage}; REAL path_coeff_3[NUM_BASIC_PATHS_3] = {coef->difference_one_link, coef->difference_naik}; QOP_printf0("QOP MAKING PATH TABLES\n"); num_q_paths_1 = make_path_table_hisq( QUARK_ACTION_DESCRIPTION_1, quark_action_npaths_1, MAX_NUM_1, path_length_in_1, path_coeff_1, path_ind_1, act_path_coeff_1, q_paths_1, 0.0, -1, -1 ); if ( umethod==QOP_UNITARIZE_NONE ) { QOP_printf0("QOP Unitarization method = QOP_UNITARIZE_NONE\n"); } else if ( umethod==QOP_UNITARIZE_RATIONAL ) { QOP_printf0("QOP Unitarization method = QOP_UNITARIZE_RATIONAL\n"); } else { QOP_printf0("QOP Unknown or unsupported unitarization method\n"); exit(0); } num_q_paths_2 = make_path_table_hisq( QUARK_ACTION_DESCRIPTION_2, quark_action_npaths_2, MAX_NUM_2, path_length_in_2, path_coeff_2, path_ind_2, act_path_coeff_2, q_paths_2, 0.0, -1, -1 ); num_q_paths_3 = make_path_table_hisq( QUARK_ACTION_DESCRIPTION_3, quark_action_npaths_3, MAX_NUM_3, path_length_in_3, path_coeff_3, path_ind_3, act_path_coeff_3, q_paths_3, 0.0, -1, -1 ); }