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