@@ -65,82 +65,76 @@ double measure_rectangles(const su3 ** const gf) {
65
65
const su3 * v = NULL , * w = NULL ;
66
66
double ALIGN ac , ks , kc , tr , ts , tt ;
67
67
68
- if (g_update_rectangle_energy ) {
69
- kc = 0.0 ;
70
- ks = 0.0 ;
68
+ kc = 0.0 ;
69
+ ks = 0.0 ;
71
70
#ifdef OMP
72
71
#pragma omp for
73
72
#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 ;
117
115
}
118
116
}
119
117
}
120
- kc = (kc + ks )/3.0 ;
118
+ }
119
+ kc = (kc + ks )/3.0 ;
121
120
#ifdef OMP
122
- g_omp_acc_re [thread_num ] = kc ;
121
+ g_omp_acc_re [thread_num ] = kc ;
123
122
#else
124
- res = kc ;
123
+ res = kc ;
125
124
#endif
126
- }
127
125
128
126
#ifdef OMP
129
127
} /* OpenMP parallel closing brace */
130
128
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 ];
135
132
#else
136
- if (g_update_rectangle_energy ) {
137
133
#endif
138
134
#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 ;
141
137
#endif
142
- g_update_rectangle_energy = 0 ;
143
- }
144
138
145
139
return res ;
146
140
}
0 commit comments