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