40 int nin_field = v->
nin();
41 int nex_field = v->
nex();
46 if ((nin_file == 0) || (nex_file == 0)) {
58 vtmp.
reset(nin_field, Lvol, nex_field);
65 const int block_size = nin_file;
66 char buf[
sizeof(double) * block_size];
68 std::ifstream infile(filename.c_str(), std::ios::in | std::ios::binary);
70 vout.
crucial(
m_vl,
"file open failed: %s may not exist.\n", filename.c_str());
74 for (
int j = 0; j < nex_file; ++j) {
75 for (
int isite = 0; isite < Lvol; ++isite) {
77 infile.read(buf,
sizeof(
double) * block_size);
90 byte_swap(buf,
sizeof(
double), block_size);
93 double *ptr = (
double *)buf;
95 for (
int i = 0; i < nin_file; ++i) {
99 vtmp.
set(s, isite, t, ptr[i]);
116 int nin_field = v->
nin();
117 int nex_field = v->
nex();
122 if ((nin_file == 0) || (nex_file == 0)) {
123 nin_file = nin_field;
124 nex_file = nex_field;
131 vtmp.
reset(nin_field, Lvol, nex_field);
144 const int block_size = nin_file;
145 char buf[
sizeof(double) * block_size];
147 std::ofstream outfile(filename.c_str(), std::ios::out | std::ios::binary);
153 for (
int j = 0; j < nex_file; ++j) {
154 for (
int isite = 0; isite < Lvol; ++isite) {
155 double *ptr = (
double *)buf;
157 for (
int i = 0; i < nin_file; ++i) {
161 ptr[i] = vtmp.
cmp(s, isite, t);
165 byte_swap(buf,
sizeof(
double), block_size);
168 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