Skip to content

Commit

Permalink
removed also g_update_rectangle_energy
Browse files Browse the repository at this point in the history
  • Loading branch information
urbach committed Feb 13, 2013
1 parent 2acd272 commit c27ae34
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 76 deletions.
2 changes: 0 additions & 2 deletions GPU/mixed_solve.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,6 @@ MixedsolveParameter<RealT>* init_mixedsolve_eo(su3** gf){
float hostplaq;
int a = 0;
//for(count=0; count<1; count++){
g_update_gauge_energy = 1;
hostplaq = (float) measure_gauge_action()/(6.*VOLUME*g_nproc);
//}
assert((stop = clock())!=-1);
Expand All @@ -2393,7 +2392,6 @@ MixedsolveParameter<RealT>* init_mixedsolve_eo(su3** gf){
float hostrect;
assert((start = clock())!=-1);
//for(count=0; count<100; count++){
g_update_rectangle_energy = 1;
hostrect = (float) measure_rectangles()/(12.*VOLUME*g_nproc);
//}
assert((stop = clock())!=-1);
Expand Down
1 change: 0 additions & 1 deletion check_locallity.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ int main(int argc,char *argv[]) {
if (stout_smear((su3_tuple*)(g_gauge_field[0]), &params_smear, (su3_tuple*)(g_gauge_field[0])) != 0)
exit(1) ;
g_update_gauge_copy = 1;
g_update_rectangle_energy = 1;
plaquette_energy = measure_plaquette(g_gauge_field);

if (g_proc_id == 0) {
Expand Down
1 change: 0 additions & 1 deletion global.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ EXTERN int DUM_BI_DERI, DUM_BI_SOLVER, DUM_BI_MATRIX;
EXTERN int NO_OF_BISPINORFIELDS;

EXTERN int g_update_gauge_copy;
EXTERN int g_update_rectangle_energy;
EXTERN int g_relative_precision_flag;
EXTERN int g_debug_level;
EXTERN int g_disable_IO_checks;
Expand Down
1 change: 0 additions & 1 deletion hamiltonian_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ typedef struct {
su3adj ** momenta;
su3adj ** derivative;
int update_gauge_copy;
int update_rectangle_energy;
int traj_counter;
} hamiltonian_field_t;

Expand Down
1 change: 0 additions & 1 deletion init/init_gauge_field.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ int init_gauge_field(const int V, const int back) {
}
# endif
g_update_gauge_copy = 1;
g_update_rectangle_energy = 1;
return(0);
}

Expand Down
1 change: 0 additions & 1 deletion integrator.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ void integrator_set_fields(hamiltonian_field_t * hf) {
Integrator.hf.momenta = hf->momenta;
Integrator.hf.derivative = hf->derivative;
Integrator.hf.update_gauge_copy = hf->update_gauge_copy;
Integrator.hf.update_rectangle_energy = hf->update_rectangle_energy;
return;
}

Expand Down
1 change: 0 additions & 1 deletion invert.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ int main(int argc, char *argv[])
/* if (stout_smear((su3_tuple*)(g_gauge_field[0]), &params_smear, (su3_tuple*)(g_gauge_field[0])) != 0) */
/* exit(1) ; */
g_update_gauge_copy = 1;
g_update_rectangle_energy = 1;
plaquette_energy = measure_plaquette( (const su3**) g_gauge_field);

if (g_cart_id == 0) {
Expand Down
112 changes: 53 additions & 59 deletions measure_rectangles.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,82 +65,76 @@ double measure_rectangles(const su3 ** const gf) {
const su3 *v = NULL , *w = NULL;
double ALIGN ac, ks, kc, tr, ts, tt;

if(g_update_rectangle_energy) {
kc = 0.0;
ks = 0.0;
kc = 0.0;
ks = 0.0;
#ifdef OMP
#pragma omp for
#endif
for (i = 0; i < VOLUME; i++) {
for (mu = 0; mu < 4; mu++) {
for (nu = 0; nu < 4; nu++) {
if(nu != mu) {
/*
^
|
^
|
->
*/
j = g_iup[i][mu];
k = g_iup[j][nu];
v = &gf[i][mu];
w = &gf[j][nu];
_su3_times_su3(tmp, *v, *w);
v = &gf[k][nu];
_su3_times_su3(pr1, tmp, *v);
/*
->
^
|
^
|
*/
j = g_iup[i][nu];
k = g_iup[j][nu];
v = &gf[i][nu];
w = &gf[j][nu];
_su3_times_su3(tmp, *v, *w);
v = &gf[k][mu];
_su3_times_su3(pr2, tmp, *v);

/* Trace it */
_trace_su3_times_su3d(ac,pr1,pr2);
/* printf("i mu nu: %d %d %d, ac = %e\n", i, mu, nu, ac); */
/* Kahan summation */
tr=ac+kc;
ts=tr+ks;
tt=ts-ks;
ks=ts;
kc=tr-tt;
}
for (i = 0; i < VOLUME; i++) {
for (mu = 0; mu < 4; mu++) {
for (nu = 0; nu < 4; nu++) {
if(nu != mu) {
/*
^
|
^
|
->
*/
j = g_iup[i][mu];
k = g_iup[j][nu];
v = &gf[i][mu];
w = &gf[j][nu];
_su3_times_su3(tmp, *v, *w);
v = &gf[k][nu];
_su3_times_su3(pr1, tmp, *v);
/*
->
^
|
^
|
*/
j = g_iup[i][nu];
k = g_iup[j][nu];
v = &gf[i][nu];
w = &gf[j][nu];
_su3_times_su3(tmp, *v, *w);
v = &gf[k][mu];
_su3_times_su3(pr2, tmp, *v);

/* Trace it */
_trace_su3_times_su3d(ac,pr1,pr2);
/* printf("i mu nu: %d %d %d, ac = %e\n", i, mu, nu, ac); */
/* Kahan summation */
tr=ac+kc;
ts=tr+ks;
tt=ts-ks;
ks=ts;
kc=tr-tt;
}
}
}
kc=(kc+ks)/3.0;
}
kc=(kc+ks)/3.0;
#ifdef OMP
g_omp_acc_re[thread_num] = kc;
g_omp_acc_re[thread_num] = kc;
#else
res = kc;
res = kc;
#endif
}

#ifdef OMP
} /* OpenMP parallel closing brace */

if(g_update_rectangle_energy) {
res = 0.0;
for(int i = 0; i < omp_num_threads; ++i)
res += g_omp_acc_re[i];
res = 0.0;
for(int i = 0; i < omp_num_threads; ++i)
res += g_omp_acc_re[i];
#else
if(g_update_rectangle_energy) {
#endif
#ifdef MPI
MPI_Allreduce(&res, &mres, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
res = mres;
MPI_Allreduce(&res, &mres, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
res = mres;
#endif
g_update_rectangle_energy = 0;
}

return res;
}
1 change: 0 additions & 1 deletion reweighting_factor.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void reweighting_factor(const int N, const int nstore) {
hf.momenta = NULL;
hf.derivative = NULL;
hf.update_gauge_copy = g_update_gauge_copy;
hf.update_rectangle_energy = g_update_rectangle_energy;

sum = (double*)calloc(no_monomials, sizeof(double));
sum_sq = (double*)calloc(no_monomials, sizeof(double));
Expand Down
3 changes: 0 additions & 3 deletions start.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ void unit_g_gauge_field(void)
}
}
g_update_gauge_copy = 1;
g_update_rectangle_energy = 1;
return;
}

Expand Down Expand Up @@ -489,7 +488,6 @@ void random_gauge_field(const int repro, su3 ** const gf) {
}

g_update_gauge_copy = 1;
g_update_rectangle_energy = 1;
return;
}

Expand Down Expand Up @@ -686,7 +684,6 @@ void set_gauge_field(const double c)
}
}
g_update_gauge_copy = 1;
g_update_rectangle_energy = 1;
return;
}

Expand Down
2 changes: 0 additions & 2 deletions update_gauge.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ void update_gauge(const double step, hamiltonian_field_t * const hf) {
*/
hf->update_gauge_copy = 1;
g_update_gauge_copy = 1;
hf->update_rectangle_energy = 1;
g_update_rectangle_energy = 1;
etime = gettime();
if(g_debug_level > 1 && g_proc_id == 0) {
printf("# Time gauge update: %e s\n", etime-atime);
Expand Down
3 changes: 0 additions & 3 deletions update_tm.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ int update_tm(double *plaquette_energy, double *rectangle_energy,
hf.momenta = moment;
hf.derivative = df0;
hf.update_gauge_copy = g_update_gauge_copy;
hf.update_rectangle_energy = g_update_rectangle_energy;
hf.traj_counter = traj_counter;
integrator_set_fields(&hf);

Expand Down Expand Up @@ -345,8 +344,6 @@ int update_tm(double *plaquette_energy, double *rectangle_energy,
}
hf.update_gauge_copy = 1;
g_update_gauge_copy = 1;
hf.update_rectangle_energy = 1;
g_update_rectangle_energy = 1;
#ifdef MPI
xchange_gauge(hf.gaugefield);
#endif
Expand Down

0 comments on commit c27ae34

Please sign in to comment.