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"
81 }
else if (
m_repr ==
"Chiral") {
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;
143 for (
int imu = 0; imu <
m_Ndim; ++imu) {
179 }
else if (m_mode ==
"Ddag") {
182 }
else if (m_mode ==
"DdagD") {
185 }
else if (m_mode ==
"DDdag") {
188 }
else if (m_mode ==
"H") {
232 const double kappa_t,
235 const std::vector<int> bc)
237 assert(bc.size() ==
m_Ndim);
244 for (
int mu = 0; mu <
m_Ndim; ++mu) {
245 m_boundary[mu] = bc[mu];
253 for (
int mu = 0; mu <
m_Ndim; ++mu) {
258 for (
int idir = 0; idir <
m_Ndim; ++idir) {
259 m_boundary2[idir] = 1.0;
273 double flop_site, flop;
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)));
287 flop = flop_site *
static_cast<double>(Lvol);
288 if ((m_mode ==
"DdagD") || (m_mode ==
"DDdag")) flop *= 2.0;
297 D_ex_dirac(w, 0, f, 0);
304 D_ex_chiral(w, 0, f, 0);
310 const Field& f,
const int ex2)
312 int Ninvol = m_Nvc * m_Nd * m_Nvol;
314 const double *v1 = f.
ptr(Ninvol * ex2);
315 double *v2 = w.
ptr(Ninvol * ex1);
320 int is = m_Ntask * ith / nth;
321 int ns = m_Ntask * (ith + 1) / nth - is;
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);
337 for (
int i = is; i < is + ns; ++i) {
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);
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);
360 for (
int i = is; i < is + ns; ++i) {
362 daypx_thread(i, v2, -m_kappa_s, v1);
372 const Field& f,
const int ex2)
374 int Ninvol = m_Nvc * m_Nd * m_Nvol;
376 const double *v1 = f.
ptr(Ninvol * ex2);
377 double *v2 = w.
ptr(Ninvol * ex1);
382 int is = m_Ntask * ith / nth;
383 int ns = m_Ntask * (ith + 1) / nth - is;
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);
399 for (
int i = is; i < is + ns; ++i) {
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);
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);
422 for (
int i = is; i < is + ns; ++i) {
424 daypx_thread(i, v2, -m_kappa_s, v1);
449 }
else if (mu == 1) {
451 }
else if (mu == 2) {
453 }
else if (mu == 3) {
454 (this->*m_mult_tp)(w, f);
467 }
else if (mu == 1) {
469 }
else if (mu == 2) {
471 }
else if (mu == 3) {
472 (this->*m_mult_tm)(w, f);
482 Field& w,
const int ex1,
483 const Field& v,
const int ex2,
const int ipm)
489 }
else if (ipm == -1) {
493 "%s::proj_chiral: illegal chirality = %d.\n",
class_name.c_str(), ipm);
497 m_w1.setpart_ex(0, v, ex2);
499 m_w1.addpart_ex(0, m_w2, 0, fpm);
516 double fac,
const Field& f)
518 const double *v1 = f.
ptr(0);
519 double *v2 = w.
ptr(0);
524 int is = m_Ntask * ith / nth;
525 int ns = m_Ntask * (ith + 1) / nth - is;
527 for (
int i = is; i < is + ns; ++i) {
528 daypx_thread(i, v2, fac, v1);
550 double *v2 = w.
ptr(0);
555 int is = m_Ntask * ith / nth;
556 int ns = m_Ntask * (ith + 1) / nth - is;
558 for (
int i = is; i < is + ns; ++i) {
567 const double *v1 = f.
ptr(0);
568 double *v2 = w.
ptr(0);
573 int is = m_Ntask * ith / nth;
574 int ns = m_Ntask * (ith + 1) / nth - is;
576 for (
int i = is; i < is + ns; ++i) {
577 gm5_dirac_thread(i, v2, v1);
586 const double *v1 = f.
ptr(0);
587 double *v2 = w.
ptr(0);
592 int is = m_Ntask * ith / nth;
593 int ns = m_Ntask * (ith + 1) / nth - is;
595 for (
int i = is; i < is + ns; ++i) {
596 gm5_chiral_thread(i, v2, v1);
605 const double *v1 = f.
ptr(0);
606 double *v2 = w.
ptr(0);
611 int is = m_Ntask * ith / nth;
612 int ns = m_Ntask * (ith + 1) / nth - is;
616 for (
int i = is; i < is + ns; ++i) {
617 mult_xp1_thread(i, vcp1_xp, v1);
621 for (
int i = is; i < is + ns; ++i) {
622 mult_xpb_thread(i, v2, v1);
625 for (
int i = is; i < is + ns; ++i) {
626 mult_xp2_thread(i, v2, vcp2_xp);
636 const double *v1 = f.
ptr(0);
637 double *v2 = w.
ptr(0);
642 int is = m_Ntask * ith / nth;
643 int ns = m_Ntask * (ith + 1) / nth - is;
647 for (
int i = is; i < is + ns; ++i) {
648 mult_xm1_thread(i, vcp1_xm, v1);
652 for (
int i = is; i < is + ns; ++i) {
653 mult_xmb_thread(i, v2, v1);
656 for (
int i = is; i < is + ns; ++i) {
657 mult_xm2_thread(i, v2, vcp2_xm);
667 const double *v1 = f.
ptr(0);
668 double *v2 = w.
ptr(0);
673 int is = m_Ntask * ith / nth;
674 int ns = m_Ntask * (ith + 1) / nth - is;
678 for (
int i = is; i < is + ns; ++i) {
679 mult_yp1_thread(i, vcp1_yp, v1);
683 for (
int i = is; i < is + ns; ++i) {
684 mult_ypb_thread(i, v2, v1);
687 for (
int i = is; i < is + ns; ++i) {
688 mult_yp2_thread(i, v2, vcp2_yp);
698 const double *v1 = f.
ptr(0);
699 double *v2 = w.
ptr(0);
704 int is = m_Ntask * ith / nth;
705 int ns = m_Ntask * (ith + 1) / nth - is;
709 for (
int i = is; i < is + ns; ++i) {
710 mult_ym1_thread(i, vcp1_ym, v1);
714 for (
int i = is; i < is + ns; ++i) {
715 mult_ymb_thread(i, v2, v1);
718 for (
int i = is; i < is + ns; ++i) {
719 mult_ym2_thread(i, v2, vcp2_ym);
729 const double *v1 = f.
ptr(0);
730 double *v2 = w.
ptr(0);
735 int is = m_Ntask * ith / nth;
736 int ns = m_Ntask * (ith + 1) / nth - is;
740 for (
int i = is; i < is + ns; ++i) {
741 mult_zp1_thread(i, vcp1_zp, v1);
745 for (
int i = is; i < is + ns; ++i) {
746 mult_zpb_thread(i, v2, v1);
749 for (
int i = is; i < is + ns; ++i) {
750 mult_zp2_thread(i, v2, vcp2_zp);
760 const double *v1 = f.
ptr(0);
761 double *v2 = w.
ptr(0);
766 int is = m_Ntask * ith / nth;
767 int ns = m_Ntask * (ith + 1) / nth - is;
771 for (
int i = is; i < is + ns; ++i) {
772 mult_zm1_thread(i, vcp1_zm, v1);
776 for (
int i = is; i < is + ns; ++i) {
777 mult_zmb_thread(i, v2, v1);
780 for (
int i = is; i < is + ns; ++i) {
781 mult_zm2_thread(i, v2, vcp2_zm);
791 const double *v1 = f.
ptr(0);
792 double *v2 = w.
ptr(0);
797 int is = m_Ntask * ith / nth;
798 int ns = m_Ntask * (ith + 1) / nth - is;
802 for (
int i = is; i < is + ns; ++i) {
803 mult_tp1_dirac_thread(i, vcp1_tp, v1);
807 for (
int i = is; i < is + ns; ++i) {
808 mult_tpb_dirac_thread(i, v2, v1);
811 for (
int i = is; i < is + ns; ++i) {
812 mult_tp2_dirac_thread(i, v2, vcp2_tp);
822 const double *v1 = f.
ptr(0);
823 double *v2 = w.
ptr(0);
828 int is = m_Ntask * ith / nth;
829 int ns = m_Ntask * (ith + 1) / nth - is;
833 for (
int i = is; i < is + ns; ++i) {
834 mult_tm1_dirac_thread(i, vcp1_tm, v1);
838 for (
int i = is; i < is + ns; ++i) {
839 mult_tmb_dirac_thread(i, v2, v1);
842 for (
int i = is; i < is + ns; ++i) {
843 mult_tm2_dirac_thread(i, v2, vcp2_tm);
853 const double *v1 = f.
ptr(0);
854 double *v2 = w.
ptr(0);
859 int is = m_Ntask * ith / nth;
860 int ns = m_Ntask * (ith + 1) / nth - is;
864 for (
int i = is; i < is + ns; ++i) {
865 mult_tp1_chiral_thread(i, vcp1_tp, v1);
869 for (
int i = is; i < is + ns; ++i) {
870 mult_tpb_chiral_thread(i, v2, v1);
873 for (
int i = is; i < is + ns; ++i) {
874 mult_tp2_chiral_thread(i, v2, vcp2_tp);
884 const double *v1 = f.
ptr(0);
885 double *v2 = w.
ptr(0);
890 int is = m_Ntask * ith / nth;
891 int ns = m_Ntask * (ith + 1) / nth - is;
895 for (
int i = is; i < is + ns; ++i) {
896 mult_tm1_chiral_thread(i, vcp1_tm, v1);
900 for (
int i = is; i < is + ns; ++i) {
901 mult_tmb_chiral_thread(i, v2, v1);
904 for (
int i = is; i < is + ns; ++i) {
905 mult_tm2_chiral_thread(i, v2, vcp2_tm);
void DDdag(Field &w, const Field &f)
void detailed(const char *format,...)
static int get_num_threads()
returns available number of threads.
const double * ptr(const int jin, const int site, const int jex) const
std::vector< Channel * > m_fw_recv
void mult_yp(Field &, const Field &)
void mult_up(int mu, Field &, const Field &)
void general(const char *format,...)
void gm5_chiral(Field &, const Field &)
void mult_tm_chiral(Field &, const Field &)
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_mult)(Field &, const Field &)
std::vector< GammaMatrix > m_GM
gamma matrices.
static Bridge::VerboseLevel Vlevel()
double * vcp1_xp
arrays for data transfer.
std::vector< Channel * > m_fw_send
Container of Field-type object.
void daypx(Field &, double, const Field &)
static Channel * recv_init(int count, int idir, int ipm)
void mult_ym(Field &, const Field &)
void set_mode(std::string mode)
Field m_w2
temporary fields.
void Ddag(Field &w, const Field &f)
void H(Field &w, const Field &f)
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 &)
void set_parameters(const double kappa_s, const double kappa_t, const double nu_s, const double r_s, const std::vector< int > bc)
void mult_xm(Field &, const Field &)
std::vector< double > m_boundary2
b.c. for each node.
static int get_thread_id()
returns thread id.
void mult_tm_dirac(Field &, const Field &)
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_G * m_U
gauge configuration.
void mult_undef(Field &, const Field &f)
std::vector< Channel * > m_bw_recv
const Field_F mult_gm5p(int mu, const Field_F &w)
void gm5_dirac(Field &, const Field &)
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_mult_tm)(Field &, const Field &)
void init(std::string repr)
std::string get_mode() const
Bridge::VerboseLevel m_vl
void DdagD(Field &w, const Field &f)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
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 mult_zp(Field &, const Field &)
void paranoiac(const char *format,...)
void mult_gm5(Field &w, const Field &v)
void crucial(const char *format,...)
static const std::string class_name
void D(Field &v, const Field &f)
void(Fopr_Wilson_General::Fopr_Wilson_General_impl::* m_mult_dag)(Field &, const Field &)
std::vector< Channel * > m_bw_send
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)
void mult_xp(Field &, const Field &)
static Channel * send_init(int count, int idir, int ipm)
void D_dirac(Field &, const Field &)
static const std::string class_name
static int sync()
synchronize within small world.
void mult_dn(int mu, Field &, const Field &)
Bridge::VerboseLevel m_vl
void D_chiral(Field &, const Field &)
void setpart_ex(int ex, const Field &w, int exw)
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 &)
void mult_tp_chiral(Field &, const Field &)
void mult_tp_dirac(Field &, const Field &)
void mult_zm(Field &, const Field &)