29 int nin = vlocal->
nin();
30 int nvol = vlocal->
nvol();
31 int nex = vlocal->
nex();
52 if ((nin != vglobal->
nin()) ||
53 (nex != vglobal->
nex()) ||
54 (Lvol != vglobal->
nvol())) {
62 Field vtmp(nin, nvol, nex);
66 for (
int iblock = 0; iblock < NPE; ++iblock) {
67 int ipx = (iblock) % NPEx;
68 int ipy = (iblock / NPEx) % NPEy;
69 int ipz = (iblock / NPEx / NPEy) % NPEz;
70 int ipt = (iblock / NPEx / NPEy / NPEz) % NPEt;
73 for (
int j = 0; j < nex; ++j) {
74 for (
int t = 0; t < Nt; ++t) {
75 int t2 = t + Nt * ipt;
76 for (
int z = 0; z < Nz; ++z) {
77 int z2 = z + Nz * ipz;
78 for (
int y = 0; y < Ny; ++y) {
79 int y2 = y + Ny * ipy;
80 for (
int x = 0; x < Nx; ++x) {
81 int x2 = x + Nx * ipx;
83 int lsite =
idx.
site(x, y, z, t);
84 int gsite = gindex.
site(x2, y2, z2, t2);
86 for (
int i = 0; i < nin; ++i) {
87 vtmp.
set(i, lsite, j, vglobal->
cmp(i, gsite, j));
96 int size = nin * nvol * nex;
99 int coord[4] = { ipx, ipy, ipz, ipt, };
103 send_1to1(size, vlocal, &vtmp, ipe, 0, ipe);
115 int nin = vlocal->
nin();
116 int nvol = vlocal->
nvol();
117 int nex = vlocal->
nex();
138 if ((nin != vglobal->
nin()) ||
139 (nex != vglobal->
nex()) ||
140 (Lvol != vglobal->
nvol())) {
148 Field vtmp(nin, nvol, nex);
152 for (
int iblock = 0; iblock < NPE; ++iblock) {
153 int ipx = (iblock) % NPEx;
154 int ipy = (iblock / NPEx) % NPEy;
155 int ipz = (iblock / NPEx / NPEy) % NPEz;
156 int ipt = (iblock / NPEx / NPEy / NPEz) % NPEt;
159 int coord[4] = { ipx, ipy, ipz, ipt, };
163 int size = nin * nvol * nex;
165 send_1to1(size, &vtmp, vlocal, 0, ipe, ipe);
170 for (
int j = 0; j < nex; ++j) {
171 for (
int t = 0; t < Nt; ++t) {
172 int t2 = t + Nt * ipt;
173 for (
int z = 0; z < Nz; ++z) {
174 int z2 = z + Nz * ipz;
175 for (
int y = 0; y < Ny; ++y) {
176 int y2 = y + Ny * ipy;
177 for (
int x = 0; x < Nx; ++x) {
178 int x2 = x + Nx * ipx;
180 int site =
idx.
site(x, y, z, t);
181 int gsite = gindex.
site(x2, y2, z2, t2);
183 for (
int i = 0; i < nin; ++i) {
184 vglobal->
set(i, gsite, j, vtmp.
cmp(i, site, j));
202 #if defined(__BYTE_ORDER)
203 return __BYTE_ORDER == __BIG_ENDIAN;
215 return (u.c[
sizeof(
int) - 1] == 1) ?
true :
false;
231 uint16_t *p = (uint16_t *)ptr;
233 for (
unsigned int i = 0; i < nmemb; ++i) {
238 w |= v << 8 & 0xff00;
248 uint32_t *p = (uint32_t *)ptr;
250 for (
unsigned int i = 0; i < nmemb; ++i) {
254 w = v >> 24 & 0x000000ff;
255 w |= v >> 8 & 0x0000ff00;
256 w |= v << 8 & 0x00ff0000;
257 w |= v << 24 & 0xff000000;
267 uint32_t *p = (uint32_t *)ptr;
269 for (
unsigned int i = 0; i < nmemb; ++i) {
271 uint32_t v2 = *(p + 1);
274 w1 = v1 >> 24 & 0x000000ff;
275 w1 |= v1 >> 8 & 0x0000ff00;
276 w1 |= v1 << 8 & 0x00ff0000;
277 w1 |= v1 << 24 & 0xff000000;
279 w2 = v2 >> 24 & 0x000000ff;
280 w2 |= v2 >> 8 & 0x0000ff00;
281 w2 |= v2 << 8 & 0x00ff0000;
282 w2 |= v2 << 24 & 0xff000000;