32 const int nin = vlocal->
nin();
33 const int nvol = vlocal->
nvol();
34 const int nex = vlocal->
nex();
55 if ((nin != vglobal->
nin()) ||
56 (nex != vglobal->
nex()) ||
57 (Lvol != vglobal->
nvol())) {
65 Field vtmp(nin, nvol, nex);
69 for (
int iblock = 0; iblock < NPE; ++iblock) {
70 int ipx = (iblock) % NPEx;
71 int ipy = (iblock / NPEx) % NPEy;
72 int ipz = (iblock / NPEx / NPEy) % NPEz;
73 int ipt = (iblock / NPEx / NPEy / NPEz) % NPEt;
76 for (
int j = 0; j < nex; ++j) {
77 for (
int t = 0; t < Nt; ++t) {
78 int t2 = t + Nt * ipt;
80 for (
int z = 0; z < Nz; ++z) {
81 int z2 = z + Nz * ipz;
83 for (
int y = 0; y < Ny; ++y) {
84 int y2 = y + Ny * ipy;
86 for (
int x = 0; x < Nx; ++x) {
87 int x2 = x + Nx * ipx;
89 int lsite =
idx.
site(x, y, z, t);
90 int gsite = gindex.
site(x2, y2, z2, t2);
92 for (
int i = 0; i < nin; ++i) {
93 vtmp.
set(i, lsite, j, vglobal->
cmp(i, gsite, j));
102 const int size = nin * nvol * nex;
105 int coord[4] = { ipx, ipy, ipz, ipt, };
109 send_1to1(size, vlocal, &vtmp, ipe, 0, ipe);
121 const int nin = vlocal->
nin();
122 const int nvol = vlocal->
nvol();
123 const int nex = vlocal->
nex();
144 if ((nin != vglobal->
nin()) ||
145 (nex != vglobal->
nex()) ||
146 (Lvol != vglobal->
nvol())) {
154 Field vtmp(nin, nvol, nex);
158 for (
int iblock = 0; iblock < NPE; ++iblock) {
159 int ipx = (iblock) % NPEx;
160 int ipy = (iblock / NPEx) % NPEy;
161 int ipz = (iblock / NPEx / NPEy) % NPEz;
162 int ipt = (iblock / NPEx / NPEy / NPEz) % NPEt;
165 int coord[4] = { ipx, ipy, ipz, ipt, };
169 const int size = nin * nvol * nex;
171 send_1to1(size, &vtmp, vlocal, 0, ipe, ipe);
176 for (
int j = 0; j < nex; ++j) {
177 for (
int t = 0; t < Nt; ++t) {
178 int t2 = t + Nt * ipt;
179 for (
int z = 0; z < Nz; ++z) {
180 int z2 = z + Nz * ipz;
181 for (
int y = 0; y < Ny; ++y) {
182 int y2 = y + Ny * ipy;
183 for (
int x = 0; x < Nx; ++x) {
184 int x2 = x + Nx * ipx;
186 int site =
idx.
site(x, y, z, t);
187 int gsite = gindex.
site(x2, y2, z2, t2);
189 for (
int i = 0; i < nin; ++i) {
190 vglobal->
set(i, gsite, j, vtmp.
cmp(i, site, j));
208 #if defined(__BYTE_ORDER)
209 return __BYTE_ORDER == __BIG_ENDIAN;
220 return (u.c[
sizeof(
int) - 1] == 1) ?
true :
false;
236 uint16_t *p = (uint16_t *)ptr;
238 for (
unsigned int i = 0; i < nmemb; ++i) {
243 w |= v << 8 & 0xff00;
253 uint32_t *p = (uint32_t *)ptr;
255 for (
unsigned int i = 0; i < nmemb; ++i) {
259 w = v >> 24 & 0x000000ff;
260 w |= v >> 8 & 0x0000ff00;
261 w |= v << 8 & 0x00ff0000;
262 w |= v << 24 & 0xff000000;
272 uint32_t *p = (uint32_t *)ptr;
274 for (
unsigned int i = 0; i < nmemb; ++i) {
276 uint32_t v2 = *(p + 1);
279 w1 = v1 >> 24 & 0x000000ff;
280 w1 |= v1 >> 8 & 0x0000ff00;
281 w1 |= v1 << 8 & 0x00ff0000;
282 w1 |= v1 << 24 & 0xff000000;
284 w2 = v2 >> 24 & 0x000000ff;
285 w2 |= v2 >> 8 & 0x0000ff00;
286 w2 |= v2 << 8 & 0x00ff0000;
287 w2 |= v2 << 24 & 0xff000000;
312 for (
int i = 0, n = vv.size(); i < n; ++i) {
323 for (
int i = 0, n = vv.size(); i < n; ++i) {
static const std::string class_name
void set(const int jin, const int site, const int jex, double v)
int site(const int &x, const int &y, const int &z, const int &t) const
void deliver(Field *vlocal, Field *vglobal)
distribute data on primary node over parallel nodes.
Container of Field-type object.
double cmp(const int jin, const int site, const int jex) const
static bool is_bigendian()
std::string generate_filename(const char *fmt,...)
long long_t
definition of long for Bridge++
static int grid_rank(int *rank, const int *grid_coord)
find rank number from grid coordinate.
void crucial(const char *format,...)
int send_1to1(int count, Field *recv_buf, Field *send_buf, int p_to, int p_from, int tag)
virtual void read_file(Field *v, std::string)=0
read data from file.
virtual void write_file(Field *v, std::string)=0
write data to file.
static int sync()
synchronize within small world.
static void convert_endian(void *buf, size_t size, size_t nmemb)
check if machine byte order is big-endian.
static bool is_primary()
check if the present node is primary in small communicator.
void gather(Field *vglobal, Field *vlocal)
gather data on parallel nodes to primary node.
Bridge::VerboseLevel m_vl