|
QDP++
|
QIO class. More...
#include <qdp_qdpio.h>
Public Member Functions | |
| QDPFileReader () | |
| Partial constructor. | |
| ~QDPFileReader () | |
| Closes the last file opened. | |
| QDPFileReader (XMLReader &xml, const std::string &path, QDP_serialparallel_t qdp_serpar) | |
| Opens a file for reading. | |
| void | open (XMLReader &xml, const std::string &path, QDP_serialparallel_t qdp_serpar) |
| Opens a file for reading. | |
| void | close () |
| Closes the last file opened. | |
| bool | is_open () |
| Queries whether a file is open. | |
| void | read (XMLReader &xml) |
| Reads a record header only. | |
| template<class T, class C> | |
| void | read (XMLReader &xml, QDPType< T, C > &s1) |
| Read a QDP object. | |
| template<class T> | |
| void | read (XMLReader &xml, OScalar< T > &s1) |
| Reads an OScalar object. | |
| template<class T> | |
| void | read (XMLReader &xml, OLattice< T > &s1) |
| Reads an OLattice object. | |
| template<class T> | |
| void | read (XMLReader &xml, multi1d< OScalar< T > > &s1) |
| Reads an array of objects all in a single record. | |
| template<class T> | |
| void | read (XMLReader &xml, multi1d< OLattice< T > > &s1) |
| Reads an array of objects all in a single record. | |
| void | read (XMLReader &xml, BinaryBufferReader &s1) |
| Reads an XMLReader plus BinaryBufferReader pair. | |
| bool | eof () const |
| Query whether the end-of-file has been reached. | |
| bool | bad () const |
| Query whether an unrecoverable error has occurred. | |
| void | clear (QDP_iostate_t state=QDPIO_goodbit) |
| Sets a new value for the IO status, ignoring the existing value. | |
Protected Member Functions | |
| QIO_Reader * | get () const |
QIO class.
This is a QDP object wrapper around the QIO library.
QIO is a C library independentof QDP. It is designed to read/write SCIDAC format data files, which means a mixture of binary data and XML metadata together in the same file according to a scheme called Lime. There is a seperate independent library for handling general Lime files.
The data is assumed to be a record in a Lime file. The user metadata (both file and record) is also read.
Data is assumed to be stored in the file in big-endian format and any necessary byte-swapping is taken care of.
The status of the IO operations is monitored internally and can be queried.
Definition at line 326 of file qdp_qdpio.h.
| QDP::QDPFileReader::QDPFileReader | ( | ) |
Partial constructor.
Definition at line 106 of file qdp_qdpio.cc.
| QDP::QDPFileReader::~QDPFileReader | ( | ) |
| QDP::QDPFileReader::QDPFileReader | ( | XMLReader & | xml, |
| const std::string & | path, | ||
| QDP_serialparallel_t | qdp_serpar ) |
Opens a file for reading.
Also reads the file user metadata record.
| xml | Container for the file metadata. |
| path | The name of the file. |
| qdp_serpar | Serial or parallel IO. |
Definition at line 108 of file qdp_qdpio.cc.
References open().
| bool QDP::QDPFileReader::bad | ( | ) | const |
Query whether an unrecoverable error has occurred.
Definition at line 197 of file qdp_qdpio.cc.
| void QDP::QDPFileReader::clear | ( | QDP_iostate_t | state = QDPIO_goodbit | ) |
| void QDP::QDPFileReader::close | ( | ) |
Closes the last file opened.
Definition at line 181 of file qdp_qdpio.cc.
References is_open(), and QDP::QDPIO_badbit.
Referenced by QDP::close(), and ~QDPFileReader().
| bool QDP::QDPFileReader::eof | ( | ) | const |
Query whether the end-of-file has been reached.
Definition at line 195 of file qdp_qdpio.cc.
|
inlineprotected |
Definition at line 411 of file qdp_qdpio.h.
| bool QDP::QDPFileReader::is_open | ( | ) |
Queries whether a file is open.
Definition at line 193 of file qdp_qdpio.cc.
Referenced by close(), and QDP::is_open().
| void QDP::QDPFileReader::open | ( | XMLReader & | xml, |
| const std::string & | path, | ||
| QDP_serialparallel_t | qdp_serpar ) |
Opens a file for reading.
Also reads the file user metadata record.
| xml | Container for the file metadata. |
| path | The name of the file. |
| qdp_serpar | Serial or parallel IO. |
Definition at line 113 of file qdp_qdpio.cc.
References QDP::QDPIO::cerr, QDP::get_coords(), QIO_Layout::get_coords, QDP::get_node_index(), QDP::get_node_number(), QDP::get_sites_on_node(), QDP::io_node(), QIO_Layout::latdim, QIO_Layout::latsize, QDP::Layout::lattSize(), QDP::master_io_node(), QIO_Filesystem::master_io_node, QIO_Filesystem::my_io_node, QDP::Nd, QIO_Layout::node_index, QIO_Layout::node_number, QDP::Layout::nodeNumber(), QIO_Layout::num_sites, QIO_Layout::number_of_nodes, QDP::Layout::numNodes(), QDP::XMLReader::open(), QDP::Layout::primaryNode(), QDP::QDP_abort(), QDP::QDPIO_badbit, QDP::QDPIO_goodbit, QDP::QDPIO_PARALLEL, QIO_Iflag::serpar, QIO_Layout::sites_on_node, QDP::Layout::sitesOnNode(), QIO_Layout::this_node, QDP::Layout::vol(), QIO_Iflag::volfmt, and QIO_Layout::volume.
Referenced by QDPFileReader().
| void QDP::QDPFileReader::read | ( | XMLReader & | xml | ) |
Reads a record header only.
Definition at line 221 of file qdp_qdpio.cc.
References QDP::QDPIO::cerr, QDP::XMLReader::open(), QDP::Layout::primaryNode(), and QDP::QDP_abort().
Referenced by read(), QDP::read(), QDP::read(), QDP::read(), QDP::read(), and QDP::read().
| void QDP::QDPFileReader::read | ( | XMLReader & | rec_xml, |
| BinaryBufferReader & | s1 ) |
Reads an XMLReader plus BinaryBufferReader pair.
| rec_xml | The (user) record metadata. |
| sl | The data |
Definition at line 249 of file qdp_qdpio.cc.
References QDP::QDPIO::cerr, clear(), QDP::QDPIO::cout, QDP::BinaryBufferReader::open(), QDP::XMLReader::open(), QDP::Layout::primaryNode(), QDP::QDP_abort(), QDP::QDPIO_badbit, and QDP::QDPOScalarFactoryPut().