Skip to content

Commit

Permalink
Change PRECISION macro to MILC_PRECISION to avoid conflicts with pack…
Browse files Browse the repository at this point in the history
…ages, such as Grid
  • Loading branch information
detar committed Jul 12, 2017
1 parent ae15e4a commit a1d02da
Show file tree
Hide file tree
Showing 31 changed files with 103 additions and 93 deletions.
2 changes: 1 addition & 1 deletion ks_dynamical/wavefunc_z.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void permute_combine(field_offset src,field_offset space,int size,int dir);
/* do a C.G. (source in phi, result in xxx) */
load_ferm_links(&fn_links);
cgn = ks_congrad(F_OFFSET(phi),F_OFFSET(xxx),mass,
niter, rsqprop, PRECISION, EVEN, &finalrsq,
niter, rsqprop, MILC_PRECISION, EVEN, &finalrsq,
&fn_links);
/* Multiply by -Madjoint, result in propmat[color] */
dslash_site( F_OFFSET(xxx), F_OFFSET(propmat[color]), ODD, &fn_links);
Expand Down
2 changes: 1 addition & 1 deletion ks_dynamical/wf_pt_t.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int wf_pt_t() /* return the C.G. iteration number */
/* do a C.G. (source in phi, result in xxx) */
load_ferm_links(&fn_links);
cgn += ks_congrad(F_OFFSET(phi),F_OFFSET(xxx),mass,
niter, rsqprop, PRECISION, EVEN, &finalrsq,
niter, rsqprop, MILC_PRECISION, EVEN, &finalrsq,
&fn_links);
/* Multiply by -Madjoint */
dslash_site( F_OFFSET(xxx), F_OFFSET(ttt), ODD, &fn_links);
Expand Down
4 changes: 2 additions & 2 deletions ks_eigen/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ int main( int argc, char **argv ){
#ifdef HYPISQ_SVD_COUNTER
hypisq_svd_counter = 0;
#endif
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
/* call fermion_variable measuring routines */
/* results are printed in output file */
f_meas_imp( 1, PRECISION, F_OFFSET(phi), F_OFFSET(xxx), mass,
f_meas_imp( 1, MILC_PRECISION, F_OFFSET(phi), F_OFFSET(xxx), mass,
0, fn_links);

eigVal = (double *)malloc(Nvecs*sizeof(double));
Expand Down
4 changes: 2 additions & 2 deletions ks_eigen/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ int readin(int prompt) {
#endif

#if ( FERM_ACTION == HISQ || FERM_ACTION == HYPISQ )
fn_links = create_fermion_links_from_site(PRECISION, n_naiks, eps_naik);
fn_links = create_fermion_links_from_site(MILC_PRECISION, n_naiks, eps_naik);
#else
fn_links = create_fermion_links_from_site(PRECISION, 0, NULL);
fn_links = create_fermion_links_from_site(MILC_PRECISION, 0, NULL);
#endif

/* Construct APE smeared links, but without KS phases */
Expand Down
2 changes: 1 addition & 1 deletion ks_hl_spectrum/control_hl_baryon.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main(int argc,char *argv[])
double starttime;
site *s;
double space_vol;
int prec = PRECISION; /* For file names */
int prec = MILC_PRECISION; /* For file names */

int t, color, spin, spin1;

Expand Down
4 changes: 2 additions & 2 deletions ks_imp_dyn/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ readin(int prompt)
#endif

#if ( FERM_ACTION == HISQ || FERM_ACTION == HYPISQ )
fn_links = create_fermion_links_from_site(PRECISION, n_naiks, eps_naik);
fn_links = create_fermion_links_from_site(MILC_PRECISION, n_naiks, eps_naik);
#else
fn_links = create_fermion_links_from_site(PRECISION, 0, NULL);
fn_links = create_fermion_links_from_site(MILC_PRECISION, 0, NULL);
#endif

/* make table of coefficients and permutations of loops in gauge action */
Expand Down
30 changes: 15 additions & 15 deletions ks_imp_dyn/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int update() {
/* also clear xxx, since zero is our best guess for the solution
with a new random phi field. */
if(step==1){
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
clear_latvec( F_OFFSET(xxx1), EVENANDODD );
grsource_imp( F_OFFSET(phi1), mass1, EVEN, fn[0]);
Expand All @@ -60,15 +60,15 @@ int update() {
/* do conjugate gradient to get (Madj M)inverse * phi */
if(step==1){
/* do conjugate gradient to get (Madj M)inverse * phi */
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
iters += ks_congrad( F_OFFSET(phi1), F_OFFSET(xxx1), mass1,
niter, nrestart, rsqmin, PRECISION, EVEN,
niter, nrestart, rsqmin, MILC_PRECISION, EVEN,
&final_rsq, fn[0]);
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
iters += ks_congrad( F_OFFSET(phi2), F_OFFSET(xxx2), mass2,
niter, nrestart, rsqmin, PRECISION, EVEN,
niter, nrestart, rsqmin, MILC_PRECISION, EVEN,
&final_rsq, fn[n-1]);

startaction=d_action();
Expand All @@ -87,13 +87,13 @@ int update() {

update_u(epsilon*(0.5-nflavors1/8.0));
clear_latvec( F_OFFSET(xxx1), EVENANDODD );
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
grsource_imp( F_OFFSET(phi1), mass1, EVEN, fn[0]);

update_u(epsilon*((nflavors1-nflavors2)/8.0));
clear_latvec( F_OFFSET(xxx2), EVENANDODD );
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
grsource_imp( F_OFFSET(phi2), mass2, EVEN, fn[n-1]);

Expand All @@ -102,18 +102,18 @@ int update() {
#endif

/* do conjugate gradient to get (Madj M)inverse * phi */
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
if(n == 2){
iters += ks_congrad( F_OFFSET(phi1), F_OFFSET(xxx1), mass1,
niter, nrestart, rsqmin, PRECISION, EVEN, &final_rsq, fn[0] );
niter, nrestart, rsqmin, MILC_PRECISION, EVEN, &final_rsq, fn[0] );
iters += ks_congrad( F_OFFSET(phi2), F_OFFSET(xxx2), mass2,
niter, nrestart, rsqmin, PRECISION, EVEN, &final_rsq, fn[1] );
niter, nrestart, rsqmin, MILC_PRECISION, EVEN, &final_rsq, fn[1] );
} else {
iters += ks_congrad_two_src( F_OFFSET(phi1), F_OFFSET(phi2),
F_OFFSET(xxx1), F_OFFSET(xxx2),
mass1, mass2, niter, nrestart, rsqmin,
PRECISION, EVEN, &final_rsq,
MILC_PRECISION, EVEN, &final_rsq,
fn[0]);
}

Expand All @@ -138,7 +138,7 @@ int update() {
/* Dump the computed fermion force from the site structure */
filexml = create_QCDML();
save_color_matrix_scidac_from_site(ansfile, filexml,
recxml, QIO_PARTFILE, F_OFFSET(mom[0]), 4, PRECISION);
recxml, QIO_PARTFILE, F_OFFSET(mom[0]), 4, MILC_PRECISION);
free_QCDML(filexml);
}
}
Expand All @@ -158,13 +158,13 @@ int update() {
#ifdef HMC_ALGORITHM
/* find action */
/* do conjugate gradient to get (Madj M)inverse * phi */
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
iters += ks_congrad( F_OFFSET(phi1), F_OFFSET(xxx1), mass1,
niter, nrestart, rsqmin, PRECISION, EVEN,
niter, nrestart, rsqmin, MILC_PRECISION, EVEN,
&final_rsq, fn[0]);
iters += ks_congrad( F_OFFSET(phi2), F_OFFSET(xxx2), mass2,
niter, nrestart, rsqmin, PRECISION, EVEN,
niter, nrestart, rsqmin, MILC_PRECISION, EVEN,
&final_rsq, fn[n-1]);
endaction=d_action();
/* decide whether to accept, if not, copy old link field back */
Expand Down
4 changes: 2 additions & 2 deletions ks_imp_dyn/update_h.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "ks_imp_includes.h" /* definitions files and prototypes */

void update_h( Real eps ){
int ff_prec = PRECISION; /* Just use prevailing precision for now */
int ff_prec = MILC_PRECISION; /* Just use prevailing precision for now */
#ifdef FN
// free_fn_links(&fn_links);
// free_fn_links(&fn_links_dmdu0);
Expand All @@ -25,7 +25,7 @@ void update_h( Real eps ){
/* First compute M*xxx in temporary vector xxx_odd */
/* See long comment at end of file */
/* The diagonal term in M doesn't matter */
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
#ifdef ONEMASS
eo_fermion_force_oneterm_site( eps, ((Real)nflavors)/4., F_OFFSET(xxx),
ff_prec, fn_links );
Expand Down
18 changes: 9 additions & 9 deletions ks_imp_dyn/update_onemass.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Real xrandom;

/*DEBUG*/
/**grsource_imp(F_OFFSET(phi), mass, EVENANDODD);
ks_congrad(F_OFFSET(phi),F_OFFSET(xxx),mass,niter,nrestart,rsqmin,PRECISION,EVENANDODD,&final_rsq);
ks_congrad(F_OFFSET(phi),F_OFFSET(xxx),mass,niter,nrestart,rsqmin,MILC_PRECISION,EVENANDODD,&final_rsq);
checkmul();**/
/*ENDDEBUG*/

Expand All @@ -44,7 +44,7 @@ checkmul();**/
#ifdef PHI_ALGORITHM
/* generate a pseudofermion configuration only at start*/
if(step==1){
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
grsource_imp(F_OFFSET(phi), mass, EVEN, fn[0]);
old_cg_time = cg_time = -1.0e6;
Expand All @@ -55,10 +55,10 @@ checkmul();**/
/* do conjugate gradient to get (Madj M)inverse * phi */
if(step==1){
/* do conjugate gradient to get (Madj M)inverse * phi */
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
iters += ks_congrad( F_OFFSET(phi), F_OFFSET(xxx), mass,
niter, nrestart, rsqmin, PRECISION,
niter, nrestart, rsqmin, MILC_PRECISION,
EVEN, &final_rsq, fn[0] );
cg_time = 0.0;

Expand All @@ -80,7 +80,7 @@ checkmul();**/
update_u(epsilon*(0.5-nflavors/8.0));

/* generate a pseudofermion configuration */
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
grsource_imp(F_OFFSET(phi), mass, EVEN, fn[0]);
cg_time = -1.0e6;
Expand All @@ -90,10 +90,10 @@ checkmul();**/
#endif

/* do conjugate gradient to get (Madj M)inverse * phi */
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
iters += ks_congrad( F_OFFSET(phi), F_OFFSET(xxx), mass,
niter, nrestart, rsqmin, PRECISION,
niter, nrestart, rsqmin, MILC_PRECISION,
EVEN, &final_rsq, fn[0] );
dslash_site( F_OFFSET(xxx), F_OFFSET(xxx), ODD, fn[0]);
cg_time = ((Real)step - 0.5)*epsilon;
Expand All @@ -115,10 +115,10 @@ checkmul();**/
/* do conjugate gradient to get (Madj M)inverse * phi */
next_cg_time = steps*epsilon;
predict_next_xxx(&old_cg_time,&cg_time,&next_cg_time);
restore_fermion_links_from_site(fn_links, PRECISION);
restore_fermion_links_from_site(fn_links, MILC_PRECISION);
fn = get_fm_links(fn_links);
iters += ks_congrad( F_OFFSET(phi), F_OFFSET(xxx), mass,
niter, nrestart, rsqmin, PRECISION,
niter, nrestart, rsqmin, MILC_PRECISION,
EVEN, &final_rsq, fn[0] );
cg_time = steps*epsilon;
endaction=d_action();
Expand Down
2 changes: 1 addition & 1 deletion ks_imp_dyn/update_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void update_u(Real eps){
} // dir
}

qudaUpdateU(PRECISION, eps, momentum, gauge);
qudaUpdateU(MILC_PRECISION, eps, momentum, gauge);

// Copy updated gauge field back to site structure
FORALLSITES(i,s){
Expand Down
4 changes: 2 additions & 2 deletions ks_imp_rhmc/control_test_su3_mat_op.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ int main(void) {
/* unit matrix */
unity_su3mat( &Unit );

#if ( PRECISION==1 )
#if ( MILC_PRECISION==1 )
printf( "Testing in SINGLE precision\n" );
#else
printf( "Testing in DOUBLE precision\n" );
#endif /* PRECISION */
#endif /* MILC_PRECISION */


/* MAIN REPETITION LOOP */
Expand Down
4 changes: 2 additions & 2 deletions ks_imp_rhmc/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,9 @@ readin(int prompt)
#endif

#if ( FERM_ACTION == HISQ || FERM_ACTION == HYPISQ )
fn_links = create_fermion_links_from_site(PRECISION, n_naiks, eps_naik);
fn_links = create_fermion_links_from_site(MILC_PRECISION, n_naiks, eps_naik);
#else
fn_links = create_fermion_links_from_site(PRECISION, 0, NULL);
fn_links = create_fermion_links_from_site(MILC_PRECISION, 0, NULL);
#endif

/* make table of coefficients and permutations of loops in gauge action */
Expand Down
2 changes: 1 addition & 1 deletion ks_imp_rhmc/update_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void update_u(Real eps){
} // dir
} END_LOOP_OMP

qudaUpdateU(PRECISION, eps, momentum, gauge);
qudaUpdateU(MILC_PRECISION, eps, momentum, gauge);

// Copy updated gauge field back to site structure
FORALLSITES_OMP(i,s,private(dir)){
Expand Down
14 changes: 7 additions & 7 deletions ks_imp_utilities/check_fermion_force.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ void check_fermion_force( char srcfile[MAX_MASS][MAXFILENAME], int srcflag,
su3_matrix tmat, diffmat;
char *filexml;
char recxml[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><title>Test fermion force field</title>";
#if (PRECISION == 1)
#if (MILC_PRECISION == 1)
Real tol = 1e-3;
#else
Real tol = 1e-5;
#endif
int ff_prec = PRECISION; /* Just use prevailing precision for now */
int ff_prec = MILC_PRECISION; /* Just use prevailing precision for now */
/* Supports only asqtad at the moment */
imp_ferm_links_t **fn = get_fm_links(fn_links);
Real *residues = (Real *)malloc(nmass*sizeof(Real));;
Expand Down Expand Up @@ -91,7 +91,7 @@ void check_fermion_force( char srcfile[MAX_MASS][MAXFILENAME], int srcflag,

/* If the answer file is given, read it for comparison */
if(ansflag == RELOAD_SERIAL){
restore_color_matrix_scidac_to_field(ansfile, ansmom, 4, PRECISION);
restore_color_matrix_scidac_to_field(ansfile, ansmom, 4, MILC_PRECISION);
node0_printf("Checking the answer\n"); fflush(stdout);
}

Expand Down Expand Up @@ -140,24 +140,24 @@ void check_fermion_force( char srcfile[MAX_MASS][MAXFILENAME], int srcflag,
if(srcflag == SAVE_SERIAL)
save_ks_vector_scidac_from_field(srcfile[i], "check fermion force",
"source color vector field",
QIO_SINGLEFILE, QIO_SERIAL, src[i], 1, PRECISION);
QIO_SINGLEFILE, QIO_SERIAL, src[i], 1, MILC_PRECISION);
else if(srcflag == SAVE_PARTFILE_SCIDAC)
save_ks_vector_scidac_from_field(srcfile[i], "check fermion force",
"source color vector field",
QIO_PARTFILE, QIO_SERIAL, src[i], 1, PRECISION);
QIO_PARTFILE, QIO_SERIAL, src[i], 1, MILC_PRECISION);
}

if(ansflag == SAVE_SERIAL){
filexml = create_QCDML();
save_color_matrix_scidac_from_field(ansfile, filexml,
recxml, QIO_SINGLEFILE, ansmom, 4, PRECISION);
recxml, QIO_SINGLEFILE, ansmom, 4, MILC_PRECISION);
free_QCDML(filexml);
}
else if(ansflag == SAVE_PARTFILE_SCIDAC){
node0_printf("Saving the momentum matrix\n");
filexml = create_QCDML();
save_color_matrix_scidac_from_field(ansfile, filexml,
recxml, QIO_PARTFILE, ansmom, 4, PRECISION);
recxml, QIO_PARTFILE, ansmom, 4, MILC_PRECISION);
free_QCDML(filexml);
}
#endif
Expand Down
8 changes: 4 additions & 4 deletions ks_imp_utilities/check_ks_invert.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void check_ks_invert( char *srcfile, int srcflag,
{
char myname[] = "check_ks_invert";
/* Note: these are absolute, not relative errors. */
#if (PRECISION == 1)
#if (MILC_PRECISION == 1)
Real tol_M = 1e-2;
Real tol_MdagM = 1e-3;
#else
Expand Down Expand Up @@ -131,7 +131,7 @@ void check_ks_invert( char *srcfile, int srcflag,
#ifdef HAVE_QIO
if(srcflag == SAVE_SERIAL)
save_ks_vector_scidac_from_field(srcfile, srcfilexml, srcrecxml,
QIO_SINGLEFILE, QIO_SERIAL, src, 1, PRECISION);
QIO_SINGLEFILE, QIO_SERIAL, src, 1, MILC_PRECISION);
#endif

/* Check the inversion */
Expand All @@ -149,10 +149,10 @@ void check_ks_invert( char *srcfile, int srcflag,
if(ansflag[0] == SAVE_SERIAL){
if(inverttype == INVERT_M)
save_ks_vector_scidac_from_field(ansfile[i], srcfilexml, ansMrecxml,
QIO_SINGLEFILE, QIO_SERIAL, ans[i], 1, PRECISION);
QIO_SINGLEFILE, QIO_SERIAL, ans[i], 1, MILC_PRECISION);
else
save_ks_vector_scidac_from_field(ansfile[i], srcfilexml, ansMdMrecxml,
QIO_SINGLEFILE, QIO_SERIAL, ans[i], 1, PRECISION);
QIO_SINGLEFILE, QIO_SERIAL, ans[i], 1, MILC_PRECISION);
}
#endif
}
Expand Down
8 changes: 4 additions & 4 deletions ks_imp_utilities/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ int main( int argc, char **argv ){
node0_printf("Saving the long links\n");
save_color_matrix_scidac_from_field( savelongfile, filexml,
"Long links", QIO_SINGLEFILE,
get_lnglinks(get_fm_links(fn_links)[0]), 4, PRECISION);
get_lnglinks(get_fm_links(fn_links)[0]), 4, MILC_PRECISION);
/* REMOVE NEXT STATEMENT */
// save_color_matrix_scidac_from_field( "lngback.scidac", filexml,
// "Long back links", QIO_SINGLEFILE,
// get_lngbacklinks(get_fm_links(fn_links)[0]), 4, PRECISION);
// get_lngbacklinks(get_fm_links(fn_links)[0]), 4, MILC_PRECISION);
free_QCDML(filexml);
#else
printf("ERROR: Can't save the longlinks. Recompile with QIO\n");
Expand All @@ -84,11 +84,11 @@ int main( int argc, char **argv ){
node0_printf("Saving the fat links\n");
save_color_matrix_scidac_from_field( savefatfile, filexml,
"Fat links", QIO_SINGLEFILE,
get_fatlinks(get_fm_links(fn_links)[0]), 4, PRECISION);
get_fatlinks(get_fm_links(fn_links)[0]), 4, MILC_PRECISION);
/* REMOVE NEXT STATEMENT */
// save_color_matrix_scidac_from_field( "fatback.scidac", filexml,
// "Fat back links", QIO_SINGLEFILE,
// get_fatbacklinks(get_fm_links(fn_links)[0]), 4, PRECISION);
// get_fatbacklinks(get_fm_links(fn_links)[0]), 4, MILC_PRECISION);
free_QCDML(filexml);
#else
printf("ERROR: Can't save the fatlinks. Recompile with QIO\n");
Expand Down
Loading

0 comments on commit a1d02da

Please sign in to comment.