Bridge++  Version 1.4.4
 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 "fopr_Wilson_impl.h"
15 
16 #include "IO/bridgeIO.h"
17 using Bridge::vout;
18 
20 
21 //#define USE_SU2
22 
23 namespace Imp_BGQ {
24 #if defined USE_GROUP_SU3
25 #include "fopr_Wilson_impl_SU3.inc"
26 #elif defined USE_GROUP_SU2
27 #include "fopr_Wilson_impl_SU2.inc"
28 #elif defined USE_GROUP_SU_N
29 #include "fopr_Wilson_impl_SU_N.inc"
30 #endif
31 
32  const std::string Fopr_Wilson::class_name = "Imp_BGQ::Fopr_Wilson";
33 //====================================================================
34  void Fopr_Wilson::init(std::string repr)
35  {
37 
38  vout.general(m_vl, "%s: Construction of Wilson fermion operator\n", class_name.c_str());
39 
40  check_Nc();
41 
44  m_Nvc = 2 * m_Nc;
45  m_Ndf = 2 * m_Nc * m_Nc;
46 
51 
54  m_boundary.resize(m_Ndim);
55  m_boundary2.resize(m_Ndim);
56 
57  m_repr = repr;
58 
59  m_GM.resize(m_Ndim + 1);
60 
61  unique_ptr<GammaMatrixSet> gmset(GammaMatrixSet::New(m_repr));
62 
63  m_GM[0] = gmset->get_GM(GammaMatrixSet::GAMMA1);
64  m_GM[1] = gmset->get_GM(GammaMatrixSet::GAMMA2);
65  m_GM[2] = gmset->get_GM(GammaMatrixSet::GAMMA3);
66  m_GM[3] = gmset->get_GM(GammaMatrixSet::GAMMA4);
67  m_GM[4] = gmset->get_GM(GammaMatrixSet::GAMMA5);
68 
69  m_U = 0;
70 
73 
74  if (m_repr == "Dirac") {
80  } else if (m_repr == "Chiral") {
86  } else {
87  vout.crucial(m_vl, "Error at %s: input repr is undefined\n", class_name.c_str());
88  exit(EXIT_FAILURE);
89  }
90 
91  m_w1.reset(m_Nvc * m_Nd, m_Nvol, 1);
92  m_w2.reset(m_Nvc * m_Nd, m_Nvol, 1);
93 
94  int Nvx = m_Nvc * 2 * m_Ny * m_Nz * m_Nt;
95  vcp1_xp = new double[Nvx];
96  vcp2_xp = new double[Nvx];
97  vcp1_xm = new double[Nvx];
98  vcp2_xm = new double[Nvx];
99 
100  int Nvy = m_Nvc * 2 * m_Nx * m_Nz * m_Nt;
101  vcp1_yp = new double[Nvy];
102  vcp2_yp = new double[Nvy];
103  vcp1_ym = new double[Nvy];
104  vcp2_ym = new double[Nvy];
105 
106  int Nvz = m_Nvc * 2 * m_Nx * m_Ny * m_Nt;
107  vcp1_zp = new double[Nvz];
108  vcp2_zp = new double[Nvz];
109  vcp1_zm = new double[Nvz];
110  vcp2_zm = new double[Nvz];
111 
112  int Nvt = m_Nvc * 2 * m_Nx * m_Ny * m_Nz;
113  vcp1_tp = new double[Nvt];
114  vcp2_tp = new double[Nvt];
115  vcp1_tm = new double[Nvt];
116  vcp2_tm = new double[Nvt];
117 
118 
119  // preparation for non-blocking communication
120  // along the course of T.Aoyama
121 
122  int buf_size[m_Ndim];
123  buf_size[0] = sizeof(double) * m_Nvc * 2 * m_Ny * m_Nz * m_Nt;
124  buf_size[1] = sizeof(double) * m_Nvc * 2 * m_Nx * m_Nz * m_Nt;
125  buf_size[2] = sizeof(double) * m_Nvc * 2 * m_Nx * m_Ny * m_Nt;
126  buf_size[3] = sizeof(double) * m_Nvc * 2 * m_Nx * m_Ny * m_Nz;
127 
128  m_fw_send.resize(m_Ndim);
129  m_fw_recv.resize(m_Ndim);
130  m_bw_send.resize(m_Ndim);
131  m_bw_recv.resize(m_Ndim);
132 
133  m_npe.resize(m_Ndim);
138 
139  vout.detailed(m_vl, "communication setup start.\n");
141 
142  for (int imu = 0; imu < m_Ndim; ++imu) {
143  // forward
144  m_fw_send[imu] = Communicator::send_init(buf_size[imu], imu, +1);
145  m_fw_recv[imu] = Communicator::recv_init(buf_size[imu], imu, -1);
146 
147  // backward
148  m_bw_send[imu] = Communicator::send_init(buf_size[imu], imu, -1);
149  m_bw_recv[imu] = Communicator::recv_init(buf_size[imu], imu, +1);
150 
151  vout.paranoiac(m_vl, "pointer to m_fw_send[%d] = %x.\n",
152  imu, m_fw_send[imu]->ptr());
153  vout.paranoiac(m_vl, "pointer to m_fw_recv[%d] = %x.\n",
154  imu, m_fw_recv[imu]->ptr());
155  vout.paranoiac(m_vl, "pointer to m_bw_send[%d] = %x.\n",
156  imu, m_bw_send[imu]->ptr());
157  vout.paranoiac(m_vl, "pointer to m_bw_recv[%d] = %x.\n",
158  imu, m_bw_recv[imu]->ptr());
159  }
160  vout.detailed(m_vl, "communication setup end.\n");
161 
162  // setup for threading
163  setup_thread();
164  }
165 
166 
167 //====================================================================
168  void Fopr_Wilson::set_mode(std::string mode)
169  {
170  m_mode = mode;
171 
172  vout.detailed(m_vl, "%s: mode is set to %s.\n",
173  class_name.c_str(), m_mode.c_str());
174 
175  if (m_mode == "D") {
178  } else if (m_mode == "Ddag") {
181  } else if (m_mode == "DdagD") {
184  } else if (m_mode == "DDdag") {
187  } else if (m_mode == "H") {
190  } else {
191  vout.crucial(m_vl, "Error at %s: input mode is undefined in Fopr_Wilson\n", class_name.c_str());
192  exit(EXIT_FAILURE);
193  }
194  }
195 
196 
197 //====================================================================
199  {
200  delete[] vcp1_xp;
201  delete[] vcp2_xp;
202  delete[] vcp1_xm;
203  delete[] vcp2_xm;
204 
205  delete[] vcp1_yp;
206  delete[] vcp2_yp;
207  delete[] vcp1_ym;
208  delete[] vcp2_ym;
209 
210  delete[] vcp1_zp;
211  delete[] vcp2_zp;
212  delete[] vcp1_zm;
213  delete[] vcp2_zm;
214 
215  delete[] vcp1_tp;
216  delete[] vcp2_tp;
217  delete[] vcp1_tm;
218  delete[] vcp2_tm;
219  }
220 
221 
222 //====================================================================
223  std::string Fopr_Wilson::get_mode() const
224  {
225  return m_mode;
226  }
227 
228 
229 //====================================================================
231  {
232  const string str_vlevel = params.get_string("verbose_level");
233 
234  m_vl = vout.set_verbose_level(str_vlevel);
235 
236  //- fetch and check input parameters
237  double kappa;
238  std::vector<int> bc;
239 
240  int err = 0;
241  err += params.fetch_double("hopping_parameter", kappa);
242  err += params.fetch_int_vector("boundary_condition", bc);
243 
244  if (err) {
245  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
246  exit(EXIT_FAILURE);
247  }
248 
249  set_parameters(kappa, bc);
250  }
251 
252 
253 //====================================================================
254  void Fopr_Wilson::set_parameters(const double kappa,
255  const std::vector<int> bc)
256  {
257  assert(bc.size() == m_Ndim);
258 
259  m_kappa = kappa;
260 
261  for (int mu = 0; mu < m_Ndim; ++mu) {
262  m_boundary[mu] = bc[mu];
263  }
264 
265  vout.general(m_vl, "%s:\n", class_name.c_str());
266  vout.general(m_vl, " kappa = %12.8f\n", m_kappa);
267  for (int mu = 0; mu < m_Ndim; ++mu) {
268  vout.general(m_vl, " boundary[%d] = %2d\n", mu, m_boundary[mu]);
269  }
270 
271  // boundary condition for each node:
272  for (int idir = 0; idir < m_Ndim; ++idir) {
273  m_boundary2[idir] = 1.0;
274  if (Communicator::ipe(idir) == 0) m_boundary2[idir] = m_boundary[idir];
275  }
276  }
277 
278 
279 //====================================================================
281  {
282  // The following counting explicitly depends on the implementation.
283  // It will be recalculated when the code is modified.
284  // The present counting is based on rev.1107. [24 Aug 2014 H.Matsufuru]
285 
286  int Lvol = CommonParameters::Lvol();
287  double flop_site, flop;
288 
289  if (m_repr == "Dirac") {
290  flop_site = static_cast<double>(
291  m_Nc * m_Nd * (4 + 6 * (4 * m_Nc + 2) + 2 * (4 * m_Nc + 1)));
292  } else if (m_repr == "Chiral") {
293  flop_site = static_cast<double>(
294  m_Nc * m_Nd * (4 + 8 * (4 * m_Nc + 2)));
295  } else {
296  vout.crucial(m_vl, "Error at %s: input repr is undefined\n",
297  class_name.c_str());
298  exit(EXIT_FAILURE);
299  }
300 
301  flop = flop_site * static_cast<double>(Lvol);
302  if ((m_mode == "DdagD") || (m_mode == "DDdag")) flop *= 2.0;
303 
304  return flop;
305  }
306 
307 
308 //====================================================================
309  void Fopr_Wilson::D_dirac(Field& w, const Field& f)
310  {
311  D_ex_dirac(w, 0, f, 0);
312  }
313 
314 
315 //====================================================================
316  void Fopr_Wilson::D_chiral(Field& w, const Field& f)
317  {
318  D_ex_chiral(w, 0, f, 0);
319  }
320 
321 
322 //====================================================================
323  void Fopr_Wilson::D_ex_dirac(Field& w, const int ex1,
324  const Field& f, const int ex2)
325  {
326  int Ninvol = m_Nvc * m_Nd * m_Nvol;
327 
328  const double *v1 = f.ptr(Ninvol * ex2);
329  double *v2 = w.ptr(Ninvol * ex1);
330 
333 
334  int is = m_Ntask * ith / nth;
335  int ns = m_Ntask * (ith + 1) / nth - is;
336 
337 #pragma omp barrier
338 
339  for (int i = is; i < is + ns; ++i) {
340  mult_xp1_thread(i, vcp1_xp, v1);
341  mult_xm1_thread(i, vcp1_xm, v1);
342  mult_yp1_thread(i, vcp1_yp, v1);
343  mult_ym1_thread(i, vcp1_ym, v1);
344  mult_zp1_thread(i, vcp1_zp, v1);
345  mult_zm1_thread(i, vcp1_zm, v1);
348  }
349 #pragma omp barrier
350 
351  for (int i = is; i < is + ns; ++i) {
352  clear_thread(i, v2);
353  mult_xpb_thread(i, v2, v1);
354  mult_xmb_thread(i, v2, v1);
355  mult_ypb_thread(i, v2, v1);
356  mult_ymb_thread(i, v2, v1);
357  mult_zpb_thread(i, v2, v1);
358  mult_zmb_thread(i, v2, v1);
359  mult_tpb_dirac_thread(i, v2, v1);
360  mult_tmb_dirac_thread(i, v2, v1);
361  }
362 
363  for (int i = is; i < is + ns; ++i) {
364  mult_xp2_thread(i, v2, vcp2_xp);
365  mult_xm2_thread(i, v2, vcp2_xm);
366  mult_yp2_thread(i, v2, vcp2_yp);
367  mult_ym2_thread(i, v2, vcp2_ym);
368  mult_zp2_thread(i, v2, vcp2_zp);
369  mult_zm2_thread(i, v2, vcp2_zm);
372  daypx_thread(i, v2, -m_kappa, v1); // w = -m_kappa * w + f.
373  }
374 
376  }
377 
378 
379 //====================================================================
380  void Fopr_Wilson::D_ex_chiral(Field& w, const int ex1,
381  const Field& f, const int ex2)
382  {
383  int Ninvol = m_Nvc * m_Nd * m_Nvol;
384 
385  const double *v1 = f.ptr(Ninvol * ex2);
386  double *v2 = w.ptr(Ninvol * ex1);
387 
390 
391  int is = m_Ntask * ith / nth;
392  int ns = m_Ntask * (ith + 1) / nth - is;
393 
394 #pragma omp barrier
395 
396  for (int i = is; i < is + ns; ++i) {
397  mult_xp1_thread(i, vcp1_xp, v1);
398  mult_xm1_thread(i, vcp1_xm, v1);
399  mult_yp1_thread(i, vcp1_yp, v1);
400  mult_ym1_thread(i, vcp1_ym, v1);
401  mult_zp1_thread(i, vcp1_zp, v1);
402  mult_zm1_thread(i, vcp1_zm, v1);
405  }
406 #pragma omp barrier
407 
408  for (int i = is; i < is + ns; ++i) {
409  clear_thread(i, v2);
410  mult_xpb_thread(i, v2, v1);
411  mult_xmb_thread(i, v2, v1);
412  mult_ypb_thread(i, v2, v1);
413  mult_ymb_thread(i, v2, v1);
414  mult_zpb_thread(i, v2, v1);
415  mult_zmb_thread(i, v2, v1);
416  mult_tpb_chiral_thread(i, v2, v1);
417  mult_tmb_chiral_thread(i, v2, v1);
418  }
419 
420  for (int i = is; i < is + ns; ++i) {
421  mult_xp2_thread(i, v2, vcp2_xp);
422  mult_xm2_thread(i, v2, vcp2_xm);
423  mult_yp2_thread(i, v2, vcp2_yp);
424  mult_ym2_thread(i, v2, vcp2_ym);
425  mult_zp2_thread(i, v2, vcp2_zp);
426  mult_zm2_thread(i, v2, vcp2_zm);
429  daypx_thread(i, v2, -m_kappa, v1); // w = -m_kappa * w + f.
430  }
431 
433 
434  /*
435  clear(w);
436  mult_xp(w,f);
437  mult_xm(w,f);
438  mult_yp(w,f);
439  mult_ym(w,f);
440  mult_zp(w,f);
441  mult_zm(w,f);
442  mult_tp_chiral(w,f);
443  mult_tm_chiral(w,f);
444  daypx(w, -m_kappa, f); // w = -m_kappa * w + f.
445  */
446  }
447 
448 
449 //====================================================================
450  void Fopr_Wilson::mult_up(int mu,
451  Field& w, const Field& f)
452  {
453  if (mu == 0) {
454  mult_xp(w, f);
455  } else if (mu == 1) {
456  mult_yp(w, f);
457  } else if (mu == 2) {
458  mult_zp(w, f);
459  } else if (mu == 3) {
460  (this->*m_mult_tp)(w, f);
461  } else {
462  vout.crucial(m_vl, "Error at %s::mult_up: illegal mu=%d\n", class_name.c_str(), mu);
463  exit(EXIT_FAILURE);
464  }
465  }
466 
467 
468 //====================================================================
469  void Fopr_Wilson::mult_dn(int mu, Field& w, const Field& f)
470  {
471  if (mu == 0) {
472  mult_xm(w, f);
473  } else if (mu == 1) {
474  mult_ym(w, f);
475  } else if (mu == 2) {
476  mult_zm(w, f);
477  } else if (mu == 3) {
478  (this->*m_mult_tm)(w, f);
479  } else {
480  vout.crucial(m_vl, "Error at %s::mult_dn: illegal mu=%d\n", class_name.c_str(), mu);
481  exit(EXIT_FAILURE);
482  }
483  }
484 
485 
486 //====================================================================
488  Field& w, const int ex1,
489  const Field& v, const int ex2, const int ipm)
490  {
491  double fpm = 0.0;
492 
493  if (ipm == 1) {
494  fpm = 1.0;
495  } else if (ipm == -1) {
496  fpm = -1.0;
497  } else {
498  vout.crucial(m_vl, "Error at %s::proj_chiral: illegal chirality = %d\n", class_name.c_str(), ipm);
499  exit(EXIT_FAILURE);
500  }
501 
502  m_w1.setpart_ex(0, v, ex2);
503  mult_gm5(m_w2, m_w1);
504  m_w1.addpart_ex(0, m_w2, 0, fpm);
505  w.setpart_ex(ex1, m_w1, 0);
506  }
507 
508 
509 //====================================================================
511  Field& v, const Field& w)
512  {
513  clear(m_w2);
514  mult_up(mu, m_w2, w);
515  mult_gm5(v, m_w2);
516  }
517 
518 
519 //====================================================================
521  double fac, const Field& f)
522  {
523  const double *v1 = f.ptr(0);
524  double *v2 = w.ptr(0);
525 
528 
529  int is = m_Ntask * ith / nth;
530  int ns = m_Ntask * (ith + 1) / nth - is;
531 
532  for (int i = is; i < is + ns; ++i) {
533  daypx_thread(i, v2, fac, v1);
534  }
535  }
536 
537 
538 //====================================================================
540  {
541  scal(v, 2.0 * m_kappa);
542  }
543 
544 
545 //====================================================================
547  {
548  scal(v, 1.0 / (2.0 * m_kappa));
549  }
550 
551 
552 //====================================================================
554  {
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  clear_thread(i, v2);
565  }
566  }
567 
568 
569 //====================================================================
570  void Fopr_Wilson::gm5_dirac(Field& w, const Field& f)
571  {
572  const double *v1 = f.ptr(0);
573  double *v2 = w.ptr(0);
574 
577 
578  int is = m_Ntask * ith / nth;
579  int ns = m_Ntask * (ith + 1) / nth - is;
580 
581  for (int i = is; i < is + ns; ++i) {
582  gm5_dirac_thread(i, v2, v1);
583  }
584 #pragma omp barrier
585  }
586 
587 
588 //====================================================================
590  {
591  const double *v1 = f.ptr(0);
592  double *v2 = w.ptr(0);
593 
596 
597  int is = m_Ntask * ith / nth;
598  int ns = m_Ntask * (ith + 1) / nth - is;
599 
600  for (int i = is; i < is + ns; ++i) {
601  gm5_chiral_thread(i, v2, v1);
602  }
603 #pragma omp barrier
604  }
605 
606 
607 //====================================================================
608  void Fopr_Wilson::mult_xp(Field& w, const Field& f)
609  {
610  const double *v1 = f.ptr(0);
611  double *v2 = w.ptr(0);
612 
615 
616  int is = m_Ntask * ith / nth;
617  int ns = m_Ntask * (ith + 1) / nth - is;
618 
619 #pragma omp barrier
620 
621  for (int i = is; i < is + ns; ++i) {
622  mult_xp1_thread(i, vcp1_xp, v1);
623  }
624 #pragma omp barrier
625 
626  for (int i = is; i < is + ns; ++i) {
627  mult_xpb_thread(i, v2, v1);
628  }
629 
630  for (int i = is; i < is + ns; ++i) {
631  mult_xp2_thread(i, v2, vcp2_xp);
632  }
633 
635  }
636 
637 
638 //====================================================================
639  void Fopr_Wilson::mult_xm(Field& w, const Field& f)
640  {
641  const double *v1 = f.ptr(0);
642  double *v2 = w.ptr(0);
643 
646 
647  int is = m_Ntask * ith / nth;
648  int ns = m_Ntask * (ith + 1) / nth - is;
649 
650 #pragma omp barrier
651 
652  for (int i = is; i < is + ns; ++i) {
653  mult_xm1_thread(i, vcp1_xm, v1);
654  }
655 #pragma omp barrier
656 
657  for (int i = is; i < is + ns; ++i) {
658  mult_xmb_thread(i, v2, v1);
659  }
660 
661  for (int i = is; i < is + ns; ++i) {
662  mult_xm2_thread(i, v2, vcp2_xm);
663  }
664 
666  }
667 
668 
669 //====================================================================
670  void Fopr_Wilson::mult_yp(Field& w, const Field& f)
671  {
672  const double *v1 = f.ptr(0);
673  double *v2 = w.ptr(0);
674 
677 
678  int is = m_Ntask * ith / nth;
679  int ns = m_Ntask * (ith + 1) / nth - is;
680 
681 #pragma omp barrier
682 
683  for (int i = is; i < is + ns; ++i) {
684  mult_yp1_thread(i, vcp1_yp, v1);
685  }
686 #pragma omp barrier
687 
688  for (int i = is; i < is + ns; ++i) {
689  mult_ypb_thread(i, v2, v1);
690  }
691 
692  for (int i = is; i < is + ns; ++i) {
693  mult_yp2_thread(i, v2, vcp2_yp);
694  }
695 
697  }
698 
699 
700 //====================================================================
701  void Fopr_Wilson::mult_ym(Field& w, const Field& f)
702  {
703  const double *v1 = f.ptr(0);
704  double *v2 = w.ptr(0);
705 
708 
709  int is = m_Ntask * ith / nth;
710  int ns = m_Ntask * (ith + 1) / nth - is;
711 
712 #pragma omp barrier
713 
714  for (int i = is; i < is + ns; ++i) {
715  mult_ym1_thread(i, vcp1_ym, v1);
716  }
717 #pragma omp barrier
718 
719  for (int i = is; i < is + ns; ++i) {
720  mult_ymb_thread(i, v2, v1);
721  }
722 
723  for (int i = is; i < is + ns; ++i) {
724  mult_ym2_thread(i, v2, vcp2_ym);
725  }
726 
728  }
729 
730 
731 //====================================================================
732  void Fopr_Wilson::mult_zp(Field& w, const Field& f)
733  {
734  const double *v1 = f.ptr(0);
735  double *v2 = w.ptr(0);
736 
739 
740  int is = m_Ntask * ith / nth;
741  int ns = m_Ntask * (ith + 1) / nth - is;
742 
743 #pragma omp barrier
744 
745  for (int i = is; i < is + ns; ++i) {
746  mult_zp1_thread(i, vcp1_zp, v1);
747  }
748 #pragma omp barrier
749 
750  for (int i = is; i < is + ns; ++i) {
751  mult_zpb_thread(i, v2, v1);
752  }
753 
754  for (int i = is; i < is + ns; ++i) {
755  mult_zp2_thread(i, v2, vcp2_zp);
756  }
757 
759  }
760 
761 
762 //====================================================================
763  void Fopr_Wilson::mult_zm(Field& w, const Field& f)
764  {
765  const double *v1 = f.ptr(0);
766  double *v2 = w.ptr(0);
767 
770 
771  int is = m_Ntask * ith / nth;
772  int ns = m_Ntask * (ith + 1) / nth - is;
773 
774 #pragma omp barrier
775 
776  for (int i = is; i < is + ns; ++i) {
777  mult_zm1_thread(i, vcp1_zm, v1);
778  }
779 #pragma omp barrier
780 
781  for (int i = is; i < is + ns; ++i) {
782  mult_zmb_thread(i, v2, v1);
783  }
784 
785  for (int i = is; i < is + ns; ++i) {
786  mult_zm2_thread(i, v2, vcp2_zm);
787  }
788 
790  }
791 
792 
793 //====================================================================
795  {
796  const double *v1 = f.ptr(0);
797  double *v2 = w.ptr(0);
798 
801 
802  int is = m_Ntask * ith / nth;
803  int ns = m_Ntask * (ith + 1) / nth - is;
804 
805 #pragma omp barrier
806 
807  for (int i = is; i < is + ns; ++i) {
809  }
810 #pragma omp barrier
811 
812  for (int i = is; i < is + ns; ++i) {
813  mult_tpb_dirac_thread(i, v2, v1);
814  }
815 
816  for (int i = is; i < is + ns; ++i) {
818  }
819 
821  }
822 
823 
824 //====================================================================
826  {
827  const double *v1 = f.ptr(0);
828  double *v2 = w.ptr(0);
829 
832 
833  int is = m_Ntask * ith / nth;
834  int ns = m_Ntask * (ith + 1) / nth - is;
835 
836 #pragma omp barrier
837 
838  for (int i = is; i < is + ns; ++i) {
840  }
841 #pragma omp barrier
842 
843  for (int i = is; i < is + ns; ++i) {
844  mult_tmb_dirac_thread(i, v2, v1);
845  }
846 
847  for (int i = is; i < is + ns; ++i) {
849  }
850 
852  }
853 
854 
855 //====================================================================
857  {
858  const double *v1 = f.ptr(0);
859  double *v2 = w.ptr(0);
860 
863 
864  int is = m_Ntask * ith / nth;
865  int ns = m_Ntask * (ith + 1) / nth - is;
866 
867 #pragma omp barrier
868 
869  for (int i = is; i < is + ns; ++i) {
871  }
872 #pragma omp barrier
873 
874  for (int i = is; i < is + ns; ++i) {
875  mult_tpb_chiral_thread(i, v2, v1);
876  }
877 
878  for (int i = is; i < is + ns; ++i) {
880  }
881 
883  }
884 
885 
886 //====================================================================
888  {
889  const double *v1 = f.ptr(0);
890  double *v2 = w.ptr(0);
891 
894 
895  int is = m_Ntask * ith / nth;
896  int ns = m_Ntask * (ith + 1) / nth - is;
897 
898 #pragma omp barrier
899 
900  for (int i = is; i < is + ns; ++i) {
902  }
903 #pragma omp barrier
904 
905  for (int i = is; i < is + ns; ++i) {
906  mult_tmb_chiral_thread(i, v2, v1);
907  }
908 
909  for (int i = is; i < is + ns; ++i) {
911  }
912 
914  }
915 
916 
917 //====================================================================
918 }
919 //============================================================END=====
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:282
void clear_thread(int, double *)
void mult_undef(Field &, const Field &f)
BridgeIO vout
Definition: bridgeIO.cpp:495
void D_ex_dirac(Field &, const int ex1, const Field &, const int ex2)
std::vector< int > m_npe
void detailed(const char *format,...)
Definition: bridgeIO.cpp:212
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:142
void mult_ym1_thread(int, double *, const double *)
static int NPEt()
void mult_yp2_thread(int, double *, const double *)
void mult_zm(Field &, const Field &)
void mult_tm_dirac(Field &, const Field &)
void mult_xm1_thread(int, double *, const double *)
std::vector< Channel * > m_bw_recv
void mult_tp_dirac(Field &, const Field &)
void mult_ym(Field &, const Field &)
void mult_zm1_thread(int, double *, const double *)
static const std::string class_name
std::vector< Channel * > m_bw_send
double flop_count()
returns the flops per site.
void general(const char *format,...)
Definition: bridgeIO.cpp:195
GammaMatrix get_GM(GMspecies spec)
std::vector< int > m_boundary
boundary condition.
void gm5_dirac_thread(int, double *, const double *)
void mult_tp2_chiral_thread(int, double *, const double *)
static Bridge::VerboseLevel Vlevel()
void mult_tp2_dirac_thread(int, double *, const double *)
Container of Field-type object.
Definition: field.h:39
void mult_ymb_thread(int, double *, const double *)
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:211
void mult_ypb_thread(int, double *, const double *)
void mult_zm2_thread(int, double *, const double *)
const Field_F mult_gm5p(int mu, const Field_F &w)
void mult_tmb_dirac_thread(int, double *, const double *)
void mult_tm_chiral(Field &, const Field &)
static Channel * recv_init(int count, int idir, int ipm)
void(Fopr_Wilson::* m_D)(Field &, const Field &)
void DdagD(Field &w, const Field &f)
void set_parameters(const Parameters &params)
Class for parameters.
Definition: parameters.h:46
static int ipe(const int dir)
logical coordinate of current proc.
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
void D_chiral(Field &, const Field &)
static int Lvol()
void mult_tp1_dirac_thread(int, double *, const double *)
void addpart_ex(int ex, const Field &w, int exw)
Definition: field.h:193
std::string get_mode() const
only for Fopr_Overlap
static int get_thread_id()
returns thread id.
void gm5_chiral_thread(int, double *, const double *)
void mult_tmb_chiral_thread(int, double *, const double *)
std::vector< double > m_boundary2
b.c. for each node.
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void(Fopr_Wilson::* m_gm5)(Field &, const Field &)
void D_ex_chiral(Field &, const int ex1, const Field &, const int ex2)
void mult_yp1_thread(int, double *, const double *)
void gm5_chiral(Field &, const Field &)
void mult_up(int mu, Field &, const Field &)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
Bridge::VerboseLevel m_vl
void mult_xp1_thread(int, double *, const double *)
void mult_zp1_thread(int, double *, const double *)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
Definition: field.h:84
double m_kappa
hopping parameter.
static void sync_barrier_all()
barrier among all the threads and nodes.
Field m_w2
temporary fields.
std::vector< Channel * > m_fw_recv
void mult_tm1_dirac_thread(int, double *, const double *)
void mult_zp(Field &, const Field &)
void D_dirac(Field &, const Field &)
void fprop_normalize(Field &v)
void paranoiac(const char *format,...)
Definition: bridgeIO.cpp:229
void daypx(Field &, double, const Field &)
void mult_yp(Field &, const Field &)
const Field_G * m_U
gauge configuration.
void mult_ym2_thread(int, double *, const double *)
void mult_xp(Field &, const Field &)
void DDdag(Field &w, const Field &f)
static int NPEx()
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void mult_xm(Field &, const Field &)
void mult_tp1_chiral_thread(int, double *, const double *)
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
void(Fopr_Wilson::* m_mult_tp)(Field &, const Field &)
void mult_xpb_thread(int, double *, const double *)
static int NPEz()
void fopr_normalize(Field &v)
std::vector< GammaMatrix > m_GM
gamma matrices.
void(Fopr_Wilson::* m_mult)(Field &, const Field &)
void daypx_thread(int, double *, double, const double *)
void mult_tpb_chiral_thread(int, double *, const double *)
void(Fopr_Wilson::* m_mult_dag)(Field &, const Field &)
std::vector< Channel * > m_fw_send
static Channel * send_init(int count, int idir, int ipm)
void mult_xp2_thread(int, double *, const double *)
void mult_zpb_thread(int, double *, const double *)
void mult_zp2_thread(int, double *, const double *)
static int sync()
synchronize within small world.
void mult_dn(int mu, Field &, const Field &)
void(Fopr_Wilson::* m_mult_tm)(Field &, const Field &)
void mult_tm2_dirac_thread(int, double *, const double *)
void(Fopr_Wilson::* m_D_ex)(Field &, const int, const Field &, const int)
void mult_xmb_thread(int, double *, const double *)
void mult_tp_chiral(Field &, const Field &)
void mult_tm2_chiral_thread(int, double *, const double *)
void mult_tm1_chiral_thread(int, double *, const double *)
void setpart_ex(int ex, const Field &w, int exw)
Definition: field.h:186
string get_string(const string &key) const
Definition: parameters.cpp:116
int fetch_int_vector(const string &key, vector< int > &value) const
Definition: parameters.cpp:294
double * vcp1_xp
arrays for data transfer.
void init(std::string repr)
void mult_tpb_dirac_thread(int, double *, const double *)
void Ddag(Field &w, const Field &f)
void mult_xm2_thread(int, double *, const double *)
void H(Field &w, const Field &f)
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:131
void D(Field &v, const Field &f)
void gm5_dirac(Field &, const Field &)
void mult_zmb_thread(int, double *, const double *)