Skip to content

Commit c27ae34

Browse files
committed
removed also g_update_rectangle_energy
1 parent 2acd272 commit c27ae34

12 files changed

+53
-76
lines changed

GPU/mixed_solve.cu

-2
Original file line numberDiff line numberDiff line change
@@ -2372,7 +2372,6 @@ MixedsolveParameter<RealT>* init_mixedsolve_eo(su3** gf){
23722372
float hostplaq;
23732373
int a = 0;
23742374
//for(count=0; count<1; count++){
2375-
g_update_gauge_energy = 1;
23762375
hostplaq = (float) measure_gauge_action()/(6.*VOLUME*g_nproc);
23772376
//}
23782377
assert((stop = clock())!=-1);
@@ -2393,7 +2392,6 @@ MixedsolveParameter<RealT>* init_mixedsolve_eo(su3** gf){
23932392
float hostrect;
23942393
assert((start = clock())!=-1);
23952394
//for(count=0; count<100; count++){
2396-
g_update_rectangle_energy = 1;
23972395
hostrect = (float) measure_rectangles()/(12.*VOLUME*g_nproc);
23982396
//}
23992397
assert((stop = clock())!=-1);

check_locallity.c

-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ int main(int argc,char *argv[]) {
249249
if (stout_smear((su3_tuple*)(g_gauge_field[0]), &params_smear, (su3_tuple*)(g_gauge_field[0])) != 0)
250250
exit(1) ;
251251
g_update_gauge_copy = 1;
252-
g_update_rectangle_energy = 1;
253252
plaquette_energy = measure_plaquette(g_gauge_field);
254253

255254
if (g_proc_id == 0) {

global.h

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ EXTERN int DUM_BI_DERI, DUM_BI_SOLVER, DUM_BI_MATRIX;
7070
EXTERN int NO_OF_BISPINORFIELDS;
7171

7272
EXTERN int g_update_gauge_copy;
73-
EXTERN int g_update_rectangle_energy;
7473
EXTERN int g_relative_precision_flag;
7574
EXTERN int g_debug_level;
7675
EXTERN int g_disable_IO_checks;

hamiltonian_field.h

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ typedef struct {
3030
su3adj ** momenta;
3131
su3adj ** derivative;
3232
int update_gauge_copy;
33-
int update_rectangle_energy;
3433
int traj_counter;
3534
} hamiltonian_field_t;
3635

init/init_gauge_field.c

-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ int init_gauge_field(const int V, const int back) {
156156
}
157157
# endif
158158
g_update_gauge_copy = 1;
159-
g_update_rectangle_energy = 1;
160159
return(0);
161160
}
162161

integrator.c

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ void integrator_set_fields(hamiltonian_field_t * hf) {
9696
Integrator.hf.momenta = hf->momenta;
9797
Integrator.hf.derivative = hf->derivative;
9898
Integrator.hf.update_gauge_copy = hf->update_gauge_copy;
99-
Integrator.hf.update_rectangle_energy = hf->update_rectangle_energy;
10099
return;
101100
}
102101

invert.c

-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ int main(int argc, char *argv[])
356356
/* if (stout_smear((su3_tuple*)(g_gauge_field[0]), &params_smear, (su3_tuple*)(g_gauge_field[0])) != 0) */
357357
/* exit(1) ; */
358358
g_update_gauge_copy = 1;
359-
g_update_rectangle_energy = 1;
360359
plaquette_energy = measure_plaquette( (const su3**) g_gauge_field);
361360

362361
if (g_cart_id == 0) {

measure_rectangles.c

+53-59
Original file line numberDiff line numberDiff line change
@@ -65,82 +65,76 @@ double measure_rectangles(const su3 ** const gf) {
6565
const su3 *v = NULL , *w = NULL;
6666
double ALIGN ac, ks, kc, tr, ts, tt;
6767

68-
if(g_update_rectangle_energy) {
69-
kc = 0.0;
70-
ks = 0.0;
68+
kc = 0.0;
69+
ks = 0.0;
7170
#ifdef OMP
7271
#pragma omp for
7372
#endif
74-
for (i = 0; i < VOLUME; i++) {
75-
for (mu = 0; mu < 4; mu++) {
76-
for (nu = 0; nu < 4; nu++) {
77-
if(nu != mu) {
78-
/*
79-
^
80-
|
81-
^
82-
|
83-
->
84-
*/
85-
j = g_iup[i][mu];
86-
k = g_iup[j][nu];
87-
v = &gf[i][mu];
88-
w = &gf[j][nu];
89-
_su3_times_su3(tmp, *v, *w);
90-
v = &gf[k][nu];
91-
_su3_times_su3(pr1, tmp, *v);
92-
/*
93-
->
94-
^
95-
|
96-
^
97-
|
98-
*/
99-
j = g_iup[i][nu];
100-
k = g_iup[j][nu];
101-
v = &gf[i][nu];
102-
w = &gf[j][nu];
103-
_su3_times_su3(tmp, *v, *w);
104-
v = &gf[k][mu];
105-
_su3_times_su3(pr2, tmp, *v);
106-
107-
/* Trace it */
108-
_trace_su3_times_su3d(ac,pr1,pr2);
109-
/* printf("i mu nu: %d %d %d, ac = %e\n", i, mu, nu, ac); */
110-
/* Kahan summation */
111-
tr=ac+kc;
112-
ts=tr+ks;
113-
tt=ts-ks;
114-
ks=ts;
115-
kc=tr-tt;
116-
}
73+
for (i = 0; i < VOLUME; i++) {
74+
for (mu = 0; mu < 4; mu++) {
75+
for (nu = 0; nu < 4; nu++) {
76+
if(nu != mu) {
77+
/*
78+
^
79+
|
80+
^
81+
|
82+
->
83+
*/
84+
j = g_iup[i][mu];
85+
k = g_iup[j][nu];
86+
v = &gf[i][mu];
87+
w = &gf[j][nu];
88+
_su3_times_su3(tmp, *v, *w);
89+
v = &gf[k][nu];
90+
_su3_times_su3(pr1, tmp, *v);
91+
/*
92+
->
93+
^
94+
|
95+
^
96+
|
97+
*/
98+
j = g_iup[i][nu];
99+
k = g_iup[j][nu];
100+
v = &gf[i][nu];
101+
w = &gf[j][nu];
102+
_su3_times_su3(tmp, *v, *w);
103+
v = &gf[k][mu];
104+
_su3_times_su3(pr2, tmp, *v);
105+
106+
/* Trace it */
107+
_trace_su3_times_su3d(ac,pr1,pr2);
108+
/* printf("i mu nu: %d %d %d, ac = %e\n", i, mu, nu, ac); */
109+
/* Kahan summation */
110+
tr=ac+kc;
111+
ts=tr+ks;
112+
tt=ts-ks;
113+
ks=ts;
114+
kc=tr-tt;
117115
}
118116
}
119117
}
120-
kc=(kc+ks)/3.0;
118+
}
119+
kc=(kc+ks)/3.0;
121120
#ifdef OMP
122-
g_omp_acc_re[thread_num] = kc;
121+
g_omp_acc_re[thread_num] = kc;
123122
#else
124-
res = kc;
123+
res = kc;
125124
#endif
126-
}
127125

128126
#ifdef OMP
129127
} /* OpenMP parallel closing brace */
130128

131-
if(g_update_rectangle_energy) {
132-
res = 0.0;
133-
for(int i = 0; i < omp_num_threads; ++i)
134-
res += g_omp_acc_re[i];
129+
res = 0.0;
130+
for(int i = 0; i < omp_num_threads; ++i)
131+
res += g_omp_acc_re[i];
135132
#else
136-
if(g_update_rectangle_energy) {
137133
#endif
138134
#ifdef MPI
139-
MPI_Allreduce(&res, &mres, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
140-
res = mres;
135+
MPI_Allreduce(&res, &mres, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
136+
res = mres;
141137
#endif
142-
g_update_rectangle_energy = 0;
143-
}
144138

145139
return res;
146140
}

reweighting_factor.c

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ void reweighting_factor(const int N, const int nstore) {
4343
hf.momenta = NULL;
4444
hf.derivative = NULL;
4545
hf.update_gauge_copy = g_update_gauge_copy;
46-
hf.update_rectangle_energy = g_update_rectangle_energy;
4746

4847
sum = (double*)calloc(no_monomials, sizeof(double));
4948
sum_sq = (double*)calloc(no_monomials, sizeof(double));

start.c

-3
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ void unit_g_gauge_field(void)
420420
}
421421
}
422422
g_update_gauge_copy = 1;
423-
g_update_rectangle_energy = 1;
424423
return;
425424
}
426425

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

491490
g_update_gauge_copy = 1;
492-
g_update_rectangle_energy = 1;
493491
return;
494492
}
495493

@@ -686,7 +684,6 @@ void set_gauge_field(const double c)
686684
}
687685
}
688686
g_update_gauge_copy = 1;
689-
g_update_rectangle_energy = 1;
690687
return;
691688
}
692689

update_gauge.c

-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ void update_gauge(const double step, hamiltonian_field_t * const hf) {
9898
*/
9999
hf->update_gauge_copy = 1;
100100
g_update_gauge_copy = 1;
101-
hf->update_rectangle_energy = 1;
102-
g_update_rectangle_energy = 1;
103101
etime = gettime();
104102
if(g_debug_level > 1 && g_proc_id == 0) {
105103
printf("# Time gauge update: %e s\n", etime-atime);

update_tm.c

-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ int update_tm(double *plaquette_energy, double *rectangle_energy,
9393
hf.momenta = moment;
9494
hf.derivative = df0;
9595
hf.update_gauge_copy = g_update_gauge_copy;
96-
hf.update_rectangle_energy = g_update_rectangle_energy;
9796
hf.traj_counter = traj_counter;
9897
integrator_set_fields(&hf);
9998

@@ -345,8 +344,6 @@ int update_tm(double *plaquette_energy, double *rectangle_energy,
345344
}
346345
hf.update_gauge_copy = 1;
347346
g_update_gauge_copy = 1;
348-
hf.update_rectangle_energy = 1;
349-
g_update_rectangle_energy = 1;
350347
#ifdef MPI
351348
xchange_gauge(hf.gaugefield);
352349
#endif

0 commit comments

Comments
 (0)