Bridge++  Ver.2.1.3
afopr_Wilson-tmpl.h
Go to the documentation of this file.
1 
10 #include "lib/IO/bridgeIO.h"
11 using Bridge::vout;
12 
13 template<typename AFIELD>
14 const std::string AFopr_Wilson<AFIELD>::class_name
15  = "AFopr_Wilson<AFIELD>";
16 
17 //====================================================================
18 namespace{
19  inline void set_kernel_thread(int& ith, int& nth, int& ith_kernel)
20  {
23  ith_kernel = 0;
24  if(nth > 1) ith_kernel = 1;
25  }
26 }
27 
28 //====================================================================
29 template<typename AFIELD>
31 {
33 
34  std::string vlevel;
35  if (!params.fetch_string("verbose_level", vlevel)) {
36  m_vl = vout.set_verbose_level(vlevel);
37  } else {
38  m_vl = CommonParameters::Vlevel();
39  }
40 
41  vout.general(m_vl, "%s: construction\n", class_name.c_str());
43 
44  m_Nc = CommonParameters::Nc();
45  m_Nd = CommonParameters::Nd();
46  m_Nst = CommonParameters::Nvol();
47  m_Ndim = CommonParameters::Ndim();
48  int Nvc = m_Nc * 2;
49  int Ndf = 2 * m_Nc * m_Nc;
50  int Nx = CommonParameters::Nx();
51  int Ny = CommonParameters::Ny();
52  int Nz = CommonParameters::Nz();
53  int Nt = CommonParameters::Nt();
54 
55  m_Nsize[0] = Nx;
56  m_Nsize[1] = Ny;
57  m_Nsize[2] = Nz;
58  m_Nsize[3] = Nt;
59 
60  // switches for coomunication
61  int req_comm = 0; // 0: communication only if necessary
62  // 1: communication is enforced any time
63  if (!params.fetch_int("require_communication", req_comm)) {
64  vout.general(m_vl, "req_comm = %d (input)\n", req_comm);
65  } else {
66  vout.general(m_vl, "req_comm = %d (default)\n", req_comm);
67  }
68 
69  do_comm_any = 0;
70  for(int mu = 0; mu < m_Ndim; ++mu){
71  do_comm[mu] = 1;
72  if(req_comm == 0 && Communicator::npe(mu) == 1) do_comm[mu] = 0;
73  do_comm_any += do_comm[mu];
74  vout.general(m_vl, "do_comm[%d] = %d\n", mu, do_comm[mu]);
75  }
76 
77  m_Nbdsize.resize(m_Ndim);
78  int Nd2 = m_Nd/2;
79  m_Nbdsize[0] = Nvc * Nd2 * ceil_nwp(Ny * Nz * Nt);
80  m_Nbdsize[1] = Nvc * Nd2 * ceil_nwp(Nx * Nz * Nt);
81  m_Nbdsize[2] = Nvc * Nd2 * ceil_nwp(Nx * Ny * Nt);
82  m_Nbdsize[3] = Nvc * Nd2 * ceil_nwp(Nx * Ny * Nz);
83 
84  setup_channels();
85 
86  // gauge configuration.
87  m_U.reset(Ndf, m_Nst, m_Ndim);
88 
89  // working vectors.
90  int NinF = 2 * m_Nc * m_Nd;
91  m_v2.reset(NinF, m_Nst, 1);
92 
93  set_parameters(params);
94 
96  vout.general(m_vl, "%s: construction finished.\n",
97  class_name.c_str());
98 }
99 
100 //====================================================================
101 template<typename AFIELD>
103 {
105 
106  chsend_up.resize(m_Ndim);
107  chrecv_up.resize(m_Ndim);
108  chsend_dn.resize(m_Ndim);
109  chrecv_dn.resize(m_Ndim);
110 
111  for(int mu = 0; mu < m_Ndim; ++mu){
112 
113  int Nvsize = m_Nbdsize[mu] * sizeof(real_t);
114 
115  chsend_dn[mu].send_init(Nvsize, mu, -1);
116  chsend_up[mu].send_init(Nvsize, mu, 1);
117 #ifdef USE_MPI
118  chrecv_up[mu].recv_init(Nvsize, mu, 1);
119  chrecv_dn[mu].recv_init(Nvsize, mu, -1);
120 #else
121  void* buf_up = (void*)chsend_dn[mu].ptr();
122  chrecv_up[mu].recv_init(Nvsize, mu, 1, buf_up);
123  void* buf_dn = (void*)chsend_up[mu].ptr();
124  chrecv_dn[mu].recv_init(Nvsize, mu, -1, buf_dn);
125 #endif
126 
127  if(do_comm[mu] == 1){
128  chset_send.append(chsend_up[mu]);
129  chset_send.append(chsend_dn[mu]);
130  chset_recv.append(chrecv_up[mu]);
131  chset_recv.append(chrecv_dn[mu]);
132  }
133 
134  // openacc device memory allocation
135 #ifdef USE_MPI
136  real_t* buf_dn1 = (real_t*)chsend_dn[mu].ptr();
137  real_t* buf_dn2 = (real_t*)chrecv_dn[mu].ptr();
138  real_t* buf_up1 = (real_t*)chsend_up[mu].ptr();
139  real_t* buf_up2 = (real_t*)chrecv_up[mu].ptr();
140  BridgeACC::afield_init(buf_dn1, m_Nbdsize[mu]);
141  BridgeACC::afield_init(buf_dn2, m_Nbdsize[mu]);
142  BridgeACC::afield_init(buf_up1, m_Nbdsize[mu]);
143  BridgeACC::afield_init(buf_up2, m_Nbdsize[mu]);
144 #else
145  BridgeACC::afield_init((real_t*)buf_up, m_Nbdsize[mu]);
146  BridgeACC::afield_init((real_t*)buf_dn, m_Nbdsize[mu]);
147 #endif
148 
149  }
150 
151 }
152 
153 //====================================================================
154 template<typename AFIELD>
156 {
158 
159  // openacc device memory clean up
160  for(int mu = 0; mu < m_Ndim; ++mu){
161 
162 #ifdef USE_MPI
163  real_t* buf_dn1 = (real_t*)chsend_dn[mu].ptr();
164  real_t* buf_dn2 = (real_t*)chrecv_dn[mu].ptr();
165  real_t* buf_up1 = (real_t*)chrecv_up[mu].ptr();
166  real_t* buf_up2 = (real_t*)chsend_up[mu].ptr();
167  BridgeACC::afield_tidyup(buf_dn1, m_Nbdsize[mu]);
168  BridgeACC::afield_tidyup(buf_dn2, m_Nbdsize[mu]);
169  BridgeACC::afield_tidyup(buf_up1, m_Nbdsize[mu]);
170  BridgeACC::afield_tidyup(buf_up2, m_Nbdsize[mu]);
171 #else
172  real_t* buf_up = (real_t*)chsend_up[mu].ptr();
173  real_t* buf_dn = (real_t*)chsend_dn[mu].ptr();
174  BridgeACC::afield_tidyup(buf_up, m_Nbdsize[mu]);
175  BridgeACC::afield_tidyup(buf_dn, m_Nbdsize[mu]);
176 #endif
177 
178  }
179 
180 }
181 
182 //====================================================================
183 template<typename AFIELD>
185 {
186 #pragma omp barrier
187 
188  std::string vlevel;
189  if (!params.fetch_string("verbose_level", vlevel)) {
190  m_vl = vout.set_verbose_level(vlevel);
191  }
192 
193  //- fetch and check input parameters
194  double kappa;
195  std::vector<int> bc;
196 
197  int err = 0;
198  err += params.fetch_double("hopping_parameter", kappa);
199  err += params.fetch_int_vector("boundary_condition", bc);
200  if (err) {
201  vout.crucial(m_vl, "Error at %s: input parameter not found.\n",
202  class_name.c_str());
203  exit(EXIT_FAILURE);
204  }
205 
206  //- setting gamma matrix representation
207  std::string repr;
208  err = params.fetch_string("gamma_matrix_type", repr);
209  if(err){
210  vout.general(m_vl, " gamma_matrix_type is not given - set to Dirac\n");
211  m_repr = DIRAC;
212  }else if(repr == "Dirac"){
213  m_repr = DIRAC;
214  }else if(repr == "Chiral"){
215  m_repr = CHIRAL;
216  }else{
217  vout.crucial(m_vl, "Error in %s: irrelevant gamma_matrix_type: %s\n",
218  class_name.c_str(), repr.c_str());
219  exit(EXIT_FAILURE);
220  }
221 
222  set_parameters(real_t(kappa), bc);
223 
224 }
225 
226 //====================================================================
227 template<typename AFIELD>
229  const std::vector<int> bc)
230 {
231  assert(bc.size() == m_Ndim);
232 
233 #pragma omp barrier
234 
235  int ith = ThreadManager::get_thread_id();
236 
237  if (ith == 0) {
238  m_CKs = CKs;
239  m_boundary.resize(m_Ndim);
240  for (int mu = 0; mu < m_Ndim; ++mu) {
241  m_boundary[mu] = bc[mu];
242  }
243 
244  for (int mu = 0; mu < m_Ndim; ++mu) {
245  m_bc[mu] = 1;
246  if(do_comm[mu] > 0){ // do communication
247  if(Communicator::ipe(mu) == 0) m_bc[mu] = m_boundary[mu];
248  m_bc2[mu] = 0;
249  }else{ // no communication
250  m_bc[mu] = 0; // for boundary part (dummy)
251  m_bc2[mu] = m_boundary[mu]; // for bulk part
252  }
253  }
254  }
255 #pragma omp barrier
256 
257  //- print input parameters
258  vout.general(m_vl, "%s: input parameters\n", class_name.c_str());
259  if(m_repr == DIRAC){
260  vout.general(m_vl, " gamma-matrix type = Dirac\n");
261  }else{
262  vout.general(m_vl, " gamma-matrix type = Chiral\n");
263  }
264  vout.general(m_vl, " kappa = %8.4f\n", m_CKs);
265  for (int mu = 0; mu < m_Ndim; ++mu) {
266  vout.general(m_vl, " boundary[%d] = %2d\n", mu, m_boundary[mu]);
267  }
268 
269 #pragma omp barrier
270 }
271 
272 //====================================================================
273 template<typename AFIELD>
275 {
276  int nth = ThreadManager::get_num_threads();
277 
278  vout.paranoiac(m_vl, "%s: set_config is called: num_threads = %d\n",
279  class_name.c_str(), nth);
280 
281  if (nth > 1) {
282  set_config_impl(u);
283  } else {
284  set_config_omp(u);
285  }
286 
287  vout.paranoiac(m_vl, "%s: set_config finished\n", class_name.c_str());
288 }
289 
290 //====================================================================
291 template<typename AFIELD>
293 {
294  vout.paranoiac(m_vl, " set_config_omp is called.\n");
295 
296 #pragma omp parallel
297  {
298  set_config_impl(u);
299  }
300 
301 }
302 
303 //====================================================================
304 template<typename AFIELD>
306 {
307 #pragma omp barrier
308 
309  int ith = ThreadManager::get_thread_id();
310 
311  if (ith == 0) m_conf = u;
312 
314 
315  convert_gauge(index_lex, m_U, *u);
316 
317 }
318 
319 //====================================================================
320 template<typename AFIELD>
322 {
323  params.set_double("hopping_parameter", double(m_CKs));
324  params.set_int_vector("boundary_condition", m_boundary);
325 
326  std::string repr;
327  if(m_repr == DIRAC) repr = "Dirac";
328  if(m_repr == CHIRAL) repr = "Chiral";
329  params.set_string("gamma_matrix_type", repr);
330 
331  params.set_string("verbose_level", vout.get_verbose_level(m_vl));
332 }
333 
334 
335 //====================================================================
336 template<typename AFIELD>
337 void AFopr_Wilson<AFIELD>::set_mode(std::string mode)
338 {
339 #pragma omp barrier
340 
341  int ith = ThreadManager::get_thread_id();
342  if (ith == 0) m_mode = mode;
343 
344 #pragma omp barrier
345 }
346 
347 //====================================================================
348 template<typename AFIELD>
350 {
351  if (m_mode == "D") {
352  mult_D(v, w);
353  // mult_D_alt(v, w);
354  } else if (m_mode == "DdagD") {
355  mult_DdagD(v, w);
356  } else if (m_mode == "Ddag") {
357  mult_Ddag(v, w);
358  } else if (m_mode == "H") {
359  mult_H(v, w);
360  } else {
361  vout.crucial(m_vl, "%s: undefined mode = %s\n",
362  class_name.c_str(), m_mode.c_str());
363  exit(EXIT_FAILURE);
364  }
365 
366 }
367 
368 //====================================================================
369 template<typename AFIELD>
371 {
372  if (m_mode == "D") {
373  mult_Ddag(v, w);
374  } else if (m_mode == "DdagD") {
375  mult_DdagD(v, w);
376  } else if (m_mode == "Ddag") {
377  mult_D(v, w);
378  } else if (m_mode == "H") {
379  mult_H(v, w);
380  } else {
381  vout.crucial(m_vl, "%s: undefined mode = %s\n",
382  class_name.c_str(), m_mode.c_str());
383  exit(EXIT_FAILURE);
384  }
385 
386 }
387 
388 //====================================================================
389 template<typename AFIELD>
391  const std::string mode)
392 {
393  if(mode == "D"){
394  mult_D(v, w);
395  }else if(mode == "Ddag"){
396  mult_Ddag(v, w);
397  }else if(mode == "DdagD"){
398  mult_DdagD(v, w);
399  }else if(mode == "H"){
400  mult_H(v, w);
401  }else{
402  vout.crucial(m_vl, "%s: illegal mode is given to mult with mode\n",
403  class_name.c_str());
404  exit(EXIT_FAILURE);
405  }
406 
407 }
408 
409 //====================================================================
410 template<typename AFIELD>
412  const std::string mode)
413 {
414  if(mode == "D"){
415  mult_Ddag(v, w);
416  }else if(mode == "Ddag"){
417  mult_D(v, w);
418  }else if(mode == "DdagD"){
419  mult_DdagD(v, w);
420  }else if(mode == "H"){
421  mult_H(v, w);
422  }else{
423  vout.crucial(m_vl, "%s: illegal mode is given to mult with mode\n",
424  class_name.c_str());
425  exit(EXIT_FAILURE);
426  }
427 
428 }
429 
430 //====================================================================
431 template<typename AFIELD>
433 {
434 #pragma omp barrier
435 
436  int ith = ThreadManager::get_thread_id();
437 
438  if (ith == 0){
439  real_t* vp = v.ptr(0);
440  real_t* wp = const_cast<AFIELD*>(&w)->ptr(0);
441 
442  if(m_repr == DIRAC){
443  BridgeACC::mult_wilson_gm5_dirac(vp, wp, m_Nsize, NC);
444  }else{
445  BridgeACC::mult_wilson_gm5_chiral(vp, wp, m_Nsize, NC);
446  }
447  }
448 
449 #pragma omp barrier
450 }
451 
452 //====================================================================
453 template<typename AFIELD>
455 {
456  mult_DorH(v, w, 0); // D
457 }
458 
459 //====================================================================
460 template<typename AFIELD>
462 {
463  mult_DorH(m_v2, w, 1); // H
464  mult_DorH(v, m_v2, 1); // H
465 }
466 
467 //====================================================================
468 template<typename AFIELD>
470 {
471  mult_gm5(m_v2, w);
472  mult_DorH(v, m_v2, 1); // H
473 }
474 
475 //====================================================================
476 template<typename AFIELD>
478 {
479  mult_DorH(v, w, 1); // H
480 }
481 
482 //====================================================================
483 template<typename AFIELD>
485 {
486  mult_D_alt(m_v2, w);
487  mult_gm5(v, m_v2);
488 }
489 
490 //====================================================================
491 template<typename AFIELD>
493  const int flag)
494 {
495 #pragma omp barrier
496 
497  int ith, nth, ith_kernel;
498  set_kernel_thread(ith, nth, ith_kernel);
499 
500  real_t *v2 = v.ptr(0);
501  real_t *v1 = const_cast<AFIELD*>(&w)->ptr(0);
502  real_t *u = m_U.ptr(0);
503 
504  if (do_comm_any > 0 && ith == ith_kernel){
505 
506  real_t *buf1xp = (real_t*)chsend_dn[0].ptr();
507  real_t *buf1xm = (real_t*)chsend_up[0].ptr();
508 
509  real_t *buf1yp = (real_t*)chsend_dn[1].ptr();
510  real_t *buf1ym = (real_t*)chsend_up[1].ptr();
511 
512  real_t *buf1zp = (real_t*)chsend_dn[2].ptr();
513  real_t *buf1zm = (real_t*)chsend_up[2].ptr();
514 
515  real_t *buf1tp = (real_t*)chsend_dn[3].ptr();
516  real_t *buf1tm = (real_t*)chsend_up[3].ptr();
517 
518  if(m_repr == DIRAC){
520  buf1xp, buf1xm, buf1yp, buf1ym,
521  buf1zp, buf1zm, buf1tp, buf1tm,
522  u, v1, m_Nsize, m_bc, do_comm);
523  }else{
525  buf1xp, buf1xm, buf1yp, buf1ym,
526  buf1zp, buf1zm, buf1tp, buf1tm,
527  u, v1, m_Nsize, m_bc, do_comm);
528  }
529 
530  }
531 #pragma omp barrier
532 
533  if(do_comm_any > 0 && ith == 0){
534  chset_recv.start();
535  chset_send.start();
536  }
537 
538  // bulk part
539  if (ith == ith_kernel){
540  if(m_repr == DIRAC){
542  m_CKs, m_Nsize, m_bc2, flag);
543  }else{
545  m_CKs, m_Nsize, m_bc2, flag);
546  }
547  }
548 
549  if(do_comm_any > 0 && ith == 0){
550  chset_send.wait();
551  chset_recv.wait();
552  }
553 #pragma omp barrier
554 
555  if(do_comm_any > 0 && ith == ith_kernel){
556 
557  real_t *buf2xp = (real_t*)chrecv_up[0].ptr();
558  real_t *buf2xm = (real_t*)chrecv_dn[0].ptr();
559  real_t *buf2yp = (real_t*)chrecv_up[1].ptr();
560  real_t *buf2ym = (real_t*)chrecv_dn[1].ptr();
561  real_t *buf2zp = (real_t*)chrecv_up[2].ptr();
562  real_t *buf2zm = (real_t*)chrecv_dn[2].ptr();
563  real_t *buf2tp = (real_t*)chrecv_up[3].ptr();
564  real_t *buf2tm = (real_t*)chrecv_dn[3].ptr();
565 
566  if(m_repr == DIRAC){
568  buf2xp, buf2xm, buf2yp, buf2ym,
569  buf2zp, buf2zm, buf2tp, buf2tm,
570  m_CKs, m_Nsize, m_bc, do_comm, flag);
571  }else{
573  buf2xp, buf2xm, buf2yp, buf2ym,
574  buf2zp, buf2zm, buf2tp, buf2tm,
575  m_CKs, m_Nsize, m_bc, do_comm, flag);
576  }
577 
578  }
579 #pragma omp barrier
580 
581 }
582 
583 //====================================================================
584 template<typename AFIELD>
586 {
587 #pragma omp barrier
588 
589  real_t *vp = v.ptr(0);
590  real_t *wp = const_cast<AFIELD*>(&w)->ptr(0);
591 
592  v.set(real_t(0.0));
593  mult_xp(vp, wp);
594  mult_xm(vp, wp);
595  mult_yp(vp, wp);
596  mult_ym(vp, wp);
597  mult_zp(vp, wp);
598  mult_zm(vp, wp);
599  mult_tp(vp, wp);
600  mult_tm(vp, wp);
601  aypx(-m_CKs, v, w);
602 
603 #pragma omp barrier
604 }
605 
606 //====================================================================
607 template<typename AFIELD>
608 void AFopr_Wilson<AFIELD>::mult_up(int mu, AFIELD &v, const AFIELD &w)
609 {
610  real_t *vp = v.ptr(0);
611  real_t *wp = const_cast<AFIELD*>(&w)->ptr(0);
612 
613  if(mu == 0){
614  mult_xp(vp, wp);
615  }else if(mu == 1){
616  mult_yp(vp, wp);
617  }else if(mu == 2){
618  mult_zp(vp, wp);
619  }else if(mu == 3){
620  mult_tp(vp, wp);
621  }else{
622  vout.crucial(m_vl, "%s: mult_up for %d direction is undefined.",
623  class_name.c_str(), mu);
624  exit(EXIT_FAILURE);
625  }
626 
627 }
628 
629 //====================================================================
630 template<typename AFIELD>
631 void AFopr_Wilson<AFIELD>::mult_dn(int mu, AFIELD &v, const AFIELD &w)
632 {
633  real_t *vp = v.ptr(0);
634  real_t *wp = const_cast<AFIELD*>(&w)->ptr(0);
635 
636  if(mu == 0){
637  mult_xm(vp, wp);
638  }else if(mu == 1){
639  mult_ym(vp, wp);
640  }else if(mu == 2){
641  mult_zm(vp, wp);
642  }else if(mu == 3){
643  mult_tm(vp, wp);
644  }else{
645  vout.crucial(m_vl, "%s: mult_dn for %d direction is undefined.",
646  class_name.c_str(), mu);
647  exit(EXIT_FAILURE);
648  }
649 
650 }
651 
652 //====================================================================
653 template<typename AFIELD>
655 {
656 #pragma omp barrier
657 
658  int idir = 0;
659 
661 
662  real_t *buf1 = (real_t*)chsend_dn[idir].ptr();
663  real_t *buf2 = (real_t*)chrecv_up[idir].ptr();
664  real_t *u = m_U.ptr(index_lex.idx_G(0, 0, idir));
665 
666  int ith, nth, ith_kernel;
667  set_kernel_thread(ith, nth, ith_kernel);
668 
669  if(do_comm[idir] > 0 && ith == ith_kernel){
670  BridgeACC::mult_wilson_xp1(buf1, v1, m_Nsize, m_bc, NC);
671  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
672  }
673 
674 #pragma omp barrier
675 
676  if(do_comm[idir] > 0 && ith == 0){
677  chrecv_up[idir].start();
678  chsend_dn[idir].start();
679  }
680 
681  // bulk part
682  if(ith == ith_kernel){
683  BridgeACC::mult_wilson_xpb(v2, u, v1, m_Nsize, m_bc2, NC);
684  }
685 
686  if(do_comm[idir] > 0 && ith == 0){
687  chsend_dn[idir].wait();
688  chrecv_up[idir].wait();
689  }
690 
691 #pragma omp barrier
692 
693  if(do_comm[idir] > 0 && ith == ith_kernel){
694  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
695  BridgeACC::mult_wilson_xp2(v2, u, buf2, m_Nsize, m_bc, NC);
696  }
697 
698 #pragma omp barrier
699 
700 }
701 
702 //====================================================================
703 template<typename AFIELD>
705 {
706 #pragma omp barrier
707 
708  int idir = 0;
709 
711 
712  real_t *buf1 = (real_t*)chsend_up[idir].ptr();
713  real_t *buf2 = (real_t*)chrecv_dn[idir].ptr();
714  real_t *u = m_U.ptr(index_lex.idx_G(0, 0, idir));
715 
716  int ith, nth, ith_kernel;
717  set_kernel_thread(ith, nth, ith_kernel);
718 
719  if(do_comm[idir] > 0 && ith == ith_kernel){
720  BridgeACC::mult_wilson_xm1(buf1, u, v1, m_Nsize, m_bc, NC);
721  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
722  }
723 
724 #pragma omp barrier
725 
726  if(do_comm[idir] > 0 && ith == 0){
727  chrecv_dn[idir].start();
728  chsend_up[idir].start();
729  }
730 
731  // bulk part
732  if(ith == ith_kernel){
733  BridgeACC::mult_wilson_xmb(v2, u, v1, m_Nsize, m_bc2, NC);
734  }
735 
736  if(do_comm[idir] > 0 && ith == 0){
737  chsend_up[idir].wait();
738  chrecv_dn[idir].wait();
739  }
740 
741 #pragma omp barrier
742 
743  if(do_comm[idir] > 0 && ith == ith_kernel){
744  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
745  BridgeACC::mult_wilson_xm2(v2, buf2, m_Nsize, m_bc, NC);
746  }
747 
748 #pragma omp barrier
749 
750 }
751 
752 //====================================================================
753 template<typename AFIELD>
755 {
756 #pragma omp barrier
757 
758  int idir = 1;
759 
761 
762  real_t *buf1 = (real_t*)chsend_dn[idir].ptr();
763  real_t *buf2 = (real_t*)chrecv_up[idir].ptr();
764  real_t *u = m_U.ptr(index_lex.idx_G(0, 0, idir));
765 
766  int ith, nth, ith_kernel;
767  set_kernel_thread(ith, nth, ith_kernel);
768 
769  if(do_comm[idir] > 0 && ith == ith_kernel){
770  BridgeACC::mult_wilson_yp1(buf1, v1, m_Nsize, m_bc, NC);
771  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
772  }
773 
774 #pragma omp barrier
775 
776  if(do_comm[idir] > 0 && ith == 0){
777  chrecv_up[idir].start();
778  chsend_dn[idir].start();
779  }
780 
781  // bulk part
782  if(ith == ith_kernel){
783  BridgeACC::mult_wilson_ypb(v2, u, v1, m_Nsize, m_bc2, NC);
784  }
785 
786  if(do_comm[idir] > 0 && ith == 0){
787  chsend_dn[idir].wait();
788  chrecv_up[idir].wait();
789  }
790 #pragma omp barrier
791 
792  if(do_comm[idir] > 0 && ith == ith_kernel){
793  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
794  BridgeACC::mult_wilson_yp2(v2, u, buf2, m_Nsize, m_bc, NC);
795  }
796 
797 #pragma omp barrier
798 
799 }
800 
801 //====================================================================
802 template<typename AFIELD>
804 {
805 #pragma omp barrier
806 
807  int idir = 1;
808 
810 
811  real_t *buf1 = (real_t*)chsend_up[idir].ptr();
812  real_t *buf2 = (real_t*)chrecv_dn[idir].ptr();
813  real_t *u = m_U.ptr(index_lex.idx_G(0, 0, idir));
814 
815  int ith, nth, ith_kernel;
816  set_kernel_thread(ith, nth, ith_kernel);
817 
818  if(do_comm[idir] > 0 && ith == ith_kernel){
819  BridgeACC::mult_wilson_ym1(buf1, u, v1, m_Nsize, m_bc, NC);
820  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
821  }
822 
823 #pragma omp barrier
824 
825  if(do_comm[idir] > 0 && ith == 0){
826  chrecv_dn[idir].start();
827  chsend_up[idir].start();
828  }
829 
830  // bulk part
831  if(ith == ith_kernel){
832  BridgeACC::mult_wilson_ymb(v2, u, v1, m_Nsize, m_bc2, NC);
833  }
834 
835  if(do_comm[idir] > 0 && ith == 0){
836  chsend_up[idir].wait();
837  chrecv_dn[idir].wait();
838  }
839 
840 #pragma omp barrier
841 
842  if(do_comm[idir] > 0 && ith == ith_kernel){
843  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
844  BridgeACC::mult_wilson_ym2(v2, buf2, m_Nsize, m_bc, NC);
845  }
846 
847 #pragma omp barrier
848 
849 }
850 
851 //====================================================================
852 template<typename AFIELD>
854 {
855 #pragma omp barrier
856 
857  int idir = 2;
858 
860 
861  real_t *buf1 = (real_t*)chsend_dn[idir].ptr();
862  real_t *buf2 = (real_t*)chrecv_up[idir].ptr();
863  real_t *u = m_U.ptr(index_lex.idx_G(0, 0, idir));
864 
865  int ith, nth, ith_kernel;
866  set_kernel_thread(ith, nth, ith_kernel);
867 
868  if(do_comm[idir] > 0 && ith == ith_kernel){
869  BridgeACC::mult_wilson_zp1(buf1, v1, m_Nsize, m_bc, NC);
870  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
871  }
872 
873 #pragma omp barrier
874 
875  if(do_comm[idir] > 0 && ith == 0){
876  chrecv_up[idir].start();
877  chsend_dn[idir].start();
878  }
879 
880  // bulk part
881  if(ith == ith_kernel){
882  BridgeACC::mult_wilson_zpb(v2, u, v1, m_Nsize, m_bc2, NC);
883  }
884 
885  if(do_comm[idir] > 0 && ith == 0){
886  chsend_dn[idir].wait();
887  chrecv_up[idir].wait();
888  }
889 
890 #pragma omp barrier
891 
892  if(do_comm[idir] > 0 && ith == ith_kernel){
893  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
894  BridgeACC::mult_wilson_zp2(v2, u, buf2, m_Nsize, m_bc, NC);
895  }
896 
897 #pragma omp barrier
898 
899 }
900 
901 //====================================================================
902 template<typename AFIELD>
904 {
905 #pragma omp barrier
906 
907  int idir = 2;
908 
910 
911  real_t *buf1 = (real_t*)chsend_up[idir].ptr();
912  real_t *buf2 = (real_t*)chrecv_dn[idir].ptr();
913  real_t *u = m_U.ptr(index_lex.idx_G(0, 0, idir));
914 
915  int ith, nth, ith_kernel;
916  set_kernel_thread(ith, nth, ith_kernel);
917 
918  if(do_comm[idir] > 0 && ith == ith_kernel){
919  BridgeACC::mult_wilson_zm1(buf1, u, v1, m_Nsize, m_bc, NC);
920  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
921  }
922 #pragma omp barrier
923 
924  if(do_comm[idir] > 0 && ith == 0){
925  chrecv_dn[idir].start();
926  chsend_up[idir].start();
927  }
928 
929  // bulk part
930  if(ith == ith_kernel){
931  BridgeACC::mult_wilson_zmb(v2, u, v1, m_Nsize, m_bc2, NC);
932  }
933 
934  if(do_comm[idir] > 0 && ith == 0){
935  chsend_up[idir].wait();
936  chrecv_dn[idir].wait();
937  }
938 
939 #pragma omp barrier
940 
941  if(do_comm[idir] > 0 && ith == ith_kernel){
942  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
943  BridgeACC::mult_wilson_zm2(v2, buf2, m_Nsize, m_bc, NC);
944  }
945 
946 #pragma omp barrier
947 
948 }
949 
950 //====================================================================
951 template<typename AFIELD>
953 {
954 #pragma omp barrier
955 
956  int idir = 3;
957 
959 
960  real_t *buf1 = (real_t*)chsend_dn[idir].ptr();
961  real_t *buf2 = (real_t*)chrecv_up[idir].ptr();
962  real_t *u = m_U.ptr(index_lex.idx_G(0, 0, idir));
963 
964  int ith, nth, ith_kernel;
965  set_kernel_thread(ith, nth, ith_kernel);
966 
967  if(do_comm[idir] > 0 && ith == ith_kernel){
968  if(m_repr == DIRAC){
969  BridgeACC::mult_wilson_tp1_dirac(buf1, v1, m_Nsize, m_bc, NC);
970  }else{
971  BridgeACC::mult_wilson_tp1_chiral(buf1, v1, m_Nsize, m_bc, NC);
972  }
973  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
974  }
975 
976 #pragma omp barrier
977 
978  if(do_comm[idir] > 0 && ith == 0){
979  chrecv_up[idir].start();
980  chsend_dn[idir].start();
981  }
982 
983  // bulk part
984  if(ith == ith_kernel){
985  if(m_repr == DIRAC){
986  BridgeACC::mult_wilson_tpb_dirac(v2, u, v1, m_Nsize, m_bc2, NC);
987  }else{
988  BridgeACC::mult_wilson_tpb_chiral(v2, u, v1, m_Nsize, m_bc2, NC);
989  }
990  }
991 
992  if(do_comm[idir] > 0 && ith == 0){
993  chsend_dn[idir].wait();
994  chrecv_up[idir].wait();
995  }
996 
997 #pragma omp barrier
998 
999  if(do_comm[idir] > 0 && ith == ith_kernel){
1000  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
1001  if(m_repr == DIRAC){
1002  BridgeACC::mult_wilson_tp2_dirac(v2, u, buf2, m_Nsize, m_bc, NC);
1003  }else{
1004  BridgeACC::mult_wilson_tp2_chiral(v2, u, buf2, m_Nsize, m_bc, NC);
1005  }
1006  }
1007 
1008 #pragma omp barrier
1009 
1010 }
1011 
1012 //====================================================================
1013 template<typename AFIELD>
1015 {
1016 #pragma omp barrier
1017 
1018  int idir = 3;
1019 
1020  int ith, nth, ith_kernel;
1021  set_kernel_thread(ith, nth, ith_kernel);
1022 
1024 
1025  real_t *buf1 = (real_t*)chsend_up[idir].ptr();
1026  real_t *buf2 = (real_t*)chrecv_dn[idir].ptr();
1027  real_t *u = m_U.ptr(index_lex.idx_G(0, 0, idir));
1028 
1029  if(do_comm[idir] > 0 && ith == ith_kernel){
1030  if(m_repr == DIRAC){
1031  BridgeACC::mult_wilson_tm1_dirac(buf1, u, v1, m_Nsize, m_bc, NC);
1032  }else{
1033  BridgeACC::mult_wilson_tm1_chiral(buf1, u, v1, m_Nsize, m_bc, NC);
1034  }
1035  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
1036  }
1037 
1038 #pragma omp barrier
1039 
1040  if(do_comm[idir] > 0 && ith == 0){
1041  chrecv_dn[idir].start();
1042  chsend_up[idir].start();
1043  }
1044 
1045  // bulk part
1046  if(ith == ith_kernel){
1047  if(m_repr == DIRAC){
1048  BridgeACC::mult_wilson_tmb_dirac(v2, u, v1, m_Nsize, m_bc2, NC);
1049  }else{
1050  BridgeACC::mult_wilson_tmb_chiral(v2, u, v1, m_Nsize, m_bc2, NC);
1051  }
1052  }
1053 
1054  if(do_comm[idir] > 0 && ith == 0){
1055  chsend_up[idir].wait();
1056  chrecv_dn[idir].wait();
1057  }
1058 
1059 #pragma omp barrier
1060 
1061  if(do_comm[idir] > 0 && ith == ith_kernel){
1062  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
1063  if(m_repr == DIRAC){
1064  BridgeACC::mult_wilson_tm2_dirac(v2, buf2, m_Nsize, m_bc, NC);
1065  }else{
1066  BridgeACC::mult_wilson_tm2_chiral(v2, buf2, m_Nsize, m_bc, NC);
1067  }
1068  }
1069 
1070 #pragma omp barrier
1071 
1072 }
1073 
1074 //====================================================================
1075 template<typename AFIELD>
1077 {
1078  return flop_count(m_mode);
1079 }
1080 
1081 //====================================================================
1082 template<typename AFIELD>
1083 double AFopr_Wilson<AFIELD>::flop_count(const std::string mode)
1084 {
1085  // The following flop counting adopts the original nmuber of the
1086  // arithmetic operations, while the kernel code may employ the SU(3)
1087  // third row reconstruction. This aims at comparison to the codes
1088  // in other branches. [14 Feb 2025 H.M.]
1089 
1090  int Lvol = CommonParameters::Lvol();
1091  double flop_site, flop;
1092 
1093  if (m_repr == DIRAC) {
1094  flop_site = static_cast<double>(
1095  m_Nc * m_Nd * (4 + 6 * (4 * m_Nc + 2) + 2 * (4 * m_Nc + 1)));
1096  } else if (m_repr == CHIRAL) {
1097  flop_site = static_cast<double>(
1098  m_Nc * m_Nd * (4 + 8 * (4 * m_Nc + 2)));
1099  } else {
1100  vout.crucial(m_vl, "%s: gamma matrix repr is undefined.\n",
1101  class_name.c_str());
1102  exit(EXIT_FAILURE);
1103  }
1104 
1105  flop = flop_site * static_cast<double>(Lvol);
1106  if ((mode == "DdagD") || (mode == "DDdag")) flop *= 2.0;
1107 
1108  return flop;
1109 }
1110 
1111 //============================================================END=====
AFopr_Wilson::mult_xm
void mult_xm(real_t *, real_t *)
Definition: afopr_Wilson-tmpl.h:704
AFopr_Wilson::mult_DorH
void mult_DorH(AFIELD &, const AFIELD &, const int flag)
Definition: afopr_Wilson-tmpl.h:492
CommonParameters::Ny
static int Ny()
Definition: commonParameters.h:106
BridgeACC::mult_wilson_tmb_chiral
void mult_wilson_tmb_chiral(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1956
CommonParameters::Nz
static int Nz()
Definition: commonParameters.h:107
bridgeIO.h
AFopr_Wilson::mult_tm
void mult_tm(real_t *, real_t *)
Definition: afopr_Wilson-tmpl.h:1014
CommonParameters::Lvol
static long_t Lvol()
Definition: commonParameters.h:95
convert_gauge
void convert_gauge(INDEX &index, AFIELD &v, const Field &w)
Definition: afield-inc.h:223
BridgeACC::mult_wilson_yp2
void mult_wilson_yp2(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:467
BridgeACC::mult_wilson_gm5_chiral
void mult_wilson_gm5_chiral(double *RESTRICT v2, double *RESTRICT v1, int *Nsize, int Nc)
Definition: mult_Wilson_openacc-inc.h:49
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
AFopr_Wilson::mult_xp
void mult_xp(real_t *, real_t *)
Definition: afopr_Wilson-tmpl.h:654
ThreadManager::get_num_threads
static int get_num_threads()
returns available number of threads.
Definition: threadManager.cpp:246
CommonParameters::Ndim
static int Ndim()
Definition: commonParameters.h:117
BridgeACC::afield_tidyup
void afield_tidyup(double *data, const int size)
AFopr_Wilson::mult_dag
void mult_dag(AFIELD &, const AFIELD &)
hermitian conjugate of mult.
Definition: afopr_Wilson-tmpl.h:370
Field::set
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:175
Parameters
Class for parameters.
Definition: parameters.h:46
AIndex_lex
Definition: aindex_lex_base.h:17
BridgeACC::mult_wilson_xpb
void mult_wilson_xpb(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:130
Parameters::set_double
void set_double(const string &key, const double value)
Definition: parameters.cpp:33
Bridge::BridgeIO::decrease_indent
void decrease_indent()
Definition: bridgeIO.cpp:518
AFopr_Wilson::mult_D
void mult_D(AFIELD &, const AFIELD &)
Definition: afopr_Wilson-tmpl.h:454
AFopr_Wilson::set_mode
void set_mode(std::string mode)
setting mult mode.
Definition: afopr_Wilson-tmpl.h:337
AFopr_Wilson::mult_D_alt
void mult_D_alt(AFIELD &, const AFIELD &)
Definition: afopr_Wilson-tmpl.h:585
AFopr_Wilson::mult_gm5
void mult_gm5(AFIELD &, const AFIELD &)
multiplies gamma_5 matrix.
Definition: afopr_Wilson-tmpl.h:432
BridgeACC::mult_wilson_D_dirac
void mult_wilson_D_dirac(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, double kappa, int *Nsize, int *bc, int flag)
Definition: mult_Wilson_openacc-inc.h:76
AFopr_Wilson::mult_dn
virtual void mult_dn(int mu, AFIELD &, const AFIELD &)
downward nearest neighbor hopping term.
Definition: afopr_Wilson-tmpl.h:631
Bridge::BridgeIO::increase_indent
void increase_indent()
Definition: bridgeIO.cpp:508
BridgeACC::mult_wilson_xm2
void mult_wilson_xm2(double *RESTRICT v2, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:282
AFopr_Wilson::mult_zm
void mult_zm(real_t *, real_t *)
Definition: afopr_Wilson-tmpl.h:903
BridgeACC::mult_wilson_gm5_dirac
void mult_wilson_gm5_dirac(double *RESTRICT v2, double *RESTRICT v1, int *Nsize, int Nc)
Definition: mult_Wilson_openacc-inc.h:22
AFopr_Wilson::set_parameters
void set_parameters(const Parameters &params)
setting parameters by a Parameter object.
Definition: afopr_Wilson-tmpl.h:184
CommonParameters::Nvol
static int Nvol()
Definition: commonParameters.h:109
BridgeACC::mult_wilson_yp1
void mult_wilson_yp1(double *RESTRICT buf, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:414
aypx
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
Definition: field.cpp:510
AFopr_Wilson::mult_yp
void mult_yp(real_t *, real_t *)
Definition: afopr_Wilson-tmpl.h:754
AFopr_Wilson::mult_up
virtual void mult_up(int mu, AFIELD &, const AFIELD &)
upward nearest neighbor hopping term.
Definition: afopr_Wilson-tmpl.h:608
BridgeACC::mult_wilson_1_dirac
void mult_wilson_1_dirac(double *RESTRICT buf_xp, double *RESTRICT buf_xm, double *RESTRICT buf_yp, double *RESTRICT buf_ym, double *RESTRICT buf_zp, double *RESTRICT buf_zm, double *RESTRICT buf_tp, double *RESTRICT buf_tm, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int *do_comm)
Definition: mult_Wilson_openacc-inc.h:299
BridgeACC::copy_from_device
void copy_from_device(double *v, int nv)
BridgeACC::mult_wilson_zp1
void mult_wilson_zp1(double *RESTRICT buf, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:836
AFopr_Wilson::init
void init(const Parameters &params)
initial setup.
Definition: afopr_Wilson-tmpl.h:30
AFopr_Wilson::get_parameters
void get_parameters(Parameters &params) const
getting parameters as a Parameters object.
Definition: afopr_Wilson-tmpl.h:321
AFopr_Wilson::mult_Ddag
void mult_Ddag(AFIELD &, const AFIELD &)
Definition: afopr_Wilson-tmpl.h:469
BridgeACC::mult_wilson_tp2_dirac
void mult_wilson_tp2_dirac(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1311
AFopr_Wilson::mult_DdagD
void mult_DdagD(AFIELD &, const AFIELD &)
Definition: afopr_Wilson-tmpl.h:461
Bridge::BridgeIO::paranoiac
void paranoiac(const char *format,...)
Definition: bridgeIO.cpp:300
BridgeACC::mult_wilson_tm2_dirac
void mult_wilson_tm2_dirac(double *RESTRICT v2, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1522
BridgeACC::mult_wilson_tm2_chiral
void mult_wilson_tm2_chiral(double *RESTRICT v2, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1905
AFopr_Wilson::set_config
void set_config(Field *u)
setting gauge configuration.
Definition: afopr_Wilson-tmpl.h:274
CommonParameters::Nx
static int Nx()
Definition: commonParameters.h:105
BridgeACC::mult_wilson_tmb_dirac
void mult_wilson_tmb_dirac(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1569
BridgeACC::mult_wilson_xmb
void mult_wilson_xmb(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:334
idir
idir
Definition: mult_Domainwall_eo_xyz_openacc-inc.h:264
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
BridgeACC::mult_wilson_tp2_chiral
void mult_wilson_tp2_chiral(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1693
NC
#define NC
Definition: field_F_imp_SU2-inc.h:15
AFopr_Wilson::setup_channels
void setup_channels()
setup channels for communication.
Definition: afopr_Wilson-tmpl.h:102
BridgeACC::mult_wilson_xm1
void mult_wilson_xm1(double *RESTRICT buf, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:209
BridgeACC::mult_wilson_ym2
void mult_wilson_ym2(double *RESTRICT v2, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:696
AFopr_Wilson::mult_H
void mult_H(AFIELD &, const AFIELD &)
Definition: afopr_Wilson-tmpl.h:477
BridgeACC::mult_wilson_2_chiral
void mult_wilson_2_chiral(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT buf_xp, double *RESTRICT buf_xm, double *RESTRICT buf_yp, double *RESTRICT buf_ym, double *RESTRICT buf_zp, double *RESTRICT buf_zm, double *RESTRICT buf_tp, double *RESTRICT buf_tm, double kappa, int *Nsize, int *bc, int *do_comm, int flag)
Definition: mult_Wilson_openacc-inc.h:722
BridgeACC::mult_wilson_zpb
void mult_wilson_zpb(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:962
CommonParameters::Nt
static int Nt()
Definition: commonParameters.h:108
BridgeACC::mult_wilson_tpb_dirac
void mult_wilson_tpb_dirac(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1373
Parameters::fetch_int_vector
int fetch_int_vector(const string &key, vector< int > &value) const
Definition: parameters.cpp:429
Communicator::npe
static int npe(const int dir)
logical grid extent
Definition: communicator.cpp:112
AFopr_Wilson
Wilson fermion operator for Accel branch.
Definition: afopr_Wilson.h:33
AFopr_Wilson::mult_tp
void mult_tp(real_t *, real_t *)
Definition: afopr_Wilson-tmpl.h:952
AFopr_Wilson::real_t
AFIELD::real_t real_t
Definition: afopr_Wilson.h:36
AFopr_Wilson::mult_ym
void mult_ym(real_t *, real_t *)
Definition: afopr_Wilson-tmpl.h:803
BridgeACC::mult_wilson_tm1_dirac
void mult_wilson_tm1_dirac(double *RESTRICT buf, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1450
BridgeACC::mult_wilson_zmb
void mult_wilson_zmb(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1177
BridgeACC::mult_wilson_tp1_dirac
void mult_wilson_tp1_dirac(double *RESTRICT buf, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1261
Parameters::set_int_vector
void set_int_vector(const string &key, const vector< int > &value)
Definition: parameters.cpp:45
BridgeACC::mult_wilson_xp2
void mult_wilson_xp2(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:64
real_t
double real_t
Definition: bridgeACC_AField_double.cpp:14
BridgeACC::mult_wilson_ypb
void mult_wilson_ypb(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:537
AFopr_Wilson::set_config_omp
void set_config_omp(Field *u)
Definition: afopr_Wilson-tmpl.h:292
Field::ptr
const double * ptr(const int jin, const int site, const int jex) const
Definition: field.h:153
BridgeACC::mult_wilson_zm2
void mult_wilson_zm2(double *RESTRICT v2, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1121
CommonParameters::Nd
static int Nd()
Definition: commonParameters.h:116
CommonParameters::Vlevel
static Bridge::VerboseLevel Vlevel()
Definition: commonParameters.h:122
BridgeACC::mult_wilson_ymb
void mult_wilson_ymb(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:752
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:195
AFopr_Wilson::set_config_impl
void set_config_impl(Field *u)
Definition: afopr_Wilson-tmpl.h:305
AFopr_Wilson::tidyup
void tidyup()
final tidy-up.
Definition: afopr_Wilson-tmpl.h:155
BridgeACC::mult_wilson_zp2
void mult_wilson_zp2(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT buf, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:891
Communicator::ipe
static int ipe(const int dir)
logical coordinate of current proc.
Definition: communicator.cpp:105
BridgeACC::mult_wilson_1_chiral
void mult_wilson_1_chiral(double *RESTRICT buf_xp, double *RESTRICT buf_xm, double *RESTRICT buf_yp, double *RESTRICT buf_ym, double *RESTRICT buf_zp, double *RESTRICT buf_zm, double *RESTRICT buf_tp, double *RESTRICT buf_tm, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int *do_comm)
Definition: mult_Wilson_openacc-inc.h:431
BridgeACC::mult_wilson_ym1
void mult_wilson_ym1(double *RESTRICT buf, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:621
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
Parameters::fetch_double
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
AFopr_Wilson::flop_count
double flop_count()
returns floating operation counts.
Definition: afopr_Wilson-tmpl.h:1076
commonParameters.h
AFopr_Wilson::mult_H_alt
void mult_H_alt(AFIELD &, const AFIELD &)
Definition: afopr_Wilson-tmpl.h:484
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:242
BridgeACC::mult_wilson_zm1
void mult_wilson_zm1(double *RESTRICT buf, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1045
BridgeACC::mult_wilson_xp1
void mult_wilson_xp1(double *RESTRICT buf, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:14
Field
Container of Field-type object.
Definition: field.h:46
BridgeACC::mult_wilson_tp1_chiral
void mult_wilson_tp1_chiral(double *RESTRICT buf, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1647
ThreadManager::get_thread_id
static int get_thread_id()
returns thread id.
Definition: threadManager.cpp:253
AFopr_Wilson::mult
void mult(AFIELD &, const AFIELD &)
multiplies fermion operator to a given field.
Definition: afopr_Wilson-tmpl.h:349
BridgeACC::mult_wilson_D_chiral
void mult_wilson_D_chiral(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, double kappa, int *Nsize, int *bc, int flag)
Definition: mult_Wilson_openacc-inc.h:187
Parameters::fetch_int
int fetch_int(const string &key, int &value) const
Definition: parameters.cpp:346
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:262
BridgeACC::mult_wilson_tpb_chiral
void mult_wilson_tpb_chiral(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1759
BridgeACC::copy_to_device
void copy_to_device(double *v, int nv)
ThreadManager::assert_single_thread
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.
Definition: threadManager.cpp:372
AFopr_Wilson::mult_zp
void mult_zp(real_t *, real_t *)
Definition: afopr_Wilson-tmpl.h:853
BridgeACC::mult_wilson_tm1_chiral
void mult_wilson_tm1_chiral(double *RESTRICT buf, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int *bc, int Nc)
Definition: mult_Wilson_dir_openacc-inc.h:1837
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:572
Bridge::BridgeIO::get_verbose_level
static std::string get_verbose_level(const VerboseLevel vl)
Definition: bridgeIO.cpp:216
BridgeACC::afield_init
void afield_init(double *data, const int size)
BridgeACC::mult_wilson_2_dirac
void mult_wilson_2_dirac(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT buf_xp, double *RESTRICT buf_xm, double *RESTRICT buf_yp, double *RESTRICT buf_ym, double *RESTRICT buf_zp, double *RESTRICT buf_zm, double *RESTRICT buf_tp, double *RESTRICT buf_tm, double kappa, int *Nsize, int *bc, int *do_comm, int flag)
Definition: mult_Wilson_openacc-inc.h:560