186 template<
class T,
int N>
191 template<
class T,
int N>
194 template<
class T,
int N>
199 template<
class T,
int N>
205 template<
class T,
int N>
210 template<
class T,
int N>
213 template<
class T,
int N>
218 template<
class T,
int N>
222 template<
template <
class>
class T1,
class T2>
227 template<
template <
class>
class T1,
class T2>
263 template<
class T,
int N>
268 template<
class T,
int N>
271 template<
class T,
int N>
276 template<
class T,
int N>
282 template<
class T,
int N>
287 template<
class T,
int N>
290 template<
class T,
int N>
295 template<
class T,
int N>
299 template<
template <
class>
class T1,
class T2>
304 template<
template <
class>
class T1,
class T2>
369 template<
class T,
class C>
371 {this->
read(xml,
static_cast<C&
>(s1));}
431 qsw.
read(rec_xml,s1);
443 qsw.
read(rec_xml,s1);
455 qsw.
read(rec_xml,s1);
467 qsw.
read(rec_xml,s1);
479 qsw.
read(rec_xml,s1);
483 void close(QDPFileReader& qsw);
486 bool is_open(QDPFileReader& qsw);
541 const std::string& data_LFN);
567 const std::string& data_LFN);
599 const std::string& data_LFN);
616 const std::string& data_LFN);
632 template<
class T,
class C>
634 {this->
write(xml,
static_cast<const C&
>(s1));}
733 qsw.
write(rec_xml,s1);
745 qsw.
write(rec_xml,s1);
759 qsw.
write(rec_xml,s1, lower_left, upper_right);
771 qsw.
write(rec_xml,s1);
783 qsw.
write(rec_xml,s1);
797 qsw.
write(rec_xml,s1,lower_left, upper_right);
809 qsw.
write(rec_xml,s1);
813 void close(QDPFileWriter& qsw);
816 bool is_open(QDPFileWriter& qsw);
839 void *dest = (
void*)(field+linear);
840 memcpy(dest,(
const void*)buf,count*
sizeof(T));
863 QDPIO::cerr <<
"Failed to read the Record Info" << std::endl;
870 QDPIO::cout <<
"Single Precision Read" << std::endl;
876 (
void *)(&(from_disk.
elem())));
888 QDPIO::cout <<
"Reading Double Precision" << std::endl;
894 (
void *)(&(from_disk.
elem())));
907 QDPIO::cout <<
"Reading I or U Precision" << std::endl;
912 (
void *)(&(s1.
elem())));
923 std::istringstream ss;
954 QDPIO::cerr <<
"Failed to read the Record Info" << std::endl;
961 QDPIO::cout <<
"Single Precision Read" << std::endl;
967 (
void *)from_disk.
slice());
976 for(
int i=0; i < from_disk.
size(); i++) {
977 s1[i] = from_disk[i];
984 QDPIO::cout <<
"Reading Double Precision" << std::endl;
990 (
void *)from_disk.
slice());
999 for(
int i=0; i < from_disk.
size(); i++) {
1000 s1[i] = from_disk[i];
1006 QDPIO::cout <<
"Reading I or U Precision" << std::endl;
1009 s1.size()*
sizeof(T),
1011 (
void *)s1.slice());
1013 QDPIO::cerr <<
"Failed to read data" << std::endl;
1022 std::istringstream ss;
1054 T *field = (T *)arg;
1056 void *src = (
void*)(field+linear);
1057 memcpy(buf,(
const void*)src,count*
sizeof(T));
1085 QDPIO::cerr <<
"QDPFileWriter::write - error in creating XML string" << std::endl;
1097 QDPIO::cerr <<
"QDPFileWriter: error in write" << std::endl;
1130 sizeof(T), s1.size());
1140 QDPIO::cerr <<
"QDPFileWriter::write - error in creating XML string" << std::endl;
1147 s1.size()*
sizeof(T),
1151 QDPIO::cerr <<
"QDPFileWriter: error in write" << std::endl;
1186 T *field = (T *)arg;
1188 void *dest = (
void*)(field+linear);
1189 memcpy(dest,(
const void*)buf,count*
sizeof(T));
1208 for(
int i=0; i < field.
size(); ++i)
1210 void *dest = (
void*)&(field[i].elem(linear));
1211 memcpy(dest,(
const void*)buf,
sizeof(T));
1235 QDPIO::cerr <<
"Failed to read the Record Info" << std::endl;
1242 QDPIO::cout <<
"Single Precision Read" << std::endl;
1251 (
void *)from_disk.
getF());
1254 QDPIO::cerr <<
"Failed to read data" << std::endl;
1264 QDPIO::cout <<
"Reading Double Precision" << std::endl;
1273 (
void *)from_disk.
getF());
1276 QDPIO::cerr <<
"Failed to read data" << std::endl;
1289 QDPIO::cout <<
"Reading I or U precisions" << std::endl;
1297 QDPIO::cerr <<
"Failed to read data" << std::endl;
1306 std::istringstream ss;
1323 template<
typename T>
1335 QDPIO::cerr <<
"Failed to read the Record Info" << std::endl;
1342 QDPIO::cout <<
"Single Precision Read" << std::endl;
1344 for(
int i=0; i < s1.size(); i++) {
zero_rep(from_disk[i]); }
1350 (
void *)&from_disk);
1352 QDPIO::cerr <<
"Failed to read data" << std::endl;
1359 for(
int i=0; i < from_disk.
size(); i++) {
1360 s1[i] = from_disk[i];
1367 QDPIO::cout <<
"Reading Double Precision" << std::endl;
1369 for(
int i=0; i < s1.size(); i++) {
zero_rep(from_disk[i]); }
1375 (
void *)&from_disk);
1377 QDPIO::cerr <<
"Failed to read data" << std::endl;
1384 for(
int i=0; i < from_disk.
size(); i++) {
1385 s1[i] = from_disk[i];
1391 QDPIO::cout <<
"Reading I or U Precision" << std::endl;
1394 s1.size()*
sizeof(T),
1398 QDPIO::cerr <<
"Failed to read data" << std::endl;
1407 std::istringstream ss;
1416 catch(
const std::string& e) {
1436 T *field = (T *)arg;
1438 void *src = (
void*)(field+linear);
1439 memcpy(buf,(
const void*)src,count*
sizeof(T));
1457 for(
int i=0; i < field.
size(); ++i)
1459 void *src = (
void*)&(field[i].elem(linear));
1460 memcpy(buf,(
const void*)src,
sizeof(T));
1490 QDPIO::cerr <<
"QDPFileWriter::write - error in creating XML string" << std::endl;
1501 QDPIO::cerr <<
"QDPFileWriter: error in write" << std::endl;
1525 if( lower_left.
size() != upper_right.
size()) {
1526 QDPIO::cerr <<
"QDPFileWriter: Error! Lower left and upper right corner of hypercube to write have different dimensions" << std::endl;
1531 (
int *)lower_left.
slice(),
1532 (
int *)upper_right.
slice(),
1546 QDPIO::cerr <<
"QDPFileWriter::write - error in creating XML string" << std::endl;
1557 QDPIO::cerr <<
"QDPFileWriter: error in write" << std::endl;
1582 sizeof(T), s1.size() );
1591 QDPIO::cerr <<
"QDPFileWriter::write - error in creating XML string" << std::endl;
1598 s1.size()*
sizeof(T),
1602 QDPIO::cerr <<
"QDPFileWriter: error in write" << std::endl;
1628 if( lower_left.
size() != upper_right.
size()) {
1629 QDPIO::cerr <<
"QDPFileWriter: Error! Lower left and upper right corner of hypercube to write have different dimensions" << std::endl;
1634 (
int *)(lower_left.
slice()),
1635 (
int *)(upper_right.
slice()),
1640 sizeof(T), s1.size() );
1649 QDPIO::cerr <<
"QDPFileWriter::write - error in creating XML string" << std::endl;
1656 s1.size()*
sizeof(T),
1660 QDPIO::cerr <<
"QDPFileWriter: error in write" << std::endl;
Binary buffer input class.
Binary buffer output class.
T * getF() const
The backdoor.
Outer grid Scalar class */.
Primitive color Matrix class.
Primitive color Vector class.
Primitive Spin Matrix class.
Primitive spin Vector class.
bool bad() const
Query whether an unrecoverable error has occurred.
void close()
Closes the last file opened.
void open(XMLReader &xml, const std::string &path, QDP_serialparallel_t qdp_serpar)
Opens a file for reading.
~QDPFileReader()
Closes the last file opened.
bool is_open()
Queries whether a file is open.
void read(XMLReader &xml, QDPType< T, C > &s1)
Read a QDP object.
void read(XMLReader &xml)
Reads a record header only.
bool eof() const
Query whether the end-of-file has been reached.
void clear(QDP_iostate_t state=QDPIO_goodbit)
Sets a new value for the IO status, ignoring the existing value.
QDPFileReader()
Partial constructor.
bool bad() const
Query whether an unrecoverable error has occurred.
QDPFileWriter()
Partial constructor.
~QDPFileWriter()
Closes the last file opened.
void write(XMLBufferWriter &xml, const QDPType< T, C > &s1)
Write a QDP object.
void clear(QDP_iostate_t state=QDPIO_goodbit)
Sets a new value for the control state ignoring the existing value.
void close()
Closes the last file opened.
void open(XMLBufferWriter &xml, const std::string &path, QDP_volfmt_t qdp_volfmt, QDP_serialparallel_t qdp_serpar)
Opens a file for writing and writes the file metadata.
bool is_open()
Queries whether a file is open.
QDPType - major type class/container for all QDP objects.
Scalar reality (not complex).
Writes XML metadata to a buffer.
std::string str() const
Return entire buffer as a string.
void open(const std::string &filename)
Opens and reads an XML file.
Container for a multi-dimensional 1D array.
int size() const
Size of array.
const T * slice() const
Return ref to a column slice.
void write(BinaryWriter &bin, const std::string &output)
void read(BinaryReader &bin, std::string &input, size_t maxBytes)
void zero_rep(IScalar< T > &dest)
dest = 0
OLattice< PScalar< PColorMatrix< RComplexFloat, 3 > > > C
void QDPOScalarFactoryPut(char *buf, size_t linear, int count, void *arg)
Function for moving data.
QDP_serialparallel_t
File access mode.
bool is_open(QDPFileReader &qsw)
Is a QDPFileReader open.
char * QIOStringTraits< float >::tprec
char * QIOStringTraits< multi1d< LatticeColorMatrixF3 > >::tname
void QDPOLatticeFactoryPut(char *buf, size_t linear, int count, void *arg)
Writes a BinaryBufferWriter object.
void close(QDPFileReader &qsw)
Close a QDPFileReader.
QDP_filemode_t
File open mode.
int NumSpins< RScalar< T > >::value
void QDPOLatticeFactoryGet(char *buf, size_t linear, int count, void *arg)
Function for moving data.
void QDPOScalarFactoryGet(char *buf, size_t linear, int count, void *arg)
Function for moving data.
QDP_iostate_t
QDPIO state.
void QDPOLatticeFactoryGetArray(char *buf, size_t linear, int count, void *arg)
Function for moving array data.
void QDPOLatticeFactoryPutArray(char *buf, size_t linear, int count, void *arg)
Function for moving array data.
bool primaryNode()
Returns whether this is the primary node.
StandardOutputStream cout
StandardOutputStream cerr
Yet another random number generator.
void QDP_abort(int status)
Panic button.
int QIO_read_record_data(QIO_Reader *in, void(*put)(char *buf, size_t index, int count, void *arg), size_t datum_size, int word_size, void *arg)
int QIO_write(QIO_Writer *out, QIO_RecordInfo *record_info, QIO_String *xml_record, void(*get)(char *buf, size_t index, int count, void *arg), size_t datum_size, int word_size, void *arg)
int QIO_read_record_info(QIO_Reader *in, QIO_RecordInfo *record_info, QIO_String *xml_record)
void QIO_string_set(QIO_String *qs, const char *const string)
char * QIO_string_ptr(QIO_String *qs)
QIO_String * QIO_string_create(void)
void QIO_string_destroy(QIO_String *qs)
QIO_RecordInfo * QIO_create_record_info(int recordtype, int lower[], int upper[], int n, char *datatype, char *precision, int colors, int spins, int typesize, int datacount)
void QIO_destroy_record_info(QIO_RecordInfo *record_info)
char * QIO_get_precision(QIO_RecordInfo *record_info)
QIO Type and precision strings.
Find the underlying word type of a field.