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