32 int nin = vlocal->
nin();
33 int nvol = vlocal->
nvol();
34 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;
79 for (
int z = 0; z < Nz; ++z) {
80 int z2 = z + Nz * ipz;
81 for (
int y = 0; y < Ny; ++y) {
82 int y2 = y + Ny * ipy;
83 for (
int x = 0; x < Nx; ++x) {
84 int x2 = x + Nx * ipx;
86 int lsite =
idx.
site(x, y, z, t);
87 int gsite = gindex.
site(x2, y2, z2, t2);
89 for (
int i = 0; i < nin; ++i) {
90 vtmp.
set(i, lsite, j, vglobal->
cmp(i, gsite, j));
99 int size = nin * nvol * nex;
102 int coord[4] = { ipx, ipy, ipz, ipt, };
106 send_1to1(size, vlocal, &vtmp, ipe, 0, ipe);
118 int nin = vlocal->
nin();
119 int nvol = vlocal->
nvol();
120 int nex = vlocal->
nex();
141 if ((nin != vglobal->
nin()) ||
142 (nex != vglobal->
nex()) ||
143 (Lvol != vglobal->
nvol())) {
151 Field vtmp(nin, nvol, nex);
155 for (
int iblock = 0; iblock < NPE; ++iblock) {
156 int ipx = (iblock) % NPEx;
157 int ipy = (iblock / NPEx) % NPEy;
158 int ipz = (iblock / NPEx / NPEy) % NPEz;
159 int ipt = (iblock / NPEx / NPEy / NPEz) % NPEt;
162 int coord[4] = { ipx, ipy, ipz, ipt, };
166 int size = nin * nvol * nex;
168 send_1to1(size, &vtmp, vlocal, 0, ipe, ipe);
173 for (
int j = 0; j < nex; ++j) {
174 for (
int t = 0; t < Nt; ++t) {
175 int t2 = t + Nt * ipt;
176 for (
int z = 0; z < Nz; ++z) {
177 int z2 = z + Nz * ipz;
178 for (
int y = 0; y < Ny; ++y) {
179 int y2 = y + Ny * ipy;
180 for (
int x = 0; x < Nx; ++x) {
181 int x2 = x + Nx * ipx;
183 int site =
idx.
site(x, y, z, t);
184 int gsite = gindex.
site(x2, y2, z2, t2);
186 for (
int i = 0; i < nin; ++i) {
187 vglobal->
set(i, gsite, j, vtmp.
cmp(i, site, j));
205 #if defined(__BYTE_ORDER)
206 return __BYTE_ORDER == __BIG_ENDIAN;
218 return (u.c[
sizeof(
int) - 1] == 1) ?
true :
false;
234 uint16_t *p = (uint16_t *)ptr;
236 for (
unsigned int i = 0; i < nmemb; ++i) {
241 w |= v << 8 & 0xff00;
251 uint32_t *p = (uint32_t *)ptr;
253 for (
unsigned int i = 0; i < nmemb; ++i) {
257 w = v >> 24 & 0x000000ff;
258 w |= v >> 8 & 0x0000ff00;
259 w |= v << 8 & 0x00ff0000;
260 w |= v << 24 & 0xff000000;
270 uint32_t *p = (uint32_t *)ptr;
272 for (
unsigned int i = 0; i < nmemb; ++i) {
274 uint32_t v2 = *(p + 1);
277 w1 = v1 >> 24 & 0x000000ff;
278 w1 |= v1 >> 8 & 0x0000ff00;
279 w1 |= v1 << 8 & 0x00ff0000;
280 w1 |= v1 << 24 & 0xff000000;
282 w2 = v2 >> 24 & 0x000000ff;
283 w2 |= v2 >> 8 & 0x0000ff00;
284 w2 |= v2 << 8 & 0x00ff0000;
285 w2 |= v2 << 24 & 0xff000000;
308 for (
int i = 0, n = vv.size(); i < n; ++i) {
319 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,...)
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