31 const int nin_field = v->
nin();
32 const int nex_field = v->
nex();
37 if ((nin_file == 0) || (nex_file == 0)) {
49 vtmp.
reset(nin_field, Lvol, nex_field);
56 const int block_size = nin_file;
57 char buf[
sizeof(double) * block_size];
59 std::ifstream infile(filename.c_str(), std::ios::in | std::ios::binary);
65 for (
int j = 0; j < nex_file; ++j) {
66 for (
long_t isite = 0; isite < Lvol; ++isite) {
68 infile.read(buf,
sizeof(
double) * block_size);
81 byte_swap(buf,
sizeof(
double), block_size);
84 double *ptr = (
double *)buf;
86 for (
int i = 0; i < nin_file; ++i) {
90 vtmp.
set(s, isite, t, ptr[i]);
107 const int nin_field = v->
nin();
108 const int nex_field = v->
nex();
113 if ((nin_file == 0) || (nex_file == 0)) {
114 nin_file = nin_field;
115 nex_file = nex_field;
122 vtmp.
reset(nin_field, Lvol, nex_field);
135 const int block_size = nin_file;
136 char buf[
sizeof(double) * block_size];
138 std::ofstream outfile(filename.c_str(), std::ios::out | std::ios::binary);
144 for (
int j = 0; j < nex_file; ++j) {
145 for (
long_t isite = 0; isite < Lvol; ++isite) {
146 double *ptr = (
double *)buf;
148 for (
int i = 0; i < nin_file; ++i) {
152 ptr[i] = vtmp.
cmp(s, isite, t);
156 byte_swap(buf,
sizeof(
double), block_size);
159 outfile.write(buf,
sizeof(
double) * block_size);
void read_file(Field *v, const std::string filename)
read data from file.
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, const std::string filename)
write data to file.
const IO_Format::Format * m_format
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
long long_t
definition of long for Bridge++
void crucial(const char *format,...)
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