Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Wilson_impl.cpp
Go to the documentation of this file.
1 
14 #include <valarray>
15 using std::valarray;
16 #include <string>
17 using std::string;
18 
19 #include "fopr_Wilson_impl.h"
20 
21 #include "gammaMatrixSet_Dirac.h"
22 #include "gammaMatrixSet_Chiral.h"
23 
24 #include "bridgeIO.h"
25 using Bridge::vout;
26 
27 #include "threadManager_OpenMP.h"
28 
29 //#define USE_SU2
30 
31 #if defined USE_GROUP_SU3
32 #include "fopr_Wilson_impl_SU3.inc"
33 #elif defined USE_GROUP_SU2
34 #include "fopr_Wilson_impl_SU2.inc"
35 #elif defined USE_GROUP_SU_N
36 #include "fopr_Wilson_impl_SU_N.inc"
37 #endif
38 
39 const std::string Fopr_Wilson::Fopr_Wilson_impl::class_name = "Fopr_Wilson_impl";
40 //====================================================================
42 {
44 
45  vout.general(m_vl, "Fopr_Wilson: Construction of Wilson fermion operator(imp).\n");
46 
47  check_Nc();
48 
51  m_Nvc = 2 * m_Nc;
52  m_Ndf = 2 * m_Nc * m_Nc;
53 
58 
61  m_boundary.resize(m_Ndim);
62  m_boundary2.resize(m_Ndim);
63 
64  m_repr = repr;
65 
66  m_GM.resize(m_Ndim + 1);
67 
68  GammaMatrixSet *gmset;
69 
70  if (m_repr == "Dirac") {
71  gmset = new GammaMatrixSet_Dirac();
72  } else if (m_repr == "Chiral") {
73  gmset = new GammaMatrixSet_Chiral();
74  } else {
75  vout.crucial(m_vl, "Fopr_Wilson: input repr is undefined.\n");
76  abort();
77  }
78 
79  m_GM[0] = gmset->get_GM(GammaMatrixSet::GAMMA1);
80  m_GM[1] = gmset->get_GM(GammaMatrixSet::GAMMA2);
81  m_GM[2] = gmset->get_GM(GammaMatrixSet::GAMMA3);
82  m_GM[3] = gmset->get_GM(GammaMatrixSet::GAMMA4);
83  m_GM[4] = gmset->get_GM(GammaMatrixSet::GAMMA5);
84 
85  delete gmset;
86 
87  m_U = 0;
88 
91 
92  if (m_repr == "Dirac") {
98  } else if (m_repr == "Chiral") {
104  } else {
105  vout.general(m_vl, "Fopr_Wilson: input repr is undefined.\n");
106  abort();
107  }
108 
109  m_w1.reset(m_Nvc * m_Nd, m_Nvol, 1);
110  m_w2.reset(m_Nvc * m_Nd, m_Nvol, 1);
111 
112  int Nvx = m_Nvc * 2 * m_Ny * m_Nz * m_Nt;
113  vcp1_xp = new double[Nvx];
114  vcp2_xp = new double[Nvx];
115  vcp1_xm = new double[Nvx];
116  vcp2_xm = new double[Nvx];
117 
118  int Nvy = m_Nvc * 2 * m_Nx * m_Nz * m_Nt;
119  vcp1_yp = new double[Nvy];
120  vcp2_yp = new double[Nvy];
121  vcp1_ym = new double[Nvy];
122  vcp2_ym = new double[Nvy];
123 
124  int Nvz = m_Nvc * 2 * m_Nx * m_Ny * m_Nt;
125  vcp1_zp = new double[Nvz];
126  vcp2_zp = new double[Nvz];
127  vcp1_zm = new double[Nvz];
128  vcp2_zm = new double[Nvz];
129 
130  int Nvt = m_Nvc * 2 * m_Nx * m_Ny * m_Nz;
131  vcp1_tp = new double[Nvt];
132  vcp2_tp = new double[Nvt];
133  vcp1_tm = new double[Nvt];
134  vcp2_tm = new double[Nvt];
135 
136 
137  // preparation for non-blocking communication
138  // along the course of T.Aoyama
139 
140  int buf_size[m_Ndim];
141  buf_size[0] = sizeof(double) * m_Nvc * 2 * m_Ny * m_Nz * m_Nt;
142  buf_size[1] = sizeof(double) * m_Nvc * 2 * m_Nx * m_Nz * m_Nt;
143  buf_size[2] = sizeof(double) * m_Nvc * 2 * m_Nx * m_Ny * m_Nt;
144  buf_size[3] = sizeof(double) * m_Nvc * 2 * m_Nx * m_Ny * m_Nz;
145 
146  m_fw_send.resize(m_Ndim);
147  m_fw_recv.resize(m_Ndim);
148  m_bw_send.resize(m_Ndim);
149  m_bw_recv.resize(m_Ndim);
150 
151  m_npe.resize(m_Ndim);
156 
157  vout.crucial(m_vl, "communication setup start.\n");
159 
160  for (int imu = 0; imu < m_Ndim; ++imu) {
161  // forward
162  m_fw_send[imu] = Communicator::send_init(buf_size[imu], imu, +1);
163  m_fw_recv[imu] = Communicator::recv_init(buf_size[imu], imu, -1);
164 
165  // backward
166  m_bw_send[imu] = Communicator::send_init(buf_size[imu], imu, -1);
167  m_bw_recv[imu] = Communicator::recv_init(buf_size[imu], imu, +1);
168 
169  vout.paranoiac(m_vl, "pointer to m_fw_send[%d] = %x.\n",
170  imu, m_fw_send[imu]->ptr());
171  vout.paranoiac(m_vl, "pointer to m_fw_recv[%d] = %x.\n",
172  imu, m_fw_recv[imu]->ptr());
173  vout.paranoiac(m_vl, "pointer to m_bw_send[%d] = %x.\n",
174  imu, m_bw_send[imu]->ptr());
175  vout.paranoiac(m_vl, "pointer to m_bw_recv[%d] = %x.\n",
176  imu, m_bw_recv[imu]->ptr());
177  }
178  vout.crucial(m_vl, "communication setup end.\n");
179 
180  // setup for threading
181  setup_thread();
182 }
183 
184 //====================================================================
185 void Fopr_Wilson::Fopr_Wilson_impl::set_mode(std::string mode)
186 {
187  m_mode = mode;
188 
189  vout.detailed(m_vl, "%s: mode is set to %s.\n",
190  class_name.c_str(), m_mode.c_str());
191 
192  if (m_mode == "D") {
195  } else if (m_mode == "Ddag") {
197  m_mult_dag = &Fopr_Wilson::Fopr_Wilson_impl::D;
198  } else if (m_mode == "DdagD") {
201  } else if (m_mode == "DDdag") {
204  } else if (m_mode == "H") {
206  m_mult_dag = &Fopr_Wilson::Fopr_Wilson_impl::H;
207  } else {
208  vout.crucial(m_vl, "Fopr_Wilson: input mode is undefined in Fopr_Wilson.\n");
209  abort();
210  }
211 
212 }
213 
214 //====================================================================
216 {
217  delete[] vcp1_xp;
218  delete[] vcp2_xp;
219  delete[] vcp1_xm;
220  delete[] vcp2_xm;
221 
222  delete[] vcp1_yp;
223  delete[] vcp2_yp;
224  delete[] vcp1_ym;
225  delete[] vcp2_ym;
226 
227  delete[] vcp1_zp;
228  delete[] vcp2_zp;
229  delete[] vcp1_zm;
230  delete[] vcp2_zm;
231 
232  delete[] vcp1_tp;
233  delete[] vcp2_tp;
234  delete[] vcp1_tm;
235  delete[] vcp2_tm;
236 }
237 
238 //====================================================================
239 std::string Fopr_Wilson::Fopr_Wilson_impl::get_mode() const
240 {
241  return m_mode;
242 }
243 
244 //====================================================================
245 void Fopr_Wilson::Fopr_Wilson_impl::set_parameters(const double kappa,
246  const valarray<int> bc)
247 {
248  assert(bc.size() == m_Ndim);
249 
250  m_kappa = kappa;
251 
252  for (int mu = 0; mu < m_Ndim; ++mu) {
253  m_boundary[mu] = bc[mu];
254  }
255 
256  vout.general(m_vl, "Parameters of Fopr_Wilson_impl:\n");
257  vout.general(m_vl, " kappa = %8.4f\n", m_kappa);
258  for (int mu = 0; mu < m_Ndim; ++mu) {
259  vout.general(m_vl, " boundary[%d] = %2d\n", mu, m_boundary[mu]);
260  }
261 
262  // boundary condition for each node:
263  for (int idir = 0; idir < m_Ndim; ++idir) {
264  m_boundary2[idir] = 1.0;
265  if (Communicator::ipe(idir) == 0) m_boundary2[idir] = m_boundary[idir];
266  }
267 
268 }
269 
270 //====================================================================
272 {
273  // The following counting explicitly depends on the implementation.
274  // It will be recalculated when the code is modified.
275  // The present counting is based on rev.1107. [24 Aug 2014 H.Matsufuru]
276 
277  int Lvol = CommonParameters::Lvol();
278  double flop_site, flop;
279 
280  if (m_repr == "Dirac") {
281  flop_site = static_cast<double>(
282  m_Nc * m_Nd * (4 + 6 * (4 * m_Nc + 2) + 2 * (4 * m_Nc + 1)));
283  } else if (m_repr == "Chiral") {
284  flop_site = static_cast<double>(
285  m_Nc * m_Nd * (4 + 8 * (4 * m_Nc + 2)));
286  } else {
287  vout.crucial(m_vl, "%s: input repr is undefined.\n",
288  class_name.c_str());
289  abort();
290  }
291 
292  flop = flop_site * static_cast<double>(Lvol);
293  if ((m_mode == "DdagD") || (m_mode == "DDdag")) flop *= 2.0;
294 
295  return flop;
296 }
297 
298 //====================================================================
300 {
301  D_ex_dirac(w, 0, f, 0);
302 }
303 
304 //====================================================================
306 {
307  D_ex_chiral(w, 0, f, 0);
308 }
309 
310 //====================================================================
311 void Fopr_Wilson::Fopr_Wilson_impl::D_ex_dirac(Field& w, const int ex1,
312  const Field& f, const int ex2)
313 {
314  int Ninvol = m_Nvc * m_Nd * m_Nvol;
315  double *v1 = const_cast<Field *>(&f)->ptr(Ninvol * ex2);
316  double *v2 = w.ptr(Ninvol * ex1);
317 
320 
321  int is = m_Ntask * ith / nth;
322  int ns = m_Ntask * (ith + 1) / nth - is;
323 
324 #pragma omp barrier
325 
326  for (int i = is; i < is + ns; ++i) {
327  mult_xp1_thread(i, vcp1_xp, v1);
328  mult_xm1_thread(i, vcp1_xm, v1);
329  mult_yp1_thread(i, vcp1_yp, v1);
330  mult_ym1_thread(i, vcp1_ym, v1);
331  mult_zp1_thread(i, vcp1_zp, v1);
332  mult_zm1_thread(i, vcp1_zm, v1);
333  mult_tp1_dirac_thread(i, vcp1_tp, v1);
334  mult_tm1_dirac_thread(i, vcp1_tm, v1);
335  }
336  #pragma omp barrier
337 
338  for (int i = is; i < is + ns; ++i) {
339  clear_thread(i, v2);
340  mult_xpb_thread(i, v2, v1);
341  mult_xmb_thread(i, v2, v1);
342  mult_ypb_thread(i, v2, v1);
343  mult_ymb_thread(i, v2, v1);
344  mult_zpb_thread(i, v2, v1);
345  mult_zmb_thread(i, v2, v1);
346  mult_tpb_dirac_thread(i, v2, v1);
347  mult_tmb_dirac_thread(i, v2, v1);
348  }
349 
350  for (int i = is; i < is + ns; ++i) {
351  mult_xp2_thread(i, v2, vcp2_xp);
352  mult_xm2_thread(i, v2, vcp2_xm);
353  mult_yp2_thread(i, v2, vcp2_yp);
354  mult_ym2_thread(i, v2, vcp2_ym);
355  mult_zp2_thread(i, v2, vcp2_zp);
356  mult_zm2_thread(i, v2, vcp2_zm);
357  mult_tp2_dirac_thread(i, v2, vcp2_tp);
358  mult_tm2_dirac_thread(i, v2, vcp2_tm);
359  daypx_thread(i, v2, -m_kappa, v1); // w = -m_kappa * w + f.
360  }
361 
363 }
364 
365 
366 //====================================================================
368  const Field& f, const int ex2)
369 {
370  int Ninvol = m_Nvc * m_Nd * m_Nvol;
371  double *v1 = const_cast<Field *>(&f)->ptr(Ninvol * ex2);
372  double *v2 = w.ptr(Ninvol * ex1);
373 
376 
377  int is = m_Ntask * ith / nth;
378  int ns = m_Ntask * (ith + 1) / nth - is;
379 
380 #pragma omp barrier
381 
382  for (int i = is; i < is + ns; ++i) {
383  mult_xp1_thread(i, vcp1_xp, v1);
384  mult_xm1_thread(i, vcp1_xm, v1);
385  mult_yp1_thread(i, vcp1_yp, v1);
386  mult_ym1_thread(i, vcp1_ym, v1);
387  mult_zp1_thread(i, vcp1_zp, v1);
388  mult_zm1_thread(i, vcp1_zm, v1);
389  mult_tp1_chiral_thread(i, vcp1_tp, v1);
390  mult_tm1_chiral_thread(i, vcp1_tm, v1);
391  }
392  #pragma omp barrier
393 
394  for (int i = is; i < is + ns; ++i) {
395  clear_thread(i, v2);
396  mult_xpb_thread(i, v2, v1);
397  mult_xmb_thread(i, v2, v1);
398  mult_ypb_thread(i, v2, v1);
399  mult_ymb_thread(i, v2, v1);
400  mult_zpb_thread(i, v2, v1);
401  mult_zmb_thread(i, v2, v1);
402  mult_tpb_chiral_thread(i, v2, v1);
403  mult_tmb_chiral_thread(i, v2, v1);
404  }
405 
406  for (int i = is; i < is + ns; ++i) {
407  mult_xp2_thread(i, v2, vcp2_xp);
408  mult_xm2_thread(i, v2, vcp2_xm);
409  mult_yp2_thread(i, v2, vcp2_yp);
410  mult_ym2_thread(i, v2, vcp2_ym);
411  mult_zp2_thread(i, v2, vcp2_zp);
412  mult_zm2_thread(i, v2, vcp2_zm);
413  mult_tp2_chiral_thread(i, v2, vcp2_tp);
414  mult_tm2_chiral_thread(i, v2, vcp2_tm);
415  daypx_thread(i, v2, -m_kappa, v1); // w = -m_kappa * w + f.
416  }
417 
419 
420  /*
421  clear(w);
422  mult_xp(w,f);
423  mult_xm(w,f);
424  mult_yp(w,f);
425  mult_ym(w,f);
426  mult_zp(w,f);
427  mult_zm(w,f);
428  mult_tp_chiral(w,f);
429  mult_tm_chiral(w,f);
430  daypx(w, -m_kappa, f); // w = -m_kappa * w + f.
431  */
432 }
433 
434 //====================================================================
436  Field& w, const Field& f)
437 {
438  if (mu == 0) {
439  mult_xp(w, f);
440  } else if (mu == 1) {
441  mult_yp(w, f);
442  } else if (mu == 2) {
443  mult_zp(w, f);
444  } else if (mu == 3) {
445  (this->*m_mult_tp)(w, f);
446  } else {
447  vout.crucial(m_vl, "Fopr_Wilson: illegal parameter mu in mult_up.\n");
448  abort();
449  }
450 
451 }
452 
453 //====================================================================
454 void Fopr_Wilson::Fopr_Wilson_impl::mult_dn(int mu, Field& w, const Field& f)
455 {
456  if (mu == 0) {
457  mult_xm(w, f);
458  } else if (mu == 1) {
459  mult_ym(w, f);
460  } else if (mu == 2) {
461  mult_zm(w, f);
462  } else if (mu == 3) {
463  (this->*m_mult_tm)(w, f);
464  } else {
465  vout.crucial(m_vl, "Fopr_Wilson: illegal parameter mu in mult_dn.\n");
466  abort();
467  }
468 
469 }
470 
471 //====================================================================
473  Field& w, const int ex1,
474  const Field& v, const int ex2, const int ipm)
475 {
476  double fpm = 0.0;
477 
478  if (ipm == 1) {
479  fpm = 1.0;
480  } else if (ipm == -1) {
481  fpm = -1.0;
482  } else {
483  vout.crucial(m_vl,
484  "Fopr_Wilson_impl::proj_chiral: illegal chirality = %d.\n", ipm);
485  abort();
486  }
487 
488  m_w1.setpart_ex(0, v, ex2);
489  mult_gm5(m_w2, m_w1);
490  m_w1.addpart_ex(0, m_w2, 0, fpm);
491  w.setpart_ex(ex1, m_w1, 0);
492 }
493 
494 //====================================================================
496  Field& v, const Field& w)
497 {
498  clear(m_w2);
499  mult_up(mu, m_w2, w);
500  mult_gm5(v, m_w2);
501 }
502 
503 //====================================================================
505  double fac, const Field& f)
506 {
507  double *v1 = const_cast<Field *>(&f)->ptr(0);
508  double *v2 = w.ptr(0);
509 
512 
513  int is = m_Ntask * ith / nth;
514  int ns = m_Ntask * (ith + 1) / nth - is;
515 
516  for (int i = is; i < is + ns; ++i) {
517  daypx_thread(i, v2, fac, v1);
518  }
519 
520 }
521 
522 //====================================================================
524 {
525  scal(v, 2.0 * m_kappa);
526 }
527 
528 //====================================================================
530 {
531  scal(v, 1.0 / (2.0 * m_kappa));
532 }
533 
534 //====================================================================
536 {
537  double *v2 = w.ptr(0);
538 
541 
542  int is = m_Ntask * ith / nth;
543  int ns = m_Ntask * (ith + 1) / nth - is;
544 
545  for (int i = is; i < is + ns; ++i) {
546  clear_thread(i, v2);
547  }
548 
549 }
550 
551 //====================================================================
553 {
554  double *v1 = const_cast<Field *>(&f)->ptr(0);
555  double *v2 = w.ptr(0);
556 
559 
560  int is = m_Ntask * ith / nth;
561  int ns = m_Ntask * (ith + 1) / nth - is;
562 
563  for (int i = is; i < is + ns; ++i) {
564  gm5_dirac_thread(i, v2, v1);
565  }
566  #pragma omp barrier
567 
568 }
569 
570 //====================================================================
572 {
573  double *v1 = const_cast<Field *>(&f)->ptr(0);
574  double *v2 = w.ptr(0);
575 
578 
579  int is = m_Ntask * ith / nth;
580  int ns = m_Ntask * (ith + 1) / nth - is;
581 
582  for (int i = is; i < is + ns; ++i) {
583  gm5_chiral_thread(i, v2, v1);
584  }
585  #pragma omp barrier
586 
587 }
588 
589 //====================================================================
591 {
592  double *v1 = const_cast<Field *>(&f)->ptr(0);
593  double *v2 = w.ptr(0);
594 
597 
598  int is = m_Ntask * ith / nth;
599  int ns = m_Ntask * (ith + 1) / nth - is;
600 
601 #pragma omp barrier
602 
603  for (int i = is; i < is + ns; ++i) {
604  mult_xp1_thread(i, vcp1_xp, v1);
605  }
606  #pragma omp barrier
607 
608  for (int i = is; i < is + ns; ++i) {
609  mult_xpb_thread(i, v2, v1);
610  }
611 
612  for (int i = is; i < is + ns; ++i) {
613  mult_xp2_thread(i, v2, vcp2_xp);
614  }
615 
617 }
618 
619 //====================================================================
621 {
622  double *v2 = w.ptr(0);
623  double *v1 = const_cast<Field *>(&f)->ptr(0);
624 
627 
628  int is = m_Ntask * ith / nth;
629  int ns = m_Ntask * (ith + 1) / nth - is;
630 
631 #pragma omp barrier
632 
633  for (int i = is; i < is + ns; ++i) {
634  mult_xm1_thread(i, vcp1_xm, v1);
635  }
636  #pragma omp barrier
637 
638  for (int i = is; i < is + ns; ++i) {
639  mult_xmb_thread(i, v2, v1);
640  }
641 
642  for (int i = is; i < is + ns; ++i) {
643  mult_xm2_thread(i, v2, vcp2_xm);
644  }
645 
647 }
648 
649 //====================================================================
651 {
652  double *v1 = const_cast<Field *>(&f)->ptr(0);
653  double *v2 = w.ptr(0);
654 
657 
658  int is = m_Ntask * ith / nth;
659  int ns = m_Ntask * (ith + 1) / nth - is;
660 
661 #pragma omp barrier
662 
663  for (int i = is; i < is + ns; ++i) {
664  mult_yp1_thread(i, vcp1_yp, v1);
665  }
666  #pragma omp barrier
667 
668  for (int i = is; i < is + ns; ++i) {
669  mult_ypb_thread(i, v2, v1);
670  }
671 
672  for (int i = is; i < is + ns; ++i) {
673  mult_yp2_thread(i, v2, vcp2_yp);
674  }
675 
677 }
678 
679 //====================================================================
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 #pragma omp barrier
692 
693  for (int i = is; i < is + ns; ++i) {
694  mult_ym1_thread(i, vcp1_ym, v1);
695  }
696  #pragma omp barrier
697 
698  for (int i = is; i < is + ns; ++i) {
699  mult_ymb_thread(i, v2, v1);
700  }
701 
702  for (int i = is; i < is + ns; ++i) {
703  mult_ym2_thread(i, v2, vcp2_ym);
704  }
705 
707 }
708 
709 //====================================================================
711 {
712  double *v1 = const_cast<Field *>(&f)->ptr(0);
713  double *v2 = w.ptr(0);
714 
717 
718  int is = m_Ntask * ith / nth;
719  int ns = m_Ntask * (ith + 1) / nth - is;
720 
721 #pragma omp barrier
722 
723  for (int i = is; i < is + ns; ++i) {
724  mult_zp1_thread(i, vcp1_zp, v1);
725  }
726  #pragma omp barrier
727 
728  for (int i = is; i < is + ns; ++i) {
729  mult_zpb_thread(i, v2, v1);
730  }
731 
732  for (int i = is; i < is + ns; ++i) {
733  mult_zp2_thread(i, v2, vcp2_zp);
734  }
735 
737 }
738 
739 //====================================================================
741 {
742  double *v2 = w.ptr(0);
743  double *v1 = const_cast<Field *>(&f)->ptr(0);
744 
747 
748  int is = m_Ntask * ith / nth;
749  int ns = m_Ntask * (ith + 1) / nth - is;
750 
751 #pragma omp barrier
752 
753  for (int i = is; i < is + ns; ++i) {
754  mult_zm1_thread(i, vcp1_zm, v1);
755  }
756  #pragma omp barrier
757 
758  for (int i = is; i < is + ns; ++i) {
759  mult_zmb_thread(i, v2, v1);
760  }
761 
762  for (int i = is; i < is + ns; ++i) {
763  mult_zm2_thread(i, v2, vcp2_zm);
764  }
765 
767 }
768 
769 //====================================================================
771 {
772  double *v1 = const_cast<Field *>(&f)->ptr(0);
773  double *v2 = w.ptr(0);
774 
777 
778  int is = m_Ntask * ith / nth;
779  int ns = m_Ntask * (ith + 1) / nth - is;
780 
781 #pragma omp barrier
782 
783  for (int i = is; i < is + ns; ++i) {
784  mult_tp1_dirac_thread(i, vcp1_tp, v1);
785  }
786  #pragma omp barrier
787 
788  for (int i = is; i < is + ns; ++i) {
789  mult_tpb_dirac_thread(i, v2, v1);
790  }
791 
792  for (int i = is; i < is + ns; ++i) {
793  mult_tp2_dirac_thread(i, v2, vcp2_tp);
794  }
795 
797 }
798 
799 //====================================================================
801 {
802  double *v2 = w.ptr(0);
803  double *v1 = const_cast<Field *>(&f)->ptr(0);
804 
807 
808  int is = m_Ntask * ith / nth;
809  int ns = m_Ntask * (ith + 1) / nth - is;
810 
811 #pragma omp barrier
812 
813  for (int i = is; i < is + ns; ++i) {
814  mult_tm1_dirac_thread(i, vcp1_tm, v1);
815  }
816  #pragma omp barrier
817 
818  for (int i = is; i < is + ns; ++i) {
819  mult_tmb_dirac_thread(i, v2, v1);
820  }
821 
822  for (int i = is; i < is + ns; ++i) {
823  mult_tm2_dirac_thread(i, v2, vcp2_tm);
824  }
825 
827 }
828 
829 //====================================================================
831 {
832  double *v1 = const_cast<Field *>(&f)->ptr(0);
833  double *v2 = w.ptr(0);
834 
837 
838  int is = m_Ntask * ith / nth;
839  int ns = m_Ntask * (ith + 1) / nth - is;
840 
841 #pragma omp barrier
842 
843  for (int i = is; i < is + ns; ++i) {
844  mult_tp1_chiral_thread(i, vcp1_tp, v1);
845  }
846  #pragma omp barrier
847 
848  for (int i = is; i < is + ns; ++i) {
849  mult_tpb_chiral_thread(i, v2, v1);
850  }
851 
852  for (int i = is; i < is + ns; ++i) {
853  mult_tp2_chiral_thread(i, v2, vcp2_tp);
854  }
855 
857 }
858 
859 //====================================================================
861 {
862  double *v2 = w.ptr(0);
863  double *v1 = const_cast<Field *>(&f)->ptr(0);
864 
867 
868  int is = m_Ntask * ith / nth;
869  int ns = m_Ntask * (ith + 1) / nth - is;
870 
871 #pragma omp barrier
872 
873  for (int i = is; i < is + ns; ++i) {
874  mult_tm1_chiral_thread(i, vcp1_tm, v1);
875  }
876  #pragma omp barrier
877 
878  for (int i = is; i < is + ns; ++i) {
879  mult_tmb_chiral_thread(i, v2, v1);
880  }
881 
882  for (int i = is; i < is + ns; ++i) {
883  mult_tm2_chiral_thread(i, v2, vcp2_tm);
884  }
885 
887 }
888 
889 //====================================================================
890 //============================================================END=====
void daypx(Field &, double, const Field &)
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:310
void mult_zp(Field &, const Field &)
BridgeIO vout
Definition: bridgeIO.cpp:207
void detailed(const char *format,...)
Definition: bridgeIO.cpp:50
static int get_num_threads()
returns available number of threads.
static int NPEy()
static int NPEt()
void set_parameters(const double kappa, const std::valarray< int > bc)
void gm5_chiral(Field &, const Field &)
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
double * vcp1_xp
arrays for data transfer.
void mult_tm_dirac(Field &, const Field &)
void general(const char *format,...)
Definition: bridgeIO.cpp:38
GammaMatrix get_GM(GMspecies spec)
static Bridge::VerboseLevel Vlevel()
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(Fopr_Wilson::Fopr_Wilson_impl::* m_D_ex)(Field &, const int, const Field &, const int)
void D(Field &v, const Field &f)
void(Fopr_Wilson::Fopr_Wilson_impl::* m_mult_dag)(Field &, const Field &)
std::valarray< Channel * > m_fw_recv
std::valarray< int > m_npe
static Channel * recv_init(int count, int idir, int ipm)
void mult_up(int mu, Field &w, const Field &v)
adding the hopping to nearest neighbor site in mu-th direction.
void mult_tp_chiral(Field &, const Field &)
std::valarray< Channel * > m_bw_send
static int ipe(const int dir)
logical coordinate of current proc.
void H(Field &w, const Field &f)
static int Lvol()
std::valarray< double > m_boundary2
b.c. for each node.
void D_chiral(Field &, const Field &)
std::valarray< Channel * > m_bw_recv
Set of Gamma Matrix: chiral representation.
static int get_thread_id()
returns thread id.
void mult_xm(Field &, const Field &)
void DdagD(Field &w, const Field &f)
const Field_G * m_U
gauge configuration.
Field m_w2
temporary fields.
void(Fopr_Wilson::Fopr_Wilson_impl::* m_mult)(Field &, const Field &)
void DDdag(Field &w, const Field &f)
Bridge::VerboseLevel m_vl
Definition: fopr.h:99
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
Definition: field.h:82
std::valarray< GammaMatrix > m_GM
gamma matrices.
static void sync_barrier_all()
barrier among all the threads and nodes.
void mult_ym(Field &, const Field &)
void(Fopr_Wilson::Fopr_Wilson_impl::* m_D)(Field &, const Field &)
Set of Gamma Matrices: basis class.
Set of Gamma Matrix: Dirac representation.
static const std::string class_name
Definition: fopr_Wilson.h:56
void(Fopr_Wilson::Fopr_Wilson_impl::* m_gm5)(Field &, const Field &)
void D_ex_chiral(Field &, const int ex1, const Field &, const int ex2)
void D_ex_dirac(Field &, const int ex1, const Field &, const int ex2)
static const std::string class_name
void paranoiac(const char *format,...)
Definition: bridgeIO.cpp:62
const Field_F mult_gm5p(int mu, const Field_F &w)
static int NPEx()
void crucial(const char *format,...)
Definition: bridgeIO.cpp:26
void set_mode(std::string mode)
static int NPEz()
void(Fopr_Wilson::Fopr_Wilson_impl::* m_mult_tm)(Field &, const Field &)
void mult_tp_dirac(Field &, const Field &)
std::valarray< int > m_boundary
boundary condition.
void mult_up(int mu, Field &, const Field &)
static Channel * send_init(int count, int idir, int ipm)
void D_dirac(Field &, const Field &)
void mult_zm(Field &, const Field &)
static int sync()
synchronize within small world.
void mult_undef(Field &, const Field &f)
void mult_yp(Field &, const Field &)
void setpart_ex(int ex, const Field &w, int exw)
Definition: field.h:150
void mult_xp(Field &, const Field &)
void mult_dn(int mu, Field &, const Field &)
void Ddag(Field &w, const Field &f)
std::valarray< Channel * > m_fw_send
void init(std::string repr)
void(Fopr_Wilson::Fopr_Wilson_impl::* m_mult_tp)(Field &, const Field &)
const Field mult_gm5(const Field &f)
Definition: fopr_Wilson.h:91
void mult_tm_chiral(Field &, const Field &)
void gm5_dirac(Field &, const Field &)