Go to the documentation of this file.
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 set(const int jin, const int site, const int jex, double v)
void detailed(const char *format,...)
static bool is_bigendian()
void read_file(Field &v, const std::string &filename)
read data from file. (‘const’ is added [18 Mar 2021])
Bridge::VerboseLevel m_vl
void gather(Field *vglobal, Field *vlocal)
gather data on parallel nodes to primary node.
static const std::string class_name
void deliver(Field *vlocal, Field *vglobal)
distribute data on primary node over parallel nodes.
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
double cmp(const int jin, const int site, const int jex) const
static bool is_primary()
check if the present node is primary in small communicator.
void crucial(const char *format,...)
Container of Field-type object.
void write_file(Field &v, const std::string &filename)
write data to file. (‘const’ is added [18 Mar 2021])
const IO_Format::Format * m_format