Bridge++  Ver.2.1.3
afopr_Clover_eo-tmpl.h
Go to the documentation of this file.
1 
9 template<typename AFIELD>
11  = "AFopr_Clover_eo<AFIELD>";
12 
13 //====================================================================
14 namespace{
15  inline void set_kernel_thread(int& ith, int& nth, int& ith_kernel)
16  {
19  ith_kernel = 0;
20  if(nth > 1) ith_kernel = 1;
21  }
22 }
23 
24 //====================================================================
25 template<typename AFIELD>
27 {
29 
30  std::string vlevel;
31  if (!params.fetch_string("verbose_level", vlevel)) {
32  m_vl = vout.set_verbose_level(vlevel);
33  } else {
34  m_vl = CommonParameters::Vlevel();
35  }
36 
37  vout.general(m_vl, "%s: construction\n", class_name.c_str());
39 
40  m_Nc = CommonParameters::Nc();
41  if(m_Nc != 3){
42  vout.crucial("only applicable to Nc = 3\n",
43  class_name.c_str());
44  exit(EXIT_FAILURE);
45  }
46 
47  m_Ncol = m_Nc;
48  m_Ndf = 2 * m_Nc * m_Nc;
49  m_Nvc = m_Nc * 2;
50  m_Nd = CommonParameters::Nd();
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  m_fee_inv.reset(m_Ndf, m_Nst2, m_Nd * m_Nd);
114  m_foo_inv.reset(m_Ndf, m_Nst2, m_Nd * m_Nd);
115 
116  m_Tinv.reset(m_Ndf, m_Nst, 1);
117 
118  m_fopr_ct = new AFopr_CloverTerm<AFIELD>(params);
119 
120  set_parameters(params);
121 
123  vout.general(m_vl, "%s: construction finished.\n",
124  class_name.c_str());
125 
126 }
127 
128 //====================================================================
129 template<typename AFIELD>
131 {
132  chsend_up.resize(m_Ndim);
133  chrecv_up.resize(m_Ndim);
134  chsend_dn.resize(m_Ndim);
135  chrecv_dn.resize(m_Ndim);
136 
137  for(int mu = 0; mu < m_Ndim; ++mu){
138 
139  int Nvsize = m_Nbdsize[mu] * sizeof(real_t);
140 
141  chsend_dn[mu].send_init(Nvsize, mu, -1);
142  chsend_up[mu].send_init(Nvsize, mu, 1);
143 #ifdef USE_MPI
144  chrecv_up[mu].recv_init(Nvsize, mu, 1);
145  chrecv_dn[mu].recv_init(Nvsize, mu, -1);
146 #else
147  void* buf_up = (void*)chsend_dn[mu].ptr();
148  chrecv_up[mu].recv_init(Nvsize, mu, 1, buf_up);
149  void* buf_dn = (void*)chsend_up[mu].ptr();
150  chrecv_dn[mu].recv_init(Nvsize, mu, -1, buf_dn);
151 #endif
152 
153  if(do_comm[mu] == 1){
154  chset_send.append(chsend_up[mu]);
155  chset_send.append(chsend_dn[mu]);
156  chset_recv.append(chrecv_up[mu]);
157  chset_recv.append(chrecv_dn[mu]);
158  }
159 
160  // device memory allocation
161 #ifdef USE_MPI
162  real_t* buf_dn1 = (real_t*)chsend_dn[mu].ptr();
163  real_t* buf_dn2 = (real_t*)chrecv_dn[mu].ptr();
164  real_t* buf_up1 = (real_t*)chsend_up[mu].ptr();
165  real_t* buf_up2 = (real_t*)chrecv_up[mu].ptr();
166  BridgeACC::afield_init(buf_dn1, m_Nbdsize[mu]);
167  BridgeACC::afield_init(buf_dn2, m_Nbdsize[mu]);
168  BridgeACC::afield_init(buf_up1, m_Nbdsize[mu]);
169  BridgeACC::afield_init(buf_up2, m_Nbdsize[mu]);
170 #else
171  BridgeACC::afield_init((real_t*)buf_up, m_Nbdsize[mu]);
172  BridgeACC::afield_init((real_t*)buf_dn, m_Nbdsize[mu]);
173 #endif
174 
175  }
176 
177 }
178 
179 //====================================================================
180 template<typename AFIELD>
182 {
184 
185  for(int mu = 0; mu < m_Ndim; ++mu){
186 
187 #ifdef USE_MPI
188  real_t* buf_dn1 = (real_t*)chsend_dn[mu].ptr();
189  real_t* buf_dn2 = (real_t*)chrecv_dn[mu].ptr();
190  real_t* buf_up1 = (real_t*)chrecv_up[mu].ptr();
191  real_t* buf_up2 = (real_t*)chsend_up[mu].ptr();
192  BridgeACC::afield_tidyup(buf_dn1, m_Nbdsize[mu]);
193  BridgeACC::afield_tidyup(buf_dn2, m_Nbdsize[mu]);
194  BridgeACC::afield_tidyup(buf_up1, m_Nbdsize[mu]);
195  BridgeACC::afield_tidyup(buf_up2, m_Nbdsize[mu]);
196 #else
197  real_t* buf_up = (real_t*)chsend_up[mu].ptr();
198  real_t* buf_dn = (real_t*)chsend_dn[mu].ptr();
199  BridgeACC::afield_tidyup(buf_up, m_Nbdsize[mu]);
200  BridgeACC::afield_tidyup(buf_dn, m_Nbdsize[mu]);
201 #endif
202 
203  }
204 
205  delete m_fopr_ct;
206 
207 }
208 
209 //====================================================================
210 template<typename AFIELD>
212 {
213  std::string vlevel;
214  if (!params.fetch_string("verbose_level", vlevel)) {
215  m_vl = vout.set_verbose_level(vlevel);
216  }
217 
218  //- fetch and check input parameters
219  double kappa, cSW;
220  std::vector<int> bc;
221 
222  int err = 0;
223  err += params.fetch_double("hopping_parameter", kappa);
224  err += params.fetch_double("clover_coefficient", cSW);
225  err += params.fetch_int_vector("boundary_condition", bc);
226  if (err) {
227  vout.crucial(m_vl, "Error at %s: input parameter not found.\n",
228  class_name.c_str());
229  exit(EXIT_FAILURE);
230  }
231 
232  //- setting gamma matrix representation
233  std::string repr;
234  err = params.fetch_string("gamma_matrix_type", repr);
235  if(err){
236  vout.general(m_vl, " gamma_matrix_type is not given - set to Dirac\n");
237  m_repr = DIRAC;
238  }else if(repr == "Dirac"){
239  m_repr = DIRAC;
240  }else if(repr == "Chiral"){
241  m_repr = CHIRAL;
242  }else{
243  vout.crucial(m_vl, "Error in %s: irrelevant gamma_matrix_type: %s\n",
244  class_name.c_str(), repr.c_str());
245  exit(EXIT_FAILURE);
246  }
247 
248  set_parameters(real_t(kappa), real_t(cSW), bc);
249 
250  m_fopr_ct->set_parameters(params);
251 
252 }
253 
254 //====================================================================
255 template<typename AFIELD>
257  const real_t cSW,
258  const std::vector<int> bc)
259 {
260  assert(bc.size() == m_Ndim);
261 
262 #pragma omp barrier
263 
264  int ith = ThreadManager::get_thread_id();
265 
266  if (ith == 0) {
267  m_CKs = CKs;
268  m_cSW = cSW;
269  m_boundary.resize(m_Ndim);
270  for (int mu = 0; mu < m_Ndim; ++mu) {
271  m_boundary[mu] = bc[mu];
272  }
273 
274  for (int mu = 0; mu < m_Ndim; ++mu) {
275  m_bc[mu] = 1;
276  if(do_comm[mu] > 0){ // do communication
277  if(Communicator::ipe(mu) == 0) m_bc[mu] = m_boundary[mu];
278  m_bc2[mu] = 0;
279  }else{ // no communication
280  m_bc[mu] = 0; // for boundar part (dummy)
281  m_bc2[mu] = m_boundary[mu]; // for bulk part
282  }
283  }
284  }
285 #pragma omp barrier
286 
287  //- print input parameters
288  vout.general(m_vl, "Parameters of %s:\n", class_name.c_str());
289  if(m_repr == DIRAC){
290  vout.general(m_vl, " gamma-matrix type = Dirac\n");
291  }else{
292  vout.general(m_vl, " gamma-matrix type = Chiral\n");
293  }
294  vout.general(m_vl, " kappa = %8.4f\n", m_CKs);
295  for (int mu = 0; mu < m_Ndim; ++mu) {
296  vout.general(m_vl, " boundary[%d] = %2d\n", mu, m_boundary[mu]);
297  }
298 
299 }
300 
301 //====================================================================
302 template<typename AFIELD>
304 {
305  params.set_double("hopping_parameter", double(m_CKs));
306  params.set_double("clover_coefficient", double(m_cSW));
307  params.set_int_vector("boundary_condition", m_boundary);
308 
309  std::string repr;
310  if(m_repr == DIRAC) repr = "Dirac";
311  if(m_repr == CHIRAL) repr = "Chiral";
312  params.set_string("gamma_matrix_type", repr);
313 
314  params.set_string("verbose_level", vout.get_verbose_level(m_vl));
315 }
316 
317 //====================================================================
318 template<typename AFIELD>
320 {
321  int nth = ThreadManager::get_num_threads();
322 
323  vout.paranoiac(m_vl, "%s: set_config is called: num_threads = %d\n",
324  class_name.c_str(), nth);
325 
326  if (nth > 1) {
327  set_config_impl(u);
328  } else {
329  set_config_omp(u);
330  }
331 
332  vout.paranoiac(m_vl, "%s: set_config finished\n", class_name.c_str());
333 }
334 
335 //====================================================================
336 template<typename AFIELD>
338 {
339  vout.paranoiac(m_vl, " set_config_omp is called.\n");
340 
341 #pragma omp parallel
342  {
343  set_config_impl(u);
344  }
345 
346 }
347 
348 //====================================================================
349 template<typename AFIELD>
351 {
352 #pragma omp barrier
353 
354  m_timer.reset();
355  m_timer.start();
356 
357  vout.general(m_vl, "%s: set_config start\n", class_name.c_str());
358 
359  int ith = ThreadManager::get_thread_id();
360 
361  if (ith == 0) m_conf = u;
362 
363  convert(m_index_eo, m_Ueo, *u);
364 
366  m_fopr_ct->set_config(u);
368 
369  int Ncsw = m_Nd * m_Nd/2;
370  for(int j = 0; j < Ncsw; ++j){
371  m_fopr_ct->get_csw_inv(m_Tinv, j);
372  m_index_eo.split(m_fee_inv, j, m_foo_inv, j, m_Tinv, 0);
373  }
374 
375  m_timer.stop();
376  double elapsed_time = m_timer.elapsed_sec();
377  vout.general(m_vl, "%s: set_config finished in %11.6f [sec]\n",
378  class_name.c_str(), elapsed_time);
379 
380 }
381 
382 //====================================================================
383 template<typename AFIELD>
384 void AFopr_Clover_eo<AFIELD>::set_mode(std::string mode)
385 {
386 #pragma omp barrier
387 
388  int ith = ThreadManager::get_thread_id();
389  if (ith == 0) m_mode = mode;
390 
391 #pragma omp barrier
392 }
393 
394 //====================================================================
395 template<typename AFIELD>
397 {
398  if(m_mode == "D"){
399  return D(v, w);
400  }else if(m_mode == "DdagD"){
401  return DdagD(v, w);
402  }else if(m_mode == "Ddag"){
403  return Ddag(v, w);
404  }else{
405  vout.crucial(m_vl, "%s: mode undefined.\n", class_name.c_str());
406  exit(EXIT_FAILURE);
407  }
408 
409 }
410 
411 //====================================================================
412 template<typename AFIELD>
414 {
415  if (m_mode == "D") {
416  return Ddag(v, w);
417  } else if (m_mode == "DdagD") {
418  return DdagD(v, w);
419  } else if (m_mode == "Ddag") {
420  return D(v, w);
421  } else {
422  vout.crucial(m_vl, "%s: mode undefined.\n", class_name.c_str());
423  exit(EXIT_FAILURE);
424  }
425 
426 }
427 
428 //====================================================================
429 template<typename AFIELD>
431 {
432  real_t* vp = v.ptr(0);
433  real_t* wp = const_cast<AFIELD*>(&w)->ptr(0);
434 
435 #pragma omp barrier
436 
437  mult_gm5(vp, wp);
438 
439 #pragma omp barrier
440 }
441 
442 //====================================================================
443 template<typename AFIELD>
445  const std::string mode)
446 {
447  if(mode == "Dee_inv"){
448  mult_cswinv(v, w, 0);
449  }else if(mode == "Doo_inv"){
450  mult_cswinv(v, w, 1);
451  }else if(mode == "Deo"){
452  Meo(v, w, 0);
453  }else if(mode == "Doe"){
454  Meo(v, w, 1);
455  }else{
456  vout.crucial(m_vl, "%s: illegal mode is given to mult with mode\n",
457  class_name.c_str());
458  exit(EXIT_FAILURE);
459  }
460 
461 }
462 
463 //====================================================================
464 template<typename AFIELD>
466 {
467  D(m_v2, w);
468  Ddag(v, m_v2);
469 }
470 
471 //====================================================================
472 template<typename AFIELD>
474 {
475 #pragma omp barrier
476  mult_gm5(m_v1, w);
477 #pragma omp barrier
478 
479  mult_cswinv(v, m_v1, 0);
480 #pragma omp barrier
481  Meo(m_v1, v, 1);
482 #pragma omp barrier
483  mult_cswinv(v, m_v1, 1);
484 #pragma omp barrier
485  Meo(m_v1, v, 0);
486 #pragma omp barrier
487 
488  mult_gm5(v, m_v1);
489 #pragma omp barrier
490 
491  aypx(real_t(-1.0), v, w);
492 #pragma omp barrier
493 }
494 
495 //====================================================================
496 template<typename AFIELD>
498 {
499 #pragma omp barrier
500  Meo(m_v1, w, 1);
501  // Meo_alt(m_v1, w, 1);
502 #pragma omp barrier
503  mult_cswinv(v, m_v1, 1);
504 #pragma omp barrier
505  Meo(m_v1, v, 0);
506  // Meo_alt(m_v1, v, 0);
507 #pragma omp barrier
508  mult_cswinv(v, m_v1, 0);
509 #pragma omp barrier
510 
511  aypx(real_t(-1.0), v, w);
512 #pragma omp barrier
513 }
514 
515 //====================================================================
516 template<typename AFIELD>
518  const AFIELD &w,
519  const int ieo)
520 {
521  real_t *vp = v.ptr(0);
522  real_t *wp = const_cast<AFIELD*>(&w)->ptr(0);
523 
524  v.set(0.0);
525 
526  mult_xp(vp, wp, ieo);
527  mult_xm(vp, wp, ieo);
528  mult_yp(vp, wp, ieo);
529  mult_ym(vp, wp, ieo);
530  mult_zp(vp, wp, ieo);
531  mult_zm(vp, wp, ieo);
532  mult_tp(vp, wp, ieo);
533  mult_tm(vp, wp, ieo);
534 
535  scal(v, -m_CKs);
536 #pragma omp barrier
537 
538 }
539 
540 //====================================================================
541 template<typename AFIELD>
543 {
544 #pragma omp barrier
545 
546  int ith = ThreadManager::get_thread_id();
547  if (ith == 0){
548  if(m_repr == DIRAC){
549  BridgeACC::mult_wilson_gm5_dirac(v, w, m_Nsize, NC);
550  }else{
551  BridgeACC::mult_wilson_gm5_chiral(v, w, m_Nsize, NC);
552  }
553  }
554 
555 #pragma omp barrier
556 }
557 
558 //====================================================================
559 template<typename AFIELD>
561  const AFIELD& w, int ieo)
562 {
563 #pragma omp barrier
564 
565  int ith = ThreadManager::get_thread_id();
566  if (ith == 0){
567 
568  real_t *v2 = v.ptr(0);
569  real_t *v1 = const_cast<AFIELD*>(&w)->ptr(0);
570 
571  real_t *u = 0;
572  if(ieo == 0){
573  u = m_fee_inv.ptr(0);
574  }else if(ieo == 1){
575  u = m_foo_inv.ptr(0);
576  }
577 
578  if(m_repr == DIRAC){
579  BridgeACC::mult_csw_dirac(v2, u, v1, m_Nsize, 0);
580  //qqqq
581  //int NinF = 2 * m_Nc * m_Nd;
582  //BridgeACC::copy(v2, v1, NinF, m_Nst2);
583  }else{
584  BridgeACC::mult_csw_chiral(v2, u, v1, m_Nsize, 0);
585  //int NinF = 2 * m_Nc * m_Nd;
586  //BridgeACC::copy(v2, v1, NinF, m_Nst2);
587  }
588  }
589 
590 #pragma omp barrier
591 }
592 
593 //====================================================================
594 template<typename AFIELD>
596  const int ieo)
597 {
598  Meo(v, w, w, ieo, 0);
599  //Meo_alt(v, w, ieo);
600 }
601 
602 //====================================================================
603 template<typename AFIELD>
605  const AFIELD &w, const AFIELD &x,
606  const int ieo, const int iflag)
607 {
608 #pragma omp barrier
609 
610  int ith = ThreadManager::get_thread_id();
611  int nth = ThreadManager::get_num_threads();
612  int ith_kernel = 0;
613  if(nth > 1) ith_kernel = 1;
614 
615  real_t *vp = v.ptr(0);
616  real_t *wp = const_cast<AFIELD*>(&w)->ptr(0);
617  real_t *xp = const_cast<AFIELD*>(&x)->ptr(0);
618  real_t *up = m_Ueo.ptr(0);
619  int jeo = (m_Ieo_origin + ieo) % 2;
620 
621  if(do_comm_any > 0 && ith == ith_kernel){
622 
623  real_t *buf1xp = (real_t*)chsend_dn[0].ptr();
624  real_t *buf1xm = (real_t*)chsend_up[0].ptr();
625  real_t *buf1yp = (real_t*)chsend_dn[1].ptr();
626  real_t *buf1ym = (real_t*)chsend_up[1].ptr();
627  real_t *buf1zp = (real_t*)chsend_dn[2].ptr();
628  real_t *buf1zm = (real_t*)chsend_up[2].ptr();
629  real_t *buf1tp = (real_t*)chsend_dn[3].ptr();
630  real_t *buf1tm = (real_t*)chsend_up[3].ptr();
631 
632  if(m_repr == DIRAC){
634  buf1xp, buf1xm, buf1yp, buf1ym,
635  buf1zp, buf1zm, buf1tp, buf1tm,
636  up, wp, ieo, jeo,
637  m_Nsize, m_bc, do_comm, NC);
638  }else{
640  buf1xp, buf1xm, buf1yp, buf1ym,
641  buf1zp, buf1zm, buf1tp, buf1tm,
642  up, wp, ieo, jeo,
643  m_Nsize, m_bc, do_comm, NC);
644  }
645  }
646 #pragma omp barrier
647 
648  if(do_comm_any > 0 && ith == 0){
649  chset_send.start();
650  chset_recv.start();
651  }
652 
653  // bulk part
654  if (ith == ith_kernel){
655  if(m_repr == DIRAC){
656  BridgeACC::mult_wilson_Meo_dirac(vp, up, wp, xp,
657  ieo, jeo, m_CKs, m_Nsize, m_bc2, iflag);
658  }else{
659  BridgeACC::mult_wilson_Meo_chiral(vp, up, wp, xp,
660  ieo, jeo, m_CKs, m_Nsize, m_bc2, iflag);
661  }
662  }
663 
664  if(do_comm_any > 0 && ith == 0){
665  chset_send.wait();
666  chset_recv.wait();
667  }
668 #pragma omp barrier
669 
670  if(do_comm_any > 0 && ith == ith_kernel){
671 
672  real_t *buf2xp = (real_t*)chrecv_up[0].ptr();
673  real_t *buf2xm = (real_t*)chrecv_dn[0].ptr();
674  real_t *buf2yp = (real_t*)chrecv_up[1].ptr();
675  real_t *buf2ym = (real_t*)chrecv_dn[1].ptr();
676  real_t *buf2zp = (real_t*)chrecv_up[2].ptr();
677  real_t *buf2zm = (real_t*)chrecv_dn[2].ptr();
678  real_t *buf2tp = (real_t*)chrecv_up[3].ptr();
679  real_t *buf2tm = (real_t*)chrecv_dn[3].ptr();
680 
681  if(m_repr == DIRAC){
683  buf2xp, buf2xm, buf2yp, buf2ym,
684  buf2zp, buf2zm, buf2tp, buf2tm,
685  m_CKs, ieo, jeo, iflag,
686  m_Nsize, m_bc, do_comm, NC);
687  }else{
689  buf2xp, buf2xm, buf2yp, buf2ym,
690  buf2zp, buf2zm, buf2tp, buf2tm,
691  m_CKs, ieo, jeo, iflag,
692  m_Nsize, m_bc, do_comm, NC);
693  }
694 
695  }
696 #pragma omp barrier
697 
698 }
699 
700 //====================================================================
701 template<typename AFIELD>
703  const int ieo)
704 {
705 #pragma omp barrier
706 
707  int idir = 0;
708  int jeo = (m_Ieo_origin + ieo) % 2;
709 
710  real_t *buf1 = (real_t*)chsend_dn[idir].ptr();
711  real_t *buf2 = (real_t*)chrecv_up[idir].ptr();
712  int Nst2_pad = ceil_nwp(m_Nst2);
713  real_t *u = m_Ueo.ptr(NDF * Nst2_pad * (ieo + 2*idir) );
714 
715  int ith, nth, ith_kernel;
716  set_kernel_thread(ith, nth, ith_kernel);
717 
718  if(do_comm[idir] > 0 && ith == ith_kernel){
719  BridgeACC::mult_wilson_xp1_eo(buf1, v1, m_Nsize, m_bc, jeo, NC);
720  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
721  }
722 
723 #pragma omp barrier
724 
725  if(do_comm[idir] > 0 && ith == 0){
726  chrecv_up[idir].start();
727  chsend_dn[idir].start();
728  }
729 
730  // bulk part
731  if(ith == ith_kernel){
732  BridgeACC::mult_wilson_xpb_eo(v2, u, v1, m_Nsize, m_bc2, jeo, NC);
733  }
734 
735  if(do_comm[idir] > 0 && ith == 0){
736  chsend_dn[idir].wait();
737  chrecv_up[idir].wait();
738  }
739 
740 #pragma omp barrier
741 
742  if(do_comm[idir] > 0 && ith == ith_kernel){
743  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
744  BridgeACC::mult_wilson_xp2_eo(v2, u, buf2, m_Nsize, m_bc, jeo, NC);
745  }
746 
747 #pragma omp barrier
748 }
749 
750 //====================================================================
751 template<typename AFIELD>
753  const int ieo)
754 {
755 #pragma omp barrier
756 
757  int idir = 0;
758  int jeo = (m_Ieo_origin + ieo) % 2;
759 
760  real_t *buf1 = (real_t*)chsend_up[idir].ptr();
761  real_t *buf2 = (real_t*)chrecv_dn[idir].ptr();
762  int Nst2_pad = ceil_nwp(m_Nst2);
763  real_t *u = m_Ueo.ptr(NDF * Nst2_pad * (1-ieo + 2*idir) );
764 
765  int ith, nth, ith_kernel;
766  set_kernel_thread(ith, nth, ith_kernel);
767 
768  if(do_comm[idir] > 0 && ith == ith_kernel){
769  BridgeACC::mult_wilson_xm1_eo(buf1, u, v1, m_Nsize, m_bc, jeo, NC);
770  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
771  }
772 
773 #pragma omp barrier
774 
775  if(do_comm[idir] > 0 && ith == 0){
776  chrecv_dn[idir].start();
777  chsend_up[idir].start();
778  }
779 
780  // bulk part
781  if(ith == ith_kernel){
782  BridgeACC::mult_wilson_xmb_eo(v2, u, v1, m_Nsize, m_bc2, jeo, NC);
783  }
784 
785  if(do_comm[idir] > 0 && ith == 0){
786  chsend_up[idir].wait();
787  chrecv_dn[idir].wait();
788  }
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_xm2_eo(v2, buf2, m_Nsize, m_bc, jeo, NC);
795  }
796 
797 #pragma omp barrier
798 }
799 
800 //====================================================================
801 template<typename AFIELD>
803  const int ieo)
804 {
805 #pragma omp barrier
806 
807  int idir = 1;
808 
809  real_t *buf1 = (real_t*)chsend_dn[idir].ptr();
810  real_t *buf2 = (real_t*)chrecv_up[idir].ptr();
811  int Nst2_pad = ceil_nwp(m_Nst2);
812  real_t *u = m_Ueo.ptr(NDF * Nst2_pad * (ieo + 2 * idir));
813 
814  int ith, nth, ith_kernel;
815  set_kernel_thread(ith, nth, ith_kernel);
816 
817  if(do_comm[idir] > 0 && ith == ith_kernel){
818  BridgeACC::mult_wilson_yp1(buf1, v1, m_Nsize, m_bc, NC);
819  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
820  }
821 
822 #pragma omp barrier
823 
824  if(do_comm[idir] > 0 && ith == 0){
825  chrecv_up[idir].start();
826  chsend_dn[idir].start();
827  }
828 
829  // bulk part
830  if(ith == ith_kernel){
831  BridgeACC::mult_wilson_ypb(v2, u, v1, m_Nsize, m_bc2, NC);
832  }
833 
834  if(do_comm[idir] > 0 && ith == 0){
835  chsend_dn[idir].wait();
836  chrecv_up[idir].wait();
837  }
838 
839 #pragma omp barrier
840 
841  if(do_comm[idir] > 0 && ith == ith_kernel){
842  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
843  BridgeACC::mult_wilson_yp2(v2, u, buf2, m_Nsize, m_bc, NC);
844  }
845 
846 #pragma omp barrier
847 
848 }
849 
850 //====================================================================
851 template<typename AFIELD>
853  const int ieo)
854 {
855 #pragma omp barrier
856 
857  int idir = 1;
858 
859  real_t *buf1 = (real_t*)chsend_up[idir].ptr();
860  real_t *buf2 = (real_t*)chrecv_dn[idir].ptr();
861  int Nst2_pad = ceil_nwp(m_Nst2);
862  real_t *u = m_Ueo.ptr(NDF * Nst2_pad * (1-ieo + 2 * idir));
863 
864  int ith, nth, ith_kernel;
865  set_kernel_thread(ith, nth, ith_kernel);
866 
867  if(do_comm[idir] > 0 && ith == ith_kernel){
868  BridgeACC::mult_wilson_ym1(buf1, u, v1, m_Nsize, m_bc, NC);
869  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
870  }
871 
872 #pragma omp barrier
873 
874  if(do_comm[idir] > 0 && ith == 0){
875  chrecv_dn[idir].start();
876  chsend_up[idir].start();
877  }
878 
879  // bulk part
880  if(ith == ith_kernel){
881  BridgeACC::mult_wilson_ymb(v2, u, v1, m_Nsize, m_bc2, NC);
882  }
883 
884  if(do_comm[idir] > 0 && ith == 0){
885  chsend_up[idir].wait();
886  chrecv_dn[idir].wait();
887  }
888 
889 #pragma omp barrier
890 
891  if(do_comm[idir] > 0 && ith == ith_kernel){
892  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
893  BridgeACC::mult_wilson_ym2(v2, buf2, m_Nsize, m_bc, NC);
894  }
895 
896 #pragma omp barrier
897 
898 }
899 
900 //====================================================================
901 template<typename AFIELD>
903  const int ieo)
904 {
905 #pragma omp barrier
906 
907  int idir = 2;
908 
909  real_t *buf1 = (real_t*)chsend_dn[idir].ptr();
910  real_t *buf2 = (real_t*)chrecv_up[idir].ptr();
911  int Nst2_pad = ceil_nwp(m_Nst2);
912  real_t *u = m_Ueo.ptr(NDF * Nst2_pad * (ieo + 2 * idir));
913 
914  int ith, nth, ith_kernel;
915  set_kernel_thread(ith, nth, ith_kernel);
916 
917  if(do_comm[idir] > 0 && ith == ith_kernel){
918  BridgeACC::mult_wilson_zp1(buf1, v1, m_Nsize, m_bc, NC);
919  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
920  }
921 
922 #pragma omp barrier
923 
924  if(do_comm[idir] > 0 && ith == 0){
925  chrecv_up[idir].start();
926  chsend_dn[idir].start();
927  }
928 
929  // bulk part
930  if(ith == ith_kernel){
931  BridgeACC::mult_wilson_zpb(v2, u, v1, m_Nsize, m_bc2, NC);
932  }
933 
934  if(do_comm[idir] > 0 && ith == 0){
935  chsend_dn[idir].wait();
936  chrecv_up[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_zp2(v2, u, buf2, m_Nsize, m_bc, NC);
944  }
945 
946 #pragma omp barrier
947 
948 }
949 
950 //====================================================================
951 template<typename AFIELD>
953  const int ieo)
954 {
955 #pragma omp barrier
956 
957  int idir = 2;
958 
959  real_t *buf1 = (real_t*)chsend_up[idir].ptr();
960  real_t *buf2 = (real_t*)chrecv_dn[idir].ptr();
961  int Nst2_pad = ceil_nwp(m_Nst2);
962  real_t *u = m_Ueo.ptr(NDF * Nst2_pad * (1-ieo + 2 * 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  BridgeACC::mult_wilson_zm1(buf1, u, v1, m_Nsize, m_bc, NC);
969  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
970  }
971 #pragma omp barrier
972 
973  if(do_comm[idir] > 0 && ith == 0){
974  chrecv_dn[idir].start();
975  chsend_up[idir].start();
976  }
977 
978  // bulk part
979  if(ith == ith_kernel){
980  BridgeACC::mult_wilson_zmb(v2, u, v1, m_Nsize, m_bc2, NC);
981  }
982 
983  if(do_comm[idir] > 0 && ith == 0){
984  chsend_up[idir].wait();
985  chrecv_dn[idir].wait();
986  }
987 
988 #pragma omp barrier
989 
990  if(do_comm[idir] > 0 && ith == ith_kernel){
991  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
992  BridgeACC::mult_wilson_zm2(v2, buf2, m_Nsize, m_bc, NC);
993  }
994 
995 #pragma omp barrier
996 
997 }
998 
999 //====================================================================
1000 template<typename AFIELD>
1002  const int ieo)
1003 {
1004 #pragma omp barrier
1005 
1006  int idir = 3;
1007 
1008  real_t *buf1 = (real_t*)chsend_dn[idir].ptr();
1009  real_t *buf2 = (real_t*)chrecv_up[idir].ptr();
1010  int Nst2_pad = ceil_nwp(m_Nst2);
1011  real_t *u = m_Ueo.ptr(NDF * Nst2_pad * (ieo + 2 * idir));
1012 
1013  int ith, nth, ith_kernel;
1014  set_kernel_thread(ith, nth, ith_kernel);
1015 
1016  if(do_comm[idir] > 0 && ith == ith_kernel){
1017  if(m_repr == DIRAC){
1018  BridgeACC::mult_wilson_tp1_dirac(buf1, v1, m_Nsize, m_bc, NC);
1019  }else{
1020  BridgeACC::mult_wilson_tp1_chiral(buf1, v1, m_Nsize, m_bc, NC);
1021  }
1022  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
1023  }
1024 
1025 #pragma omp barrier
1026 
1027  if(do_comm[idir] > 0 && ith == 0){
1028  chrecv_up[idir].start();
1029  chsend_dn[idir].start();
1030  }
1031 
1032  // bulk part
1033  if(ith == ith_kernel){
1034  if(m_repr == DIRAC){
1035  BridgeACC::mult_wilson_tpb_dirac(v2, u, v1, m_Nsize, m_bc2, NC);
1036  }else{
1037  BridgeACC::mult_wilson_tpb_chiral(v2, u, v1, m_Nsize, m_bc2, NC);
1038  }
1039  }
1040 
1041  if(do_comm[idir] > 0 && ith == 0){
1042  chsend_dn[idir].wait();
1043  chrecv_up[idir].wait();
1044  }
1045 
1046 #pragma omp barrier
1047 
1048  if(do_comm[idir] > 0 && ith == ith_kernel){
1049  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
1050  if(m_repr == DIRAC){
1051  BridgeACC::mult_wilson_tp2_dirac(v2, u, buf2, m_Nsize, m_bc, NC);
1052  }else{
1053  BridgeACC::mult_wilson_tp2_chiral(v2, u, buf2, m_Nsize, m_bc, NC);
1054  }
1055  }
1056 
1057 #pragma omp barrier
1058 
1059 }
1060 
1061 //====================================================================
1062 template<typename AFIELD>
1064  const int ieo)
1065 {
1066 #pragma omp barrier
1067 
1068 
1069  int idir = 3;
1070 
1071  real_t *buf1 = (real_t*)chsend_up[idir].ptr();
1072  real_t *buf2 = (real_t*)chrecv_dn[idir].ptr();
1073  int Nst2_pad = ceil_nwp(m_Nst2);
1074  real_t *u = m_Ueo.ptr(NDF * Nst2_pad * (1-ieo + 2 * idir));
1075 
1076  int ith, nth, ith_kernel;
1077  set_kernel_thread(ith, nth, ith_kernel);
1078 
1079  if(do_comm[idir] > 0 && ith == ith_kernel){
1080  if(m_repr == DIRAC){
1081  BridgeACC::mult_wilson_tm1_dirac(buf1, u, v1, m_Nsize, m_bc, NC);
1082  }else{
1083  BridgeACC::mult_wilson_tm1_chiral(buf1, u, v1, m_Nsize, m_bc, NC);
1084  }
1085  BridgeACC::copy_from_device(buf1, m_Nbdsize[idir]);
1086  }
1087 
1088 #pragma omp barrier
1089 
1090  if(do_comm[idir] > 0 && ith == 0){
1091  chrecv_dn[idir].start();
1092  chsend_up[idir].start();
1093  }
1094 
1095  // bulk part
1096  if(ith == ith_kernel){
1097  if(m_repr == DIRAC){
1098  BridgeACC::mult_wilson_tmb_dirac(v2, u, v1, m_Nsize, m_bc2, NC);
1099  }else{
1100  BridgeACC::mult_wilson_tmb_chiral(v2, u, v1, m_Nsize, m_bc2, NC);
1101  }
1102  }
1103 
1104  if(do_comm[idir] > 0 && ith == 0){
1105  chsend_up[idir].wait();
1106  chrecv_dn[idir].wait();
1107  }
1108 
1109 #pragma omp barrier
1110 
1111  if(do_comm[idir] > 0 && ith == ith_kernel){
1112  BridgeACC::copy_to_device(buf2, m_Nbdsize[idir]);
1113  if(m_repr == DIRAC){
1114  BridgeACC::mult_wilson_tm2_dirac(v2, buf2, m_Nsize, m_bc, NC);
1115  }else{
1116  BridgeACC::mult_wilson_tm2_chiral(v2, buf2, m_Nsize, m_bc, NC);
1117  }
1118  }
1119 
1120 #pragma omp barrier
1121 
1122 }
1123 
1124 //====================================================================
1125 template<typename AFIELD>
1127 {
1128  // The following counting explicitly depends on the implementation.
1129  // It will be recalculated when the code is modified.
1130  // The present counting is based on rev.1107. [24 Aug 2014 H.Matsufuru]
1131 
1132  int Lvol = CommonParameters::Lvol();
1133  double flop_site, flop;
1134 
1135  if (m_repr == DIRAC) {
1136  flop_site = static_cast<double>(
1137  m_Nc * m_Nd * (4 + 6 * (4 * m_Nc + 2) + 2 * (4 * m_Nc + 1))
1138  + 8 * m_Nc * m_Nc * m_Nd * m_Nd);
1139  } else if (m_repr == CHIRAL) {
1140  flop_site = static_cast<double>(
1141  m_Nc * m_Nd * (4 + 8 * (4 * m_Nc + 2))
1142  + 4 * m_Nc * m_Nc * m_Nd * m_Nd);
1143  } else {
1144  vout.crucial(m_vl, "%s: input repr is undefined.\n",
1145  class_name.c_str());
1146  exit(EXIT_FAILURE);
1147  }
1148 
1149  flop = flop_site * static_cast<double>(Lvol);
1150  if ((m_mode == "DdagD") || (m_mode == "DDdag")) flop *= 2.0;
1151 
1152  return flop;
1153 }
1154 
1155 //============================================================END=====
AFopr_Clover_eo::mult
void mult(AFIELD &, const AFIELD &)
multiplies fermion operator to a given field.
Definition: afopr_Clover_eo-tmpl.h:396
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_Clover_eo::mult_zp
void mult_zp(real_t *, real_t *, const int)
Definition: afopr_Clover_eo-tmpl.h:902
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
AFopr_Clover_eo::mult_cswinv
void mult_cswinv(AFIELD &, const AFIELD &, int ieo)
Definition: afopr_Clover_eo-tmpl.h:560
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
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_Clover_eo::mult_xm
void mult_xm(real_t *, real_t *, const int)
Definition: afopr_Clover_eo-tmpl.h:752
AFopr_Clover_eo::D
void D(AFIELD &, const AFIELD &)
Definition: afopr_Clover_eo-tmpl.h:497
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
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
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_Clover_eo::set_config_impl
void set_config_impl(Field *u)
Definition: afopr_Clover_eo-tmpl.h:350
AFopr_Clover_eo::Meo
void Meo(AFIELD &, const AFIELD &, const int ieo)
Fermion matrix with ieo = 0: even <– odd, 1: odd <– even.
Definition: afopr_Clover_eo-tmpl.h:595
Bridge::BridgeIO::increase_indent
void increase_indent()
Definition: bridgeIO.cpp:508
AFopr_CloverTerm
Definition: afopr_CloverTerm.h:31
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_Clover_eo::get_parameters
void get_parameters(Parameters &params) const
getting parameters as a Parameters object.
Definition: afopr_Clover_eo-tmpl.h:303
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
AFopr_Clover_eo::mult_tm
void mult_tm(real_t *, real_t *, const int)
Definition: afopr_Clover_eo-tmpl.h:1063
AFopr_Clover_eo::real_t
AFIELD::real_t real_t
Definition: afopr_Clover_eo.h:41
AFopr_Clover_eo::flop_count
double flop_count()
returns floating operation counts.
Definition: afopr_Clover_eo-tmpl.h:1126
AFopr_Clover_eo::mult_gm5
void mult_gm5(AFIELD &, const AFIELD &)
multiplies gamma_5 matrix.
Definition: afopr_Clover_eo-tmpl.h:430
AFopr_Clover_eo::setup_channels
void setup_channels()
setup channels for communication.
Definition: afopr_Clover_eo-tmpl.h:130
BridgeACC::copy_from_device
void copy_from_device(double *v, int nv)
AFopr_Clover_eo::Meo_alt
void Meo_alt(AFIELD &, const AFIELD &, const int ieo)
Fermion matrix with ieo = 0: even <– odd, 1: odd <– even.
Definition: afopr_Clover_eo-tmpl.h:517
AFopr_Clover_eo::mult_yp
void mult_yp(real_t *, real_t *, const int)
Definition: afopr_Clover_eo-tmpl.h:802
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
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
AFopr_Clover_eo::set_parameters
void set_parameters(const Parameters &params)
setting parameters by a Parameter object.
Definition: afopr_Clover_eo-tmpl.h:211
AFopr_Clover_eo::mult_tp
void mult_tp(real_t *, real_t *, const int)
Definition: afopr_Clover_eo-tmpl.h:1001
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
AFopr_Clover_eo::set_mode
void set_mode(std::string mode)
setting mult mode.
Definition: afopr_Clover_eo-tmpl.h:384
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
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_Clover_eo::mult_ym
void mult_ym(real_t *, real_t *, const int)
Definition: afopr_Clover_eo-tmpl.h:852
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_Clover_eo::set_config
void set_config(Field *u)
setting gauge configuration.
Definition: afopr_Clover_eo-tmpl.h:319
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
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
AFopr_Clover_eo::mult_dag
void mult_dag(AFIELD &, const AFIELD &)
hermitian conjugate of mult.
Definition: afopr_Clover_eo-tmpl.h:413
AFopr_Clover_eo::Ddag
void Ddag(AFIELD &, const AFIELD &)
Definition: afopr_Clover_eo-tmpl.h:473
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_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_Clover_eo::mult_xp
void mult_xp(real_t *, real_t *, const int)
Definition: afopr_Clover_eo-tmpl.h:702
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
AFopr_Clover_eo::set_config_omp
void set_config_omp(Field *u)
Definition: afopr_Clover_eo-tmpl.h:337
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_csw_chiral
void mult_csw_chiral(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int flag)
Definition: mult_CloverTerm_openacc-inc.h:110
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
BridgeACC::mult_csw_dirac
void mult_csw_dirac(double *RESTRICT v2, double *RESTRICT u, double *RESTRICT v1, int *Nsize, int flag)
Definition: mult_CloverTerm_openacc-inc.h:15
AFopr_Clover_eo::init
void init(const Parameters &params)
initial setup.
Definition: afopr_Clover_eo-tmpl.h:26
AFopr_Clover_eo::DdagD
void DdagD(AFIELD &, const AFIELD &)
Definition: afopr_Clover_eo-tmpl.h:465
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
AFopr_Clover_eo
Definition: afopr_Clover_eo.h:38
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_Clover_eo::tidyup
void tidyup()
final tidy-up.
Definition: afopr_Clover_eo-tmpl.h:181
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
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
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)
AFopr_Clover_eo::mult_zm
void mult_zm(real_t *, real_t *, const int)
Definition: afopr_Clover_eo-tmpl.h:952