Bridge++  Ver. 2.0.2
shiftAField_lex.h
Go to the documentation of this file.
1 
10 #ifndef SHIFTAFIELD_LEX_INCLUDED
11 #define SHIFTAFIELD_LEX_INCLUDED
12 
13 #include <vector>
14 
17 
18 #include "lib/IO/bridgeIO.h"
19 using Bridge::vout;
20 
22 
32 template<typename AFIELD>
34  public:
35  typedef typename AFIELD::real_t real_t;
36  static const std::string class_name;
37 
38  private:
39  int m_Nin;
40  int m_Nvol;
41  int m_Ndim;
42  int m_Nx, m_Ny, m_Nz, m_Nt;
44  std::vector<int> m_boundary;
46 
47  int do_comm[4]; // switchs of communication (4=Ndim): (0: n, 1: y).
48  int do_comm_any; // switchs of communication (if any): (0: n, 1: y).
49 
50  std::vector<int> m_Nbdsize;
51  using allocator_t = typename AFIELD::template aligned_allocator<char>;
53  std::vector<Channel> chsend_up, chrecv_up, chsend_dn, chrecv_dn;
55 
56  public:
57  ShiftAField_lex(int nin) { init(nin); }
58 
59  ShiftAField_lex(int nin, std::vector<int>& bc)
60  { init(nin, bc); }
61 
63 
64  private:
65  // non-copyable
68 
69  public:
70  void forward(AFIELD&, const AFIELD&, const int mu);
71  void backward(AFIELD&, const AFIELD&, const int mu);
72 
73  void forward(AFIELD&, const int, const AFIELD&, const int,
74  const int mu);
75  void backward(AFIELD&, const int, const AFIELD&, const int,
76  const int mu);
77 
78  private:
79 
81  void setup_channels();
82 
83  void init(int Nin);
84  void init(int Nin, std::vector<int>& bc);
85  void tidyup();
86 
87  void up_x(real_t *, real_t *);
88  void up_y(real_t *, real_t *);
89  void up_z(real_t *, real_t *);
90  void up_t(real_t *, real_t *);
91  void dn_x(real_t *, real_t *);
92  void dn_y(real_t *, real_t *);
93  void dn_z(real_t *, real_t *);
94  void dn_t(real_t *, real_t *);
95 
96  void up_x_nv(real_t *, real_t *);
97  void up_y_nv(real_t *, real_t *);
98  void up_z_nv(real_t *, real_t *);
99  void up_t_nv(real_t *, real_t *);
100  void dn_x_nv(real_t *, real_t *);
101  void dn_y_nv(real_t *, real_t *);
102  void dn_z_nv(real_t *, real_t *);
103  void dn_t_nv(real_t *, real_t *);
104 };
105 
106 #endif
ShiftAField_lex::setup_channels
void setup_channels()
setup channels for communication.
Definition: shiftAField_lex-tmpl.h:99
ShiftAField_lex< Field >::allocator_t
typename Field ::template aligned_allocator< char > allocator_t
Definition: shiftAField_lex.h:51
ShiftAField_lex::tidyup
void tidyup()
Definition: shiftAField_lex-tmpl.h:92
bridgeIO.h
ShiftAField_lex::up_z_nv
void up_z_nv(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:1089
ShiftAField_lex::backward
void backward(AFIELD &, const AFIELD &, const int mu)
Definition: shiftAField_lex-tmpl.h:132
communicator_impl.h
ShiftAField_lex::m_Nvol
int m_Nvol
Definition: shiftAField_lex.h:40
ShiftAField_lex::dn_z
void dn_z(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:1184
ShiftAField_lex::do_comm
int do_comm[4]
Definition: shiftAField_lex.h:47
ShiftAField_lex::m_Nin
int m_Nin
internal degree of freedom.
Definition: shiftAField_lex.h:39
ShiftAField_lex::up_y
void up_y(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:630
ShiftAField_lex::m_Nstv
int m_Nstv
Definition: shiftAField_lex.h:43
ChannelSet
ChannelSet class for a collection of channels.
Definition: channel.h:148
ShiftAField_lex::real_t
AFIELD::real_t real_t
Definition: shiftAField_lex.h:35
ShiftAField_lex
Methods to shift a field in the lexical site index.
Definition: shiftAField_lex.h:33
real_t
double real_t
Definition: bridgeQXS_Clover_coarse_double.cpp:16
ShiftAField_lex::do_comm_any
int do_comm_any
Definition: shiftAField_lex.h:48
ShiftAField_lex::chset_send
ChannelSet chset_send
Definition: shiftAField_lex.h:54
ShiftAField_lex::init
void init(int Nin)
Definition: shiftAField_lex-tmpl.h:16
ShiftAField_lex::chsend_up
std::vector< Channel > chsend_up
Definition: shiftAField_lex.h:53
ShiftAField_lex::operator=
ShiftAField_lex & operator=(const ShiftAField_lex &)
ShiftAField_lex::chrecv_dn
std::vector< Channel > chrecv_dn
Definition: shiftAField_lex.h:53
Field::real_t
double real_t
Definition: field.h:51
ShiftAField_lex::m_Nx
int m_Nx
Definition: shiftAField_lex.h:42
ShiftAField_lex::up_y_nv
void up_y_nv(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:718
ShiftAField_lex::dn_t
void dn_t(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:1551
ShiftAField_lex::class_name
static const std::string class_name
Definition: shiftAField_lex.h:36
ShiftAField_lex::m_Ny
int m_Ny
Definition: shiftAField_lex.h:42
ShiftAField_lex::m_Nbdsize
std::vector< int > m_Nbdsize
Definition: shiftAField_lex.h:50
ShiftAField_lex::chsend_dn
std::vector< Channel > chsend_dn
Definition: shiftAField_lex.h:53
ShiftAField_lex::m_Nt
int m_Nt
Definition: shiftAField_lex.h:42
ShiftAField_lex::dn_x
void dn_x(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:453
ShiftAField_lex::up_t
void up_t(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:1371
ShiftAField_lex::m_Ndim
int m_Ndim
Definition: shiftAField_lex.h:41
ShiftAField_lex::ShiftAField_lex
ShiftAField_lex(int nin)
Definition: shiftAField_lex.h:57
ShiftAField_lex::up_x_nv
void up_x_nv(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:383
ShiftAField_lex::dn_x_nv
void dn_x_nv(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:558
ShiftAField_lex::up_t_nv
void up_t_nv(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:1460
ShiftAField_lex::m_Nxv
int m_Nxv
Definition: shiftAField_lex.h:43
ShiftAField_lex::dn_y
void dn_y(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:811
ShiftAField_lex::dn_z_nv
void dn_z_nv(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:1274
ShiftAField_lex::~ShiftAField_lex
~ShiftAField_lex()
Definition: shiftAField_lex.h:62
ShiftAField_lex::chrecv_up
std::vector< Channel > chrecv_up
Definition: shiftAField_lex.h:53
ShiftAField_lex::up_x
void up_x(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:280
ShiftAField_lex::ShiftAField_lex
ShiftAField_lex(int nin, std::vector< int > &bc)
Definition: shiftAField_lex.h:59
ShiftAField_lex::m_boundary
std::vector< int > m_boundary
Definition: shiftAField_lex.h:44
ShiftAField_lex::up_z
void up_z(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:998
ShiftAField_lex::m_Nyv
int m_Nyv
Definition: shiftAField_lex.h:43
ShiftAField_lex::forward
void forward(AFIELD &, const AFIELD &, const int mu)
Definition: shiftAField_lex-tmpl.h:206
ShiftAField_lex::m_Nz
int m_Nz
Definition: shiftAField_lex.h:42
Field
Container of Field-type object.
Definition: field.h:46
communicator.h
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
ShiftAField_lex::dn_t_nv
void dn_t_nv(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:1638
ShiftAField_lex::m_vl
Bridge::VerboseLevel m_vl
Definition: shiftAField_lex.h:45
ShiftAField_lex::chset_recv
ChannelSet chset_recv
Definition: shiftAField_lex.h:54
Channel_impl
Definition: channel.h:86
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
ShiftAField_lex::dn_y_nv
void dn_y_nv(real_t *, real_t *)
Definition: shiftAField_lex-tmpl.h:901