Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Wilson_eo_impl.cpp
Go to the documentation of this file.
1 
14 #include "fopr_Wilson_eo_impl.h"
15 
16 #include "threadManager_OpenMP.h"
17 
18 using std::valarray;
19 
21  = "Fopr_Wilson_eo_impl";
22 
23 //====================================================================
24 void Fopr_Wilson_eo::Fopr_Wilson_eo_impl::init(const std::string repr)
25 {
26  m_repr = repr;
27 
29 
32  m_Nvc = 2 * m_Nc;
33  m_Ndf = 2 * m_Nc * m_Nc;
34  int Nvcd = m_Nvc * m_Nd;
35 
37  m_Nvol2 = m_Nvol / 2;
39 
44 
45  if ((m_Nx % 2) != 0) {
46  vout.crucial(m_vl, "%s: Nx must be even.\n", class_name.c_str());
47  abort();
48  }
49  m_Nx2 = m_Nx / 2;
50 
51  if ((m_Ny % 2) != 0) {
52  vout.crucial(m_vl, "%s: Ny must be even.\n", class_name.c_str());
53  abort();
54  }
55 
58  m_boundary.resize(m_Ndim);
59  m_boundary2.resize(m_Ndim);
60 
61  m_Leo.resize(m_Ny * m_Nz * m_Nt);
62 
63  for (int t = 0; t < m_Nt; ++t) {
64  for (int z = 0; z < m_Nz; ++z) {
65  for (int y = 0; y < m_Ny; ++y) {
66  int t2 = Communicator::ipe(3) * m_Nt + t;
67  int z2 = Communicator::ipe(2) * m_Nz + z;
68  int y2 = Communicator::ipe(1) * m_Ny + y;
69  m_Leo[y + m_Ny * (z + m_Nz * t)] = (y2 + z2 + t2) % 2;
70  }
71  }
72  }
73 
74  m_Ueo = new Field_G(m_Nvol, m_Ndim);
75 
76  if (m_repr == "Dirac") {
81  } else if (m_repr == "Chiral") {
86  } else {
87  vout.general(m_vl, "%s: input repr is undefined.\n",
88  class_name.c_str());
89  abort();
90  }
91 
92  int Nvx = m_Nvc * 2 * (m_Ny / 2) * m_Nz * m_Nt;
93  vcp1_xp = new double[Nvx];
94  vcp2_xp = new double[Nvx];
95  vcp1_xm = new double[Nvx];
96  vcp2_xm = new double[Nvx];
97 
98  int Nvy = m_Nvc * 2 * m_Nx2 * m_Nz * m_Nt;
99  vcp1_yp = new double[Nvy];
100  vcp2_yp = new double[Nvy];
101  vcp1_ym = new double[Nvy];
102  vcp2_ym = new double[Nvy];
103 
104  int Nvz = m_Nvc * 2 * m_Nx2 * m_Ny * m_Nt;
105  vcp1_zp = new double[Nvz];
106  vcp2_zp = new double[Nvz];
107  vcp1_zm = new double[Nvz];
108  vcp2_zm = new double[Nvz];
109 
110  int Nvt = m_Nvc * 2 * m_Nx2 * m_Ny * m_Nz;
111  vcp1_tp = new double[Nvt];
112  vcp2_tp = new double[Nvt];
113  vcp1_tm = new double[Nvt];
114  vcp2_tm = new double[Nvt];
115 
116  m_v1.reset(Nvcd, m_Nvol2, 1);
117  m_v2.reset(Nvcd, m_Nvol2, 1);
118  m_w1.reset(Nvcd, m_Nvol2, 1);
119  m_w2.reset(Nvcd, m_Nvol2, 1);
120 
121  setup_thread();
122 }
123 
124 //====================================================================
126 {
127  delete m_Ueo;
128 
129  delete[] vcp1_xp;
130  delete[] vcp2_xp;
131  delete[] vcp1_xm;
132  delete[] vcp2_xm;
133 
134  delete[] vcp1_yp;
135  delete[] vcp2_yp;
136  delete[] vcp1_ym;
137  delete[] vcp2_ym;
138 
139  delete[] vcp1_zp;
140  delete[] vcp2_zp;
141  delete[] vcp1_zm;
142  delete[] vcp2_zm;
143 
144  delete[] vcp1_tp;
145  delete[] vcp2_tp;
146  delete[] vcp1_tm;
147  delete[] vcp2_tm;
148 }
149 
150 //====================================================================
152  const double kappa,
153  const std::valarray<int> bc)
154 {
155  //- print input parameters
156  vout.general(m_vl, "Parameters of Fopr_Wilson_eo(impl):\n");
157  vout.general(m_vl, " kappa = %8.4f\n", kappa);
158  for (int mu = 0; mu < m_Ndim; ++mu) {
159  vout.general(m_vl, " boundary[%d] = %2d\n", mu, bc[mu]);
160  }
161 
162  //- range check
163  // NB. kappa = 0 is allowed.
164  assert(bc.size() == m_Ndim);
165 
166  //- store values
167  m_kappa = kappa;
168 
169  // m_boundary.resize(m_Ndim); // already resized in init.
170  for (int mu = 0; mu < m_Ndim; ++mu) {
171  m_boundary[mu] = bc[mu];
172  }
173 
174  // boundary condition for each node:
175  for (int idir = 0; idir < m_Ndim; ++idir) {
176  m_boundary2[idir] = 1.0;
177  if (Communicator::ipe(idir) == 0) m_boundary2[idir] = m_boundary[idir];
178  }
179 
180 }
181 
182 //====================================================================
184 {
185  m_index.convertField(*m_Ueo, *U);
186  m_U = m_Ueo;
187 }
188 
189 //====================================================================
191 {
192  // The following counting explicitly depends on the implementation.
193  // It will be recalculated when the code is modified.
194  // The present counting is based on rev.1107. [24 Aug 2014 H.Matsufuru]
195 
196  int Lvol = CommonParameters::Lvol();
197  double flop_site, flop;
198 
199  if (m_repr == "Dirac") {
200  flop_site = static_cast<double>(
201  m_Nc * m_Nd * (6 * (4 * m_Nc + 2) + 2 * (4 * m_Nc + 1)));
202  } else if (m_repr == "Chiral") {
203  flop_site = static_cast<double>(
204  m_Nc * m_Nd * 8 * (4 * m_Nc + 2));
205  } else {
206  vout.crucial(m_vl, "%s: input repr is undefined.\n",
207  class_name.c_str());
208  abort();
209  }
210 
211  flop = flop_site * static_cast<double>(Lvol / 2);
212 
213  return flop;
214 }
215 
216 //====================================================================
218  const Field& b)
219 {
220  int Nin = b.nin();
221  int Nex = b.nex();
222 
223  Field be(Nin, m_Nvol2, Nex);
224 
225  m_index.convertField(be, b, 0);
226  m_index.convertField(bo, b, 1);
227 
228  Be.reset(Nin, m_Nvol2, Nex);
229 
230  // Be = be - (Field)Meo(bo, 0);
231  Field_F v1(m_Nvol2, Nex);
232  copy(Be, be);
233  Meo(v1, bo, 0);
234  axpy(Be, -1.0, v1);
235 }
236 
237 //====================================================================
239  const Field& xe, const Field& bo)
240 {
241  int Nin = xe.nin();
242  int Nex = xe.nex();
243 
244  Field xo(Nin, m_Nvol2, Nex);
245 
246  // xo = bo - (Field)Meo(xe, 1);
247  Field_F v1(m_Nvol2, Nex);
248 
249  copy(xo, bo);
250  Meo(v1, xe, 1);
251  axpy(xo, -1.0, v1);
252 
253  x.reset(Nin, m_Nvol2 * 2, Nex);
254  m_index.reverseField(x, xe, 0);
255  m_index.reverseField(x, xo, 1);
256 }
257 
258 //====================================================================
260  Field& bo, const Field& b)
261 {
262  int Nin = b.nin();
263  int Nex = b.nex();
264 
265  Field be(Nin, m_Nvol2, Nex);
266 
267  m_index.convertField(be, b, 0);
268  m_index.convertField(bo, b, 1);
269 
270  Be.reset(Nin, m_Nvol2, Nex);
271 
272  // Be = be - (Field)Mdageo(bo, 0);
273  Field_F v1(m_Nvol2, Nex);
274  copy(Be, be);
275  Mdageo(v1, bo, 0);
276  axpy(Be, -1.0, v1);
277 }
278 
279 //====================================================================
281  const Field& xe, const Field& bo)
282 {
283  int Nin = xe.nin();
284  int Nex = xe.nex();
285 
286  Field xo(Nin, m_Nvol2, Nex);
287 
288  // xo = bo - (Field)Mdageo(xe, 1);
289  Field_F v1(m_Nvol2, Nex);
290 
291  copy(xo, bo);
292  Mdageo(v1, xe, 1);
293  axpy(xo, -1.0, v1);
294 
295  x.reset(Nin, m_Nvol2 * 2, Nex);
296  m_index.reverseField(x, xe, 0);
297  m_index.reverseField(x, xo, 1);
298 }
299 
300 //====================================================================
302 {
303  D(m_w1, f);
304  Ddag(v, m_w1);
305 }
306 
307 //====================================================================
309 {
310  Ddag(m_w1, f);
311  D(v, m_w1);
312 }
313 
314 //====================================================================
316 {
317  D(v, f);
318  mult_gm5(v);
319 #pragma omp barrier
320 }
321 
322 //====================================================================
324 {
325  Meo(m_w1, f, 1);
326  Meo(m_w2, m_w1, 0);
327  axpy(v, -1.0, m_w2);
328 #pragma omp barrier
329 }
330 
331 //====================================================================
333 {
334  assert(f.nex() == 1);
335 
336  Meo(m_v1, f, 1);
337  Meo(v, m_v1, 0);
338  aypx(-1.0, v, f);
339 #pragma omp barrier
340 }
341 
342 //====================================================================
344 {
345  Mdageo(m_v1, f, 1);
346  Mdageo(v, m_v1, 0);
347  aypx(-1.0, v, f);
348 #pragma omp barrier
349 }
350 
351 //====================================================================
353  const Field& f, const int ieo)
354 {
355 #pragma omp barrier
356 
357  // clear_impl(w); // w = 0.0;
358  w.set(0.0); // w = 0.0;
359 
360  // for (int mu = 0; mu < m_Ndim; ++mu) {
361  // mult_p(mu, w, f, ieo);
362  // mult_m(mu, w, f, ieo);
363  // }
364 
365  mult_xp(w, f, ieo);
366  mult_xm(w, f, ieo);
367 
368  mult_yp(w, f, ieo);
369  mult_ym(w, f, ieo);
370 
371  mult_zp(w, f, ieo);
372  mult_zm(w, f, ieo);
373 
374  (this->*m_mult_tp)(w, f, ieo);
375  (this->*m_mult_tm)(w, f, ieo);
376 
377  scal(w, -m_kappa); // w *= -m_kappa; using Field function.
378  // scal_impl(w, -m_kappa); // w *= -m_kappa;
379 
381 }
382 
383 //====================================================================
385  const Field& f, const int ieo)
386 {
387  // Field_F v(m_Nvol2, f.nex());
388  // mult_gm5(v, (Field)f);
389  // Meo_gm5(w, v, ieo);
390 
391  mult_gm5(m_v2, f);
392  Meo(w, m_v2, ieo);
393  mult_gm5(w);
394 }
395 
396 //====================================================================
398  const Field& f, const int ieo)
399 {
400  Meo(v, f, ieo);
401  mult_gm5(v);
402 }
403 
404 //====================================================================
406 {
407  (this->*m_gm5)(w, f);
408 }
409 
410 //====================================================================
412 {
413  (this->*m_gm5_self)(w);
414 }
415 
416 //====================================================================
418  const Field& f)
419 {
420  double *v1 = const_cast<Field *>(&f)->ptr(0);
421  double *v2 = w.ptr(0);
422 
425 
426  int is = m_Ntask * ith / nth;
427  int ns = m_Ntask * (ith + 1) / nth - is;
428 
429  for (int i = is; i < is + ns; ++i) {
430  gm5_dirac_thread(i, v2, v1);
431  }
432 
433 }
434 
435 //====================================================================
437  const Field& f)
438 {
439  double *v1 = const_cast<Field *>(&f)->ptr(0);
440  double *v2 = w.ptr(0);
441 
444 
445  int is = m_Ntask * ith / nth;
446  int ns = m_Ntask * (ith + 1) / nth - is;
447 
448  for (int i = is; i < is + ns; ++i) {
449  gm5_chiral_thread(i, v2, v1);
450  }
451 
452 }
453 
454 //====================================================================
456 {
457  double *wp = w.ptr(0);
458 
461 
462  int is = m_Ntask * ith / nth;
463  int ns = m_Ntask * (ith + 1) / nth - is;
464 
465  for (int i = is; i < is + ns; ++i) {
466  gm5_dirac_thread(i, wp);
467  }
468 
469 }
470 
471 //====================================================================
473 {
474  double *wp = w.ptr(0);
475 
478 
479  int is = m_Ntask * ith / nth;
480  int ns = m_Ntask * (ith + 1) / nth - is;
481 
482  for (int i = is; i < is + ns; ++i) {
483  gm5_chiral_thread(i, wp);
484  }
485 
486 }
487 
488 //====================================================================
490  const Field& f)
491 {
492  // this function is probably not to be used.
493  // determines \gamma_5 * (1 - \gamma_\mu) v(x+\hat{x})
494  abort();
495 }
496 
497 //====================================================================
499  Field_F& w, const Field_F& f,
500  const int ieo)
501 {
502  if (mu == 0) {
503  mult_xp(w, f, ieo);
504  } else if (mu == 1) {
505  mult_yp(w, f, ieo);
506  } else if (mu == 2) {
507  mult_zp(w, f, ieo);
508  } else if (mu == 3) {
509  mult_tp_dirac(w, f, ieo);
510  } else {
511  vout.crucial(m_vl, "%s: illegal value of mu: %d",
512  class_name.c_str(), mu);
513  abort();
514  }
515 
516 }
517 
518 //=====================================================================
520  Field_F& w, const Field_F& f,
521  const int ieo)
522 {
523  if (mu == 0) {
524  mult_xm(w, f, ieo);
525  } else if (mu == 1) {
526  mult_ym(w, f, ieo);
527  } else if (mu == 2) {
528  mult_zm(w, f, ieo);
529  } else if (mu == 3) {
530  mult_tm_dirac(w, f, ieo);
531  } else {
532  vout.crucial(m_vl, "%s: illegal value of mu: %d",
533  class_name.c_str(), mu);
534  abort();
535  }
536 
537 }
538 
539 //====================================================================
541 {
542  double *wp = w.ptr(0);
543 
546 
547  int is = m_Ntask * ith / nth;
548  int ns = m_Ntask * (ith + 1) / nth - is;
549 
550  for (int i = is; i < is + ns; ++i) {
551  clear_thread(i, wp);
552  }
553 
554 }
555 
556 //====================================================================
558 {
559  double *wp = w.ptr(0);
560 
563 
564  int is = m_Ntask * ith / nth;
565  int ns = m_Ntask * (ith + 1) / nth - is;
566 
567  for (int i = is; i < is + ns; ++i) {
568  scal_thread(i, wp, a);
569  }
570 
571 }
572 
573 //====================================================================
575  const Field& f, const int ieo)
576 {
577  double *v1 = const_cast<Field *>(&f)->ptr(0);
578  double *v2 = w.ptr(0);
579 
582 
583  int is = m_Ntask * ith / nth;
584  int ns = m_Ntask * (ith + 1) / nth - is;
585 
586  for (int i = is; i < is + ns; ++i) {
587  mult_xp1_thread(i, vcp1_xp, v1, ieo);
588  }
589  #pragma omp barrier
590 
591  #pragma omp master
592  {
593  int Nv = m_Nvc * 2 * (m_Ny / 2) * m_Nz * m_Nt;
594  Communicator::exchange(Nv, vcp2_xp, vcp1_xp, 0, 1, 1);
595  }
596  #pragma omp barrier
597 
598  for (int i = is; i < is + ns; ++i) {
599  mult_xpb_thread(i, v2, v1, ieo);
600  }
601 
602  for (int i = is; i < is + ns; ++i) {
603  mult_xp2_thread(i, v2, vcp2_xp, ieo);
604  }
605 
606 }
607 
608 //====================================================================
610  const Field& f, const int ieo)
611 {
612  double *v2 = w.ptr(0);
613  double *v1 = const_cast<Field *>(&f)->ptr(0);
614 
617 
618  int is = m_Ntask * ith / nth;
619  int ns = m_Ntask * (ith + 1) / nth - is;
620 
621  for (int i = is; i < is + ns; ++i) {
622  mult_xm1_thread(i, vcp1_xm, v1, ieo);
623  }
624  #pragma omp barrier
625 
626  #pragma omp master
627  {
628  int Nv = m_Nvc * 2 * (m_Ny / 2) * m_Nz * m_Nt;
629  Communicator::exchange(Nv, vcp2_xm, vcp1_xm, 0, -1, 2);
630  }
631  #pragma omp barrier
632 
633  for (int i = is; i < is + ns; ++i) {
634  mult_xmb_thread(i, v2, v1, ieo);
635  }
636 
637  for (int i = is; i < is + ns; ++i) {
638  mult_xm2_thread(i, v2, vcp2_xm, ieo);
639  }
640 
641 }
642 
643 //====================================================================
645  const Field& f, const int ieo)
646 {
647  double *v1 = const_cast<Field *>(&f)->ptr(0);
648  double *v2 = w.ptr(0);
649 
652 
653  int is = m_Ntask * ith / nth;
654  int ns = m_Ntask * (ith + 1) / nth - is;
655 
656  for (int i = is; i < is + ns; ++i) {
657  mult_yp1_thread(i, vcp1_yp, v1, ieo);
658  }
659  #pragma omp barrier
660 
661  #pragma omp master
662  {
663  int Nv = m_Nvc * 2 * m_Nx2 * m_Nz * m_Nt;
664  Communicator::exchange(Nv, vcp2_yp, vcp1_yp, 1, 1, 3);
665  }
666  #pragma omp barrier
667 
668  for (int i = is; i < is + ns; ++i) {
669  mult_ypb_thread(i, v2, v1, ieo);
670  }
671 
672  for (int i = is; i < is + ns; ++i) {
673  mult_yp2_thread(i, v2, vcp2_yp, ieo);
674  }
675 
676 }
677 
678 //====================================================================
680  const Field& f, const int ieo)
681 {
682  double *v2 = w.ptr(0);
683  double *v1 = const_cast<Field *>(&f)->ptr(0);
684 
687 
688  int is = m_Ntask * ith / nth;
689  int ns = m_Ntask * (ith + 1) / nth - is;
690 
691  for (int i = is; i < is + ns; ++i) {
692  mult_ym1_thread(i, vcp1_ym, v1, ieo);
693  }
694  #pragma omp barrier
695 
696  #pragma omp master
697  {
698  int Nv = m_Nvc * 2 * m_Nx2 * m_Nz * m_Nt;
699  Communicator::exchange(Nv, vcp2_ym, vcp1_ym, 1, -1, 4);
700  }
701  #pragma omp barrier
702 
703  for (int i = is; i < is + ns; ++i) {
704  mult_ymb_thread(i, v2, v1, ieo);
705  }
706 
707  for (int i = is; i < is + ns; ++i) {
708  mult_ym2_thread(i, v2, vcp2_ym, ieo);
709  }
710 
711 }
712 
713 //====================================================================
715  const Field& f, const int ieo)
716 {
717  double *v1 = const_cast<Field *>(&f)->ptr(0);
718  double *v2 = w.ptr(0);
719 
722 
723  int is = m_Ntask * ith / nth;
724  int ns = m_Ntask * (ith + 1) / nth - is;
725 
726  for (int i = is; i < is + ns; ++i) {
727  mult_zp1_thread(i, vcp1_zp, v1, ieo);
728  }
729  #pragma omp barrier
730 
731  #pragma omp master
732  {
733  int Nv = m_Nvc * 2 * m_Nx2 * m_Ny * m_Nt;
734  Communicator::exchange(Nv, vcp2_zp, vcp1_zp, 2, 1, 5);
735  }
736  #pragma omp barrier
737 
738  for (int i = is; i < is + ns; ++i) {
739  mult_zpb_thread(i, v2, v1, ieo);
740  }
741 
742  for (int i = is; i < is + ns; ++i) {
743  mult_zp2_thread(i, v2, vcp2_zp, ieo);
744  }
745 
746 }
747 
748 //====================================================================
750  const Field& f, const int ieo)
751 {
752  double *v2 = w.ptr(0);
753  double *v1 = const_cast<Field *>(&f)->ptr(0);
754 
757 
758  int is = m_Ntask * ith / nth;
759  int ns = m_Ntask * (ith + 1) / nth - is;
760 
761  for (int i = is; i < is + ns; ++i) {
762  mult_zm1_thread(i, vcp1_zm, v1, ieo);
763  }
764  #pragma omp barrier
765 
766  #pragma omp master
767  {
768  int Nv = m_Nvc * 2 * m_Nx2 * m_Ny * m_Nt;
769  Communicator::exchange(Nv, vcp2_zm, vcp1_zm, 2, -1, 6);
770  }
771  #pragma omp barrier
772 
773  for (int i = is; i < is + ns; ++i) {
774  mult_zmb_thread(i, v2, v1, ieo);
775  }
776 
777  for (int i = is; i < is + ns; ++i) {
778  mult_zm2_thread(i, v2, vcp2_zm, ieo);
779  }
780 
781 }
782 
783 //====================================================================
785  const Field& f, const int ieo)
786 {
787  double *v1 = const_cast<Field *>(&f)->ptr(0);
788  double *v2 = w.ptr(0);
789 
792 
793  int is = m_Ntask * ith / nth;
794  int ns = m_Ntask * (ith + 1) / nth - is;
795 
796  for (int i = is; i < is + ns; ++i) {
797  mult_tp1_dirac_thread(i, vcp1_tp, v1, ieo);
798  }
799  #pragma omp barrier
800 
801  #pragma omp master
802  {
803  int Nv = m_Nvc * 2 * m_Nx2 * m_Ny * m_Nz;
804  Communicator::exchange(Nv, vcp2_tp, vcp1_tp, 3, 1, 7);
805  }
806  #pragma omp barrier
807 
808  for (int i = is; i < is + ns; ++i) {
809  mult_tpb_dirac_thread(i, v2, v1, ieo);
810  }
811 
812  for (int i = is; i < is + ns; ++i) {
813  mult_tp2_dirac_thread(i, v2, vcp2_tp, ieo);
814  }
815 
816 }
817 
818 //====================================================================
820  const Field& f, const int ieo)
821 {
822  double *v2 = w.ptr(0);
823  double *v1 = const_cast<Field *>(&f)->ptr(0);
824 
827 
828  int is = m_Ntask * ith / nth;
829  int ns = m_Ntask * (ith + 1) / nth - is;
830 
831  for (int i = is; i < is + ns; ++i) {
832  mult_tm1_dirac_thread(i, vcp1_tm, v1, ieo);
833  }
834  #pragma omp barrier
835 
836  #pragma omp master
837  {
838  int Nv = m_Nvc * 2 * m_Nx2 * m_Ny * m_Nz;
839  Communicator::exchange(Nv, vcp2_tm, vcp1_tm, 3, -1, 8);
840  }
841  #pragma omp barrier
842 
843  for (int i = is; i < is + ns; ++i) {
844  mult_tmb_dirac_thread(i, v2, v1, ieo);
845  }
846 
847  for (int i = is; i < is + ns; ++i) {
848  mult_tm2_dirac_thread(i, v2, vcp2_tm, ieo);
849  }
850 
851 }
852 
853 //====================================================================
855  const Field& f, const int ieo)
856 {
857  double *v1 = const_cast<Field *>(&f)->ptr(0);
858  double *v2 = w.ptr(0);
859 
862 
863  int is = m_Ntask * ith / nth;
864  int ns = m_Ntask * (ith + 1) / nth - is;
865 
866  for (int i = is; i < is + ns; ++i) {
867  mult_tp1_chiral_thread(i, vcp1_tp, v1, ieo);
868  }
869  #pragma omp barrier
870 
871  #pragma omp master
872  {
873  int Nv = m_Nvc * 2 * m_Nx2 * m_Ny * m_Nz;
874  Communicator::exchange(Nv, vcp2_tp, vcp1_tp, 3, 1, 7);
875  }
876  #pragma omp barrier
877 
878  for (int i = is; i < is + ns; ++i) {
879  mult_tpb_chiral_thread(i, v2, v1, ieo);
880  }
881 
882  for (int i = is; i < is + ns; ++i) {
883  mult_tp2_chiral_thread(i, v2, vcp2_tp, ieo);
884  }
885 
886 }
887 
888 //====================================================================
890  const Field& f, const int ieo)
891 {
892  double *v2 = w.ptr(0);
893  double *v1 = const_cast<Field *>(&f)->ptr(0);
894 
897 
898  int is = m_Ntask * ith / nth;
899  int ns = m_Ntask * (ith + 1) / nth - is;
900 
901  for (int i = is; i < is + ns; ++i) {
902  mult_tm1_chiral_thread(i, vcp1_tm, v1, ieo);
903  }
904  #pragma omp barrier
905 
906  #pragma omp master
907  {
908  int Nv = m_Nvc * 2 * m_Nx2 * m_Ny * m_Nz;
909  Communicator::exchange(Nv, vcp2_tm, vcp1_tm, 3, -1, 8);
910  }
911  #pragma omp barrier
912 
913  for (int i = is; i < is + ns; ++i) {
914  mult_tmb_chiral_thread(i, v2, v1, ieo);
915  }
916 
917  for (int i = is; i < is + ns; ++i) {
918  mult_tm2_chiral_thread(i, v2, vcp2_tm, ieo);
919  }
920 
921 }
922 
923 //====================================================================
924 //============================================================END=====
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:310
const Field_F Meo(const Field_F &, const int ieo)
void prePropD(Field &, Field &, const Field &)
void mult_xp(Field &, const Field &, const int ieo)
void mult_tp_chiral(Field &, const Field &, const int ieo)
BridgeIO vout
Definition: bridgeIO.cpp:207
void prePropDag(Field &, Field &, const Field &)
static int get_num_threads()
returns available number of threads.
void(Fopr_Wilson_eo::Fopr_Wilson_eo_impl::* m_mult_tp)(Field &, const Field &, const int ieo)
void MeoMoe(Field &, const Field &)
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:128
Index_eo m_index
void mult_gm5(Field &v, const Field &f)
const Field_F Mdageo(const Field_F &, const int ieo)
void mult_tp_dirac(Field &, const Field &, const int ieo)
void D(Field &v, const Field &f)
void mult_xm(Field &, const Field &, const int ieo)
void general(const char *format,...)
Definition: bridgeIO.cpp:38
Field_G * m_Ueo
void Meo_gm5(Field &, const Field &, const int ieo)
static Bridge::VerboseLevel Vlevel()
void set_parameters(const double kappa, const std::valarray< int > bc)
double * ptr(const int jin, const int site, const int jex)
Definition: field.h:118
Container of Field-type object.
Definition: field.h:37
void DdagD(Field &v, const Field &f)
void gm5_chiral(Field &, const Field &)
void mult_zm(Field &, const Field &, const int ieo)
void gm5_dirac(Field &, const Field &)
static int ipe(const int dir)
logical coordinate of current proc.
void(Fopr_Wilson_eo::Fopr_Wilson_eo_impl::* m_mult_tm)(Field &, const Field &, const int ieo)
void copy(Field &y, const Field &x)
copy(y, x): y = x
Definition: field.cpp:409
double * vcp1_xp
arrays for data transfer.
static int Lvol()
void convertField(Field &eo, const Field &lex)
Definition: index_eo.cpp:20
void mult_gm5(Field &, const Field &)
void postPropDag(Field &, const Field &, const Field &)
static int get_thread_id()
returns thread id.
Wilson-type fermion field.
Definition: field_F.h:37
void mult_tm_dirac(Field &, const Field &, const int ieo)
int nin() const
Definition: field.h:100
void Meo(Field &, const Field &, const int ieo)
void(Fopr_Wilson_eo::Fopr_Wilson_eo_impl::* m_gm5_self)(Field &)
void postPropD(Field &, const Field &, const Field &)
SU(N) gauge field.
Definition: field_G.h:36
std::string m_repr
void DDdag(Field &v, const Field &f)
Bridge::VerboseLevel m_vl
Definition: fopr.h:99
void Ddag(Field &v, const Field &f)
void(Fopr_Wilson_eo::* m_gm5)(Field &, const Field &)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
Definition: field.h:82
static void sync_barrier_all()
barrier among all the threads and nodes.
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
Definition: field.cpp:489
void Mdageo(Field &, const Field &, const int ieo)
static int exchange(int count, double *recv_buf, double *send_buf, int idir, int ipm, int tag)
receive array of double from upstream specified by idir and ipm, and send array to downstream...
void(Fopr_Wilson_eo::Fopr_Wilson_eo_impl::* m_gm5)(Field &, const Field &)
int nex() const
Definition: field.h:102
void mult_zp(Field &, const Field &, const int ieo)
void mult_tm_chiral(Field &, const Field &, const int ieo)
void mult_ym(Field &, const Field &, const int ieo)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:193
void crucial(const char *format,...)
Definition: bridgeIO.cpp:26
void H(Field &v, const Field &f)
void D(Field &v, const Field &f)
std::valarray< double > m_boundary2
b.c. for each node.
void reverseField(Field &lex, const Field &eo)
Definition: index_eo.cpp:110
std::valarray< int > m_boundary
boundary condition.
void Ddag(Field &v, const Field &f)
void mult_yp(Field &, const Field &, const int ieo)
void mult_m(int mu, Field_F &, const Field_F &, const int ieo)
double flop_count()
this returns the number of floating point operations of Meo.
static const std::string class_name
void mult_p(int mu, Field_F &, const Field_F &, const int ieo)
std::string m_repr
Dirac matrix representation.
void gm5p(const int mu, Field &, const Field &v)
gamma_5 (1 - gamma_mu) v(x + mu) used in force calculation.
std::valarray< int > m_boundary