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);
58 std::ifstream infile_header(filename.c_str());
66 const size_t max_header_size = 10000;
69 getline(infile_header, line);
70 if (line !=
"BEGIN_HEADER") {
76 while (line.find(
"END_HEADER") == std::string::npos)
78 if (infile_header.eof() ||
79 (max_header_size < infile_header.tellg())) {
81 "%s: the header is too large, maybe END_HEADER is missing\n",
87 getline(infile_header, line);
90 size_t offset = infile_header.tellg();
92 infile_header.close();
94 const int block_size = nin_file;
95 char buf[
sizeof(double) * block_size];
97 std::ifstream infile(filename.c_str(), std::ios::in | std::ios::binary);
102 infile.seekg(offset);
104 for (
int j = 0; j < nex_file; ++j) {
105 for (long_t isite = 0; isite < Lvol; ++isite) {
107 infile.read(buf,
sizeof(
double) * block_size);
120 byte_swap(buf,
sizeof(
double), block_size);
123 double *ptr = (
double *)buf;
125 for (
int i = 0; i < nin_file; ++i) {
129 vtmp.
set(s, isite, t, ptr[i]);
void set(const int jin, const int site, const int jex, double v)
void detailed(const char *format,...)
static bool is_bigendian()
Bridge::VerboseLevel m_vl
void read_file(Field &v, const std::string &filename)
read data from file. (‘const’ is added [18 Mar 2021])
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)
static bool is_primary()
check if the present node is primary in small communicator.
static const std::string class_name
void write_file(Field &v, const std::string &filename)
write data to file. (‘const’ is added [18 Mar 2021])
void crucial(const char *format,...)
Container of Field-type object.
void general(const char *format,...)
const IO_Format::Format * m_format