31 int nin = vlocal->
nin();
32 int nvol = vlocal->
nvol();
33 int nex = vlocal->
nex();
54 if ((nin != vglobal->
nin()) ||
55 (nex != vglobal->
nex()) ||
56 (Lvol != vglobal->
nvol())) {
64 Field vtmp(nin, nvol, nex);
68 for (
int iblock = 0; iblock < NPE; ++iblock) {
69 int ipx = (iblock) % NPEx;
70 int ipy = (iblock / NPEx) % NPEy;
71 int ipz = (iblock / NPEx / NPEy) % NPEz;
72 int ipt = (iblock / NPEx / NPEy / NPEz) % NPEt;
75 for (
int j = 0; j < nex; ++j) {
76 for (
int t = 0; t < Nt; ++t) {
77 int t2 = t + Nt * ipt;
78 for (
int z = 0; z < Nz; ++z) {
79 int z2 = z + Nz * ipz;
80 for (
int y = 0; y < Ny; ++y) {
81 int y2 = y + Ny * ipy;
82 for (
int x = 0; x < Nx; ++x) {
83 int x2 = x + Nx * ipx;
85 int lsite =
idx.
site(x, y, z, t);
86 int gsite = gindex.
site(x2, y2, z2, t2);
88 for (
int i = 0; i < nin; ++i) {
89 vtmp.
set(i, lsite, j, vglobal->
cmp(i, gsite, j));
98 int size = nin * nvol * nex;
101 int coord[4] = { ipx, ipy, ipz, ipt, };
105 send_1to1(size, vlocal, &vtmp, ipe, 0, ipe);
117 int nin = vlocal->
nin();
118 int nvol = vlocal->
nvol();
119 int nex = vlocal->
nex();
140 if ((nin != vglobal->
nin()) ||
141 (nex != vglobal->
nex()) ||
142 (Lvol != vglobal->
nvol())) {
150 Field vtmp(nin, nvol, nex);
154 for (
int iblock = 0; iblock < NPE; ++iblock) {
155 int ipx = (iblock) % NPEx;
156 int ipy = (iblock / NPEx) % NPEy;
157 int ipz = (iblock / NPEx / NPEy) % NPEz;
158 int ipt = (iblock / NPEx / NPEy / NPEz) % NPEt;
161 int coord[4] = { ipx, ipy, ipz, ipt, };
165 int size = nin * nvol * nex;
167 send_1to1(size, &vtmp, vlocal, 0, ipe, ipe);
172 for (
int j = 0; j < nex; ++j) {
173 for (
int t = 0; t < Nt; ++t) {
174 int t2 = t + Nt * ipt;
175 for (
int z = 0; z < Nz; ++z) {
176 int z2 = z + Nz * ipz;
177 for (
int y = 0; y < Ny; ++y) {
178 int y2 = y + Ny * ipy;
179 for (
int x = 0; x < Nx; ++x) {
180 int x2 = x + Nx * ipx;
182 int site =
idx.
site(x, y, z, t);
183 int gsite = gindex.
site(x2, y2, z2, t2);
185 for (
int i = 0; i < nin; ++i) {
186 vglobal->
set(i, gsite, j, vtmp.
cmp(i, site, j));
204 #if defined(__BYTE_ORDER)
205 return __BYTE_ORDER == __BIG_ENDIAN;
217 return (u.c[
sizeof(
int) - 1] == 1) ?
true :
false;
233 uint16_t *p = (uint16_t *)ptr;
235 for (
unsigned int i = 0; i < nmemb; ++i) {
240 w |= v << 8 & 0xff00;
250 uint32_t *p = (uint32_t *)ptr;
252 for (
unsigned int i = 0; i < nmemb; ++i) {
256 w = v >> 24 & 0x000000ff;
257 w |= v >> 8 & 0x0000ff00;
258 w |= v << 8 & 0x00ff0000;
259 w |= v << 24 & 0xff000000;
269 uint32_t *p = (uint32_t *)ptr;
271 for (
unsigned int i = 0; i < nmemb; ++i) {
273 uint32_t v2 = *(p + 1);
276 w1 = v1 >> 24 & 0x000000ff;
277 w1 |= v1 >> 8 & 0x0000ff00;
278 w1 |= v1 << 8 & 0x00ff0000;
279 w1 |= v1 << 24 & 0xff000000;
281 w2 = v2 >> 24 & 0x000000ff;
282 w2 |= v2 >> 8 & 0x0000ff00;
283 w2 |= v2 << 8 & 0x00ff0000;
284 w2 |= v2 << 24 & 0xff000000;
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()
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)
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