Bridge++  Ver. 2.0.2
mult_Clover_qxs-inc.h
Go to the documentation of this file.
1 
10 #ifndef MULT_CLOVER_QXS_INCLUDED
11 #define MULT_CLOVER_QXS_INCLUDED
12 
13 #include "mult_common_th-inc.h"
14 
15 //====================================================================
17  real_t *ct, real_t *v1,
18  real_t kappa, int *bc,
19  int *Nsize, int *do_comm)
20 {
21  int Nxv = Nsize[0];
22  int Nyv = Nsize[1];
23  int Nz = Nsize[2];
24  int Nt = Nsize[3];
25  int Nstv = Nxv * Nyv * Nz * Nt;
26  int Nst = Nstv * VLEN;
27 
28  svbool_t pg1_xp, pg2_xp, pg1_xm, pg2_xm;
29  svbool_t pg1_yp, pg2_yp, pg1_ym, pg2_ym;
30  set_predicate_xp(pg1_xp, pg2_xp);
31  set_predicate_xm(pg1_xm, pg2_xm);
32  set_predicate_yp(pg1_yp, pg2_yp);
33  set_predicate_ym(pg1_ym, pg2_ym);
34 
35  int Nxy = Nxv * Nyv;
36  int Nxyz = Nxv * Nyv * Nz;
37 
38  int ith, nth, is, ns;
39  set_threadtask(ith, nth, is, ns, Nstv);
40 
41  for (int site = is; site < ns; ++site) {
42  int ix = site % Nxv;
43  int iyzt = site / Nxv;
44  int iy = iyzt % Nyv;
45  int izt = site / Nxy;
46  int iz = izt % Nz;
47  int it = izt / Nz;
48  int ixy = ix + Nxv * iy;
49  int ixyz = ixy + Nxy * iz;
50 
51  Vsimd_t v2v[NVCD];
52  clear_vec(v2v, NVCD);
53 
54  real_t zL[VLEN * NVCD];
55  real_t uL[VLEN * NDF];
56 
57  if (ix < Nxv - 1) {
58  real_t *u = &up[NDF * Nst * 0];
59  int nei = ix + 1 + Nxv * iyzt;
60  mult_wilson_xpb(pg1_xp, pg2_xp, v2v, &u[VLEN * NDF * site],
61  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
62  } else if (do_comm[0] == 0) { // ix = Nxv-1
63  real_t *u = &up[NDF * Nst * 0];
64  int nei = 0 + Nxv * iyzt;
65  mult_wilson_xpb(pg1_xp, pg2_xp, v2v, &u[VLEN * NDF * site],
66  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
67  }
68 
69  if (ix > 0) {
70  real_t *u = &up[NDF * Nst * 0];
71  int nei = ix - 1 + Nxv * iyzt;
72  mult_wilson_xmb(pg1_xm, pg2_xm, v2v,
73  &u[VLEN * NDF * site], &u[VLEN * NDF * nei],
74  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
75  } else if (do_comm[0] == 0) { // ix = 0
76  real_t *u = &up[NDF * Nst * 0];
77  int nei = Nxv - 1 + Nxv * iyzt;
78  mult_wilson_xmb(pg1_xm, pg2_xm, v2v,
79  &u[VLEN * NDF * site], &u[VLEN * NDF * nei],
80  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
81  }
82 
83  if (iy < Nyv - 1) {
84  int iy2 = (iy + 1) % Nyv;
85  int nei = ix + Nxv * (iy2 + Nyv * izt);
86  real_t *u = &up[NDF * Nst * 1];
87  mult_wilson_ypb(pg1_yp, pg2_yp, v2v,
88  &u[VLEN * NDF * site],
89  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
90  } else if (do_comm[1] == 0) { // iy = Nyv-1
91  int iy2 = (iy + 1) % Nyv;
92  int nei = ix + Nxv * (iy2 + Nyv * izt);
93  real_t *u = &up[NDF * Nst * 1];
94  mult_wilson_ypb(pg1_yp, pg2_yp, v2v,
95  &u[VLEN * NDF * site],
96  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
97  }
98 
99  if (iy > 0) {
100  int iy2 = (iy - 1 + Nyv) % Nyv;
101  int nei = ix + Nxv * (iy2 + Nyv * izt);
102  real_t *u = &up[NDF * Nst * 1];
103  mult_wilson_ymb(pg1_ym, pg2_ym, v2v,
104  &u[VLEN * NDF * site], &u[VLEN * NDF * nei],
105  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
106  } else if (do_comm[1] == 0) { // iy = 0
107  int iy2 = (iy - 1 + Nyv) % Nyv;
108  int nei = ix + Nxv * (iy2 + Nyv * izt);
109  real_t *u = &up[NDF * Nst * 1];
110  mult_wilson_ymb(pg1_ym, pg2_ym, v2v,
111  &u[VLEN * NDF * site], &u[VLEN * NDF * nei],
112  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
113  }
114 
115  if ((iz < Nz - 1) || (do_comm[2] == 0)) {
116  int iz2 = (iz + 1) % Nz;
117  int nei = ixy + Nxy * (iz2 + Nz * it);
118  real_t *u = &up[NDF * Nst * 2];
119  mult_wilson_zpb(v2v, &u[VLEN * NDF * site], &v1[VLEN * NVCD * nei]);
120  }
121 
122  if ((iz > 0) || (do_comm[2] == 0)) {
123  int iz2 = (iz - 1 + Nz) % Nz;
124  int nei = ixy + Nxy * (iz2 + Nz * it);
125  real_t *u = &up[NDF * Nst * 2];
126  mult_wilson_zmb(v2v, &u[VLEN * NDF * nei], &v1[VLEN * NVCD * nei]);
127  }
128 
129  if ((it < Nt - 1) || (do_comm[3] == 0)) {
130  int it2 = (it + 1) % Nt;
131  int nei = ixyz + Nxyz * it2;
132  real_t *u = &up[NDF * Nst * 3];
133  mult_wilson_tpb_dirac(v2v, &u[VLEN * NDF * site],
134  &v1[VLEN * NVCD * nei]);
135  }
136 
137  if ((it > 0) || (do_comm[3] == 0)) {
138  int it2 = (it - 1 + Nt) % Nt;
139  int nei = ixyz + Nxyz * it2;
140  real_t *u = &up[NDF * Nst * 3];
141  mult_wilson_tmb_dirac(v2v, &u[VLEN * NDF * nei],
142  &v1[VLEN * NVCD * nei]);
143  }
144 
145  mult_clover_csw_aypx(&v2[VLEN * NVCD * site], -kappa, &v2v[0],
146  &ct[VLEN * NDF * 2 * ND * site], &v1[VLEN * NVCD * site]);
147  }
148 }
149 
150 
151 //====================================================================
153  real_t *v2, real_t *up,
154  real_t *ct, real_t *v1,
155  real_t kappa, int *bc,
156  int *Nsize, int *do_comm)
157 {
158  int Nxv = Nsize[0];
159  int Nyv = Nsize[1];
160  int Nz = Nsize[2];
161  int Nt = Nsize[3];
162  int Nstv = Nxv * Nyv * Nz * Nt;
163  int Nst = Nstv * VLEN;
164 
165  svbool_t pg1_xp, pg2_xp, pg1_xm, pg2_xm;
166  svbool_t pg1_yp, pg2_yp, pg1_ym, pg2_ym;
167  set_predicate_xp(pg1_xp, pg2_xp);
168  set_predicate_xm(pg1_xm, pg2_xm);
169  set_predicate_yp(pg1_yp, pg2_yp);
170  set_predicate_ym(pg1_ym, pg2_ym);
171 
172  int Nxy = Nxv * Nyv;
173  int Nxyz = Nxv * Nyv * Nz;
174 
175  int ith, nth, is, ns;
176  set_threadtask(ith, nth, is, ns, Nstv);
177 
178  for (int site = is; site < ns; ++site) {
179  int ix = site % Nxv;
180  int iyzt = site / Nxv;
181  int iy = iyzt % Nyv;
182  int izt = site / Nxy;
183  int iz = izt % Nz;
184  int it = izt / Nz;
185  int ixy = ix + Nxv * iy;
186  int ixyz = ixy + Nxy * iz;
187 
188  Vsimd_t v2v[NVCD];
189  clear_vec(v2v, NVCD);
190 
191 
192  if (ix < Nxv - 1) {
193  real_t *u = &up[NDF * Nst * 0];
194  int nei = ix + 1 + Nxv * iyzt;
195  mult_wilson_xpb(pg1_xp, pg2_xp, &v2v[0].v[0], &u[VLEN * NDF * site],
196  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
197  } else if (do_comm[0] == 0) { // ix = Nxv-1
198  real_t *u = &up[NDF * Nst * 0];
199  int nei = 0 + Nxv * iyzt;
200  mult_wilson_xpb(pg1_xp, pg2_xp, v2v, &u[VLEN * NDF * site],
201  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
202  }
203 
204  if (ix > 0) {
205  real_t *u = &up[NDF * Nst * 0];
206  int nei = ix - 1 + Nxv * iyzt;
207  mult_wilson_xmb(pg1_xm, pg2_xm, v2v,
208  &u[VLEN * NDF * site], &u[VLEN * NDF * nei],
209  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
210  } else if (do_comm[0] == 0) { // ix = 0
211  real_t *u = &up[NDF * Nst * 0];
212  int nei = Nxv - 1 + Nxv * iyzt;
213  mult_wilson_xmb(pg1_xm, pg2_xm, v2v,
214  &u[VLEN * NDF * site], &u[VLEN * NDF * nei],
215  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
216  }
217 
218  if (iy < Nyv - 1) {
219  int iy2 = (iy + 1) % Nyv;
220  int nei = ix + Nxv * (iy2 + Nyv * izt);
221  real_t *u = &up[NDF * Nst * 1];
222  mult_wilson_ypb(pg1_yp, pg2_yp, v2v,
223  &u[VLEN * NDF * site],
224  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
225  } else if (do_comm[1] == 0) { // iy = Nyv-1
226  int iy2 = (iy + 1) % Nyv;
227  int nei = ix + Nxv * (iy2 + Nyv * izt);
228  real_t *u = &up[NDF * Nst * 1];
229  mult_wilson_ypb(pg1_yp, pg2_yp, v2v,
230  &u[VLEN * NDF * site],
231  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
232  }
233 
234  if (iy > 0) {
235  int iy2 = (iy - 1 + Nyv) % Nyv;
236  int nei = ix + Nxv * (iy2 + Nyv * izt);
237  real_t *u = &up[NDF * Nst * 1];
238  mult_wilson_ymb(pg1_ym, pg2_ym, v2v,
239  &u[VLEN * NDF * site], &u[VLEN * NDF * nei],
240  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
241  } else if (do_comm[1] == 0) { // iy = 0
242  int iy2 = (iy - 1 + Nyv) % Nyv;
243  int nei = ix + Nxv * (iy2 + Nyv * izt);
244  real_t *u = &up[NDF * Nst * 1];
245  mult_wilson_ymb(pg1_ym, pg2_ym, v2v,
246  &u[VLEN * NDF * site], &u[VLEN * NDF * nei],
247  &v1[VLEN * NVCD * site], &v1[VLEN * NVCD * nei]);
248  }
249 
250  if ((iz < Nz - 1) || (do_comm[2] == 0)) {
251  int iz2 = (iz + 1) % Nz;
252  int nei = ixy + Nxy * (iz2 + Nz * it);
253  real_t *u = &up[NDF * Nst * 2];
254  mult_wilson_zpb(v2v, &u[VLEN * NDF * site], &v1[VLEN * NVCD * nei]);
255  }
256 
257  if ((iz > 0) || (do_comm[2] == 0)) {
258  int iz2 = (iz - 1 + Nz) % Nz;
259  int nei = ixy + Nxy * (iz2 + Nz * it);
260  real_t *u = &up[NDF * Nst * 2];
261  mult_wilson_zmb(v2v, &u[VLEN * NDF * nei], &v1[VLEN * NVCD * nei]);
262  }
263 
264  if ((it < Nt - 1) || (do_comm[3] == 0)) {
265  int it2 = (it + 1) % Nt;
266  int nei = ixyz + Nxyz * it2;
267  real_t *u = &up[NDF * Nst * 3];
268  mult_wilson_tpb_dirac(v2v, &u[VLEN * NDF * site],
269  &v1[VLEN * NVCD * nei]);
270  }
271 
272  if ((it > 0) || (do_comm[3] == 0)) {
273  int it2 = (it - 1 + Nt) % Nt;
274  int nei = ixyz + Nxyz * it2;
275  real_t *u = &up[NDF * Nst * 3];
276  mult_wilson_tmb_dirac(v2v, &u[VLEN * NDF * nei],
277  &v1[VLEN * NVCD * nei]);
278  }
279 
280  mult_clover_csw_aypx_chrot(
281  &v2[VLEN * NVCD * site], -kappa, &v2v[0].v[0],
282  &ct[VLEN * NDF * 2 * ND * site], &v1[VLEN * NVCD * site]);
283  }
284 }
285 
286 
287 //====================================================================
289  real_t *ct, real_t *v1,
290  int *Nsize)
291 {
292  int Nxv = Nsize[0];
293  int Nyv = Nsize[1];
294  int Nz = Nsize[2];
295  int Nt = Nsize[3];
296  int Nstv = Nxv * Nyv * Nz * Nt;
297  int Nst = Nstv * VLEN;
298 
299  int ith, nth, is, ns;
300  set_threadtask(ith, nth, is, ns, Nstv);
301 
302  for (int site = is; site < ns; ++site) {
303  mult_cswinv_chrot(&v2[VLEN * NVCD * site],
304  &ct[VLEN * NDF * ND * site], &v1[VLEN * NVCD * site]);
305  }
306 }
307 
308 
309 //============================================================END=====
310 #endif
NVCD
#define NVCD
Definition: define_params_SU3.h:20
VLEN
#define VLEN
Definition: bridgeQXS_Clover_coarse_double.cpp:12
NDF
#define NDF
Definition: field_F_imp_SU2-inc.h:4
Vsimd_t
Definition: vsimd_double-inc.h:13
mult_common_th-inc.h
real_t
double real_t
Definition: bridgeQXS_Clover_coarse_double.cpp:16
BridgeQXS::mult_clover_bulk_dirac
void mult_clover_bulk_dirac(double *v2, double *up, double *ct, double *v1, double kappa, int *bc, int *Nsize, int *do_comm)
Definition: mult_Clover_qxs-inc.h:16
ND
#define ND
Definition: field_F_imp_SU2-inc.h:5
BridgeQXS::mult_clover_bulk_dirac_chrot
void mult_clover_bulk_dirac_chrot(double *v2, double *up, double *ct, double *v1, double kappa, int *bc, int *Nsize, int *do_comm)
Definition: mult_Clover_qxs-inc.h:152
svbool_t
Definition: vsimd_double-inc.h:30
BridgeQXS::mult_clover_cswinv_dirac_chrot
void mult_clover_cswinv_dirac_chrot(double *v2, double *ct, double *v1, int *Nsize)
Definition: mult_Clover_qxs-inc.h:288