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