37 int nin_field = v->
nin();
38 int nex_field = v->
nex();
43 if ((nin_file == 0) || (nex_file == 0)) {
55 vtmp.
reset(nin_field, Lvol, nex_field);
62 const int block_size = nin_file;
63 char buf[
sizeof(double) * block_size];
65 std::ifstream infile(filename.c_str(), std::ios::in | std::ios::binary);
67 vout.
crucial(
m_vl,
"file open failed: %s may not exist.\n", filename.c_str());
71 for (
int j = 0; j < nex_file; ++j) {
72 for (
int isite = 0; isite < Lvol; ++isite) {
74 infile.read(buf,
sizeof(
double) * block_size);
87 byte_swap(buf,
sizeof(
double), block_size);
90 double *ptr = (
double *)buf;
92 for (
int i = 0; i < nin_file; ++i) {
96 vtmp.
set(s, isite, t, ptr[i]);
113 int nin_field = v->
nin();
114 int nex_field = v->
nex();
119 if ((nin_file == 0) || (nex_file == 0)) {
120 nin_file = nin_field;
121 nex_file = nex_field;
128 vtmp.
reset(nin_field, Lvol, nex_field);
141 const int block_size = nin_file;
142 char buf[
sizeof(double) * block_size];
144 std::ofstream outfile(filename.c_str(), std::ios::out | std::ios::binary);
150 for (
int j = 0; j < nex_file; ++j) {
151 for (
int isite = 0; isite < Lvol; ++isite) {
152 double *ptr = (
double *)buf;
154 for (
int i = 0; i < nin_file; ++i) {
158 ptr[i] = vtmp.
cmp(s, isite, t);
162 byte_swap(buf,
sizeof(
double), block_size);
165 outfile.write(buf,
sizeof(
double) * block_size);
static void byte_swap(void *buf, size_t size, size_t nmemb)
< convert byte order. alternative interface.
void detailed(const char *format,...)
void set(const int jin, const int site, const int jex, double v)
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()
void write_file(Field *v, string filename)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
const IO_Format::Format * m_format
void crucial(const char *format,...)
void read_file(Field *v, string filename)
static const std::string class_name
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