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, };
123 const int nin = vlocal->
nin();
124 const int nvol = vlocal->
nvol();
125 const int nex = vlocal->
nex();
146 if ((nin != vglobal->
nin()) ||
147 (nex != vglobal->
nex()) ||
148 (Lvol != vglobal->
nvol())) {
156 Field vtmp(nin, nvol, nex);
160 for (
int iblock = 0; iblock < NPE; ++iblock) {
161 int ipx = (iblock) % NPEx;
162 int ipy = (iblock / NPEx) % NPEy;
163 int ipz = (iblock / NPEx / NPEy) % NPEz;
164 int ipt = (iblock / NPEx / NPEy / NPEz) % NPEt;
167 int coord[4] = { ipx, ipy, ipz, ipt, };
171 const int size = nin * nvol * nex;
180 for (
int j = 0; j < nex; ++j) {
181 for (
int t = 0; t < Nt; ++t) {
182 int t2 = t + Nt * ipt;
183 for (
int z = 0; z < Nz; ++z) {
184 int z2 = z + Nz * ipz;
185 for (
int y = 0; y < Ny; ++y) {
186 int y2 = y + Ny * ipy;
187 for (
int x = 0; x < Nx; ++x) {
188 int x2 = x + Nx * ipx;
190 int site =
idx.
site(x, y, z, t);
191 int gsite = gindex.
site(x2, y2, z2, t2);
193 for (
int i = 0; i < nin; ++i) {
194 vglobal->
set(i, gsite, j, vtmp.
cmp(i, site, j));
212 #if defined(__BYTE_ORDER)
213 return __BYTE_ORDER == __BIG_ENDIAN;
224 return (u.c[
sizeof(
int) - 1] == 1) ?
true :
false;
240 uint16_t *p = (uint16_t *)ptr;
242 for (
unsigned int i = 0; i < nmemb; ++i) {
247 w |= v << 8 & 0xff00;
257 uint32_t *p = (uint32_t *)ptr;
259 for (
unsigned int i = 0; i < nmemb; ++i) {
263 w = v >> 24 & 0x000000ff;
264 w |= v >> 8 & 0x0000ff00;
265 w |= v << 8 & 0x00ff0000;
266 w |= v << 24 & 0xff000000;
276 uint32_t *p = (uint32_t *)ptr;
278 for (
unsigned int i = 0; i < nmemb; ++i) {
280 uint32_t v2 = *(p + 1);
283 w1 = v1 >> 24 & 0x000000ff;
284 w1 |= v1 >> 8 & 0x0000ff00;
285 w1 |= v1 << 8 & 0x00ff0000;
286 w1 |= v1 << 24 & 0xff000000;
288 w2 = v2 >> 24 & 0x000000ff;
289 w2 |= v2 >> 8 & 0x0000ff00;
290 w2 |= v2 << 8 & 0x00ff0000;
291 w2 |= v2 << 24 & 0xff000000;