|
QDP++
|
QIO writer class. More...
#include <qdp_qdpio.h>
Public Member Functions | |
| QDPFileWriter () | |
| Partial constructor. | |
| ~QDPFileWriter () | |
| Closes the last file opened. | |
| QDPFileWriter (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. | |
| QDPFileWriter (XMLBufferWriter &xml, const std::string &path, QDP_volfmt_t qdp_volfmt, QDP_serialparallel_t qdp_serpar, const std::string &data_LFN) | |
| Opens a file for writing and writes the file metadata. | |
| 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. | |
| void | open (XMLBufferWriter &xml, const std::string &path, QDP_volfmt_t qdp_volfmt, QDP_serialparallel_t qdp_serpar, const std::string &data_LFN) |
| Opens a file for writing and writes the file metadata. | |
| QDPFileWriter (XMLBufferWriter &xml, const std::string &path, QDP_volfmt_t qdp_volfmt, QDP_serialparallel_t qdp_serpar, QDP_filemode_t qdp_mode) | |
| Opens a file for writing and writes the file metadata. | |
| QDPFileWriter (XMLBufferWriter &xml, const std::string &path, QDP_volfmt_t qdp_volfmt, QDP_serialparallel_t qdp_serpar, QDP_filemode_t qdp_mode, const std::string &data_LFN) | |
| Opens a file for writing and writes the file metadata. | |
| void | open (XMLBufferWriter &xml, const std::string &path, QDP_volfmt_t qdp_volfmt, QDP_serialparallel_t qdp_serpar, QDP_filemode_t qdp_mode, const std::string &data_LFN) |
| Opens a file for writing and writes the file metadata. | |
| void | close () |
| Closes the last file opened. | |
| bool | is_open () |
| Queries whether a file is open. | |
| template<class T, class C> | |
| void | write (XMLBufferWriter &xml, const QDPType< T, C > &s1) |
| Write a QDP object. | |
| template<class T> | |
| void | write (XMLBufferWriter &xml, const OScalar< T > &s1) |
| Writes an OScalar object. | |
| template<class T> | |
| void | write (XMLBufferWriter &xml, const OLattice< T > &s1) |
| Writes an OLattice object. | |
| template<class T> | |
| void | write (XMLBufferWriter &xml, const OLattice< T > &s1, const multi1d< int > &lower_left, const multi1d< int > &upper_right) |
| Writes a hypercube from an OLattice object. | |
| template<class T> | |
| void | write (XMLBufferWriter &xml, const multi1d< OScalar< T > > &s1) |
| Writes an array of objects all to a single record. | |
| template<class T> | |
| void | write (XMLBufferWriter &xml, const multi1d< OLattice< T > > &s1) |
| Writes an array of objects all to a single record. | |
| template<class T> | |
| void | write (XMLBufferWriter &xml, const multi1d< OLattice< T > > &s1, const multi1d< int > &lower_left, const multi1d< int > &upper_right) |
| Writes a hypercube of an array of objects all to a single record. | |
| void | write (XMLBufferWriter &xml, BinaryBufferWriter &s1) |
| Writes an XML plus Binary writer pair. | |
| bool | bad () const |
| Query whether an unrecoverable error has occurred. | |
| void | clear (QDP_iostate_t state=QDPIO_goodbit) |
| Sets a new value for the control state ignoring the existing value. | |
Protected Member Functions | |
| QIO_Writer * | get () const |
QIO writer class.
This is a QDP object wrapper around the QIO library.
QIO is a C library independent of 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 written as a record in a Lime file. The user metadata (both file and record) is also written.
Data is 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 508 of file qdp_qdpio.h.
| QDP::QDPFileWriter::QDPFileWriter | ( | ) |
Partial constructor.
Definition at line 294 of file qdp_qdpio.cc.
| QDP::QDPFileWriter::~QDPFileWriter | ( | ) |
| QDP::QDPFileWriter::QDPFileWriter | ( | 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.
Also reads the file user metadata record.
| xml | Container for the file metadata |
| path | The name of the file |
| qdp_volfmt | The type of file to write. |
| qdp_serpar | Serial or parallel IO |
Definition at line 335 of file qdp_qdpio.cc.
References open(), and QDP::QDPIO_OPEN.
| QDP::QDPFileWriter::QDPFileWriter | ( | XMLBufferWriter & | xml, |
| const std::string & | path, | ||
| QDP_volfmt_t | qdp_volfmt, | ||
| QDP_serialparallel_t | qdp_serpar, | ||
| const std::string & | data_LFN ) |
Opens a file for writing and writes the file metadata.
Also reads the file user metadata record.
| xml | Container for the file metadata |
| path | The name of the file |
| qdp_volfmt | The type of file to write. |
| qdp_serpar | Serial or parallel IO |
| data_LFN | LFN for ILDG style output |
Definition at line 344 of file qdp_qdpio.cc.
References open(), and QDP::QDPIO_OPEN.
| QDP::QDPFileWriter::QDPFileWriter | ( | XMLBufferWriter & | xml, |
| const std::string & | path, | ||
| QDP_volfmt_t | qdp_volfmt, | ||
| QDP_serialparallel_t | qdp_serpar, | ||
| QDP_filemode_t | qdp_mode ) |
Opens a file for writing and writes the file metadata.
Also reads the file user metadata record.
| xml | Container for the file metadata |
| path | The name of the file |
| qdp_volfmt | The type of file to write. |
| qdp_serpar | Serial or parallel IO |
| qdp_mode | The file opening mode |
Definition at line 296 of file qdp_qdpio.cc.
References open().
| QDP::QDPFileWriter::QDPFileWriter | ( | XMLBufferWriter & | xml, |
| const std::string & | path, | ||
| QDP_volfmt_t | qdp_volfmt, | ||
| QDP_serialparallel_t | qdp_serpar, | ||
| QDP_filemode_t | qdp_mode, | ||
| const std::string & | data_LFN ) |
Opens a file for writing and writes the file metadata.
Also reads the file user metadata record.
| xml | Container for the file metadata |
| path | The name of the file |
| qdp_volfmt | The type of file to write. |
| qdp_serpar | Serial or parallel IO |
| qdp_mode | The file opening mode |
| data_LFN | The ILDG Data LFN |
Definition at line 305 of file qdp_qdpio.cc.
References open().
| bool QDP::QDPFileWriter::bad | ( | ) | const |
Query whether an unrecoverable error has occurred.
Definition at line 501 of file qdp_qdpio.cc.
| void QDP::QDPFileWriter::clear | ( | QDP_iostate_t | state = QDPIO_goodbit | ) |
| void QDP::QDPFileWriter::close | ( | ) |
Closes the last file opened.
Definition at line 487 of file qdp_qdpio.cc.
References is_open(), and QDP::QDPIO_badbit.
Referenced by QDP::close(), and ~QDPFileWriter().
|
inlineprotected |
| bool QDP::QDPFileWriter::is_open | ( | ) |
Queries whether a file is open.
Definition at line 499 of file qdp_qdpio.cc.
Referenced by close(), and QDP::is_open().
| void QDP::QDPFileWriter::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.
Also reads the file user metadata record.
| xml | Container for the file metadata |
| path | The name of the file |
| qdp_volfmt | The type of file to write. |
| qdp_serpar | Serial or parallel IO |
Definition at line 316 of file qdp_qdpio.cc.
References open(), and QDP::QDPIO_OPEN.
Referenced by open(), open(), QDPFileWriter(), QDPFileWriter(), QDPFileWriter(), and QDPFileWriter().
| void QDP::QDPFileWriter::open | ( | XMLBufferWriter & | xml, |
| const std::string & | path, | ||
| QDP_volfmt_t | qdp_volfmt, | ||
| QDP_serialparallel_t | qdp_serpar, | ||
| const std::string & | data_LFN ) |
Opens a file for writing and writes the file metadata.
Also reads the file user metadata record.
| xml | Container for the file metadata |
| path | The name of the file |
| qdp_volfmt | The type of file to write. |
| qdp_serpar | Serial or parallel IO |
| data_LFN | ILDG DATA LFN if we need to add one |
Definition at line 324 of file qdp_qdpio.cc.
References open(), and QDP::QDPIO_OPEN.
| void QDP::QDPFileWriter::open | ( | XMLBufferWriter & | xml, |
| const std::string & | path, | ||
| QDP_volfmt_t | qdp_volfmt, | ||
| QDP_serialparallel_t | qdp_serpar, | ||
| QDP_filemode_t | qdp_mode, | ||
| const std::string & | data_LFN ) |
Opens a file for writing and writes the file metadata.
Also reads the file user metadata record.
| xml | Container for the file metadata |
| path | The name of the file |
| qdp_volfmt | The type of file to write. |
| qdp_serpar | Serial or parallel IO. |
| qdp_mode | The file opening mode |
| data_LFN | The ILDG Data LFN |
Definition at line 353 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(), QIO_Oflag::ildgLFN, QIO_Oflag::ildgstyle, QDP::io_node(), QDP::io_node_multifile(), QIO_Layout::latdim, QIO_Layout::latsize, QDP::Layout::lattSize(), QDP::master_io_node(), QIO_Filesystem::master_io_node, QIO_Oflag::mode, 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::QDP_abort(), QDP::QDPIO_APPEND, QDP::QDPIO_badbit, QDP::QDPIO_CREATE, QDP::QDPIO_goodbit, QDP::QDPIO_MULTIFILE, QDP::QDPIO_OPEN, QDP::QDPIO_PARTFILE, QDP::QDPIO_SERIAL, QDP::QDPIO_SINGLEFILE, QIO_Oflag::serpar, QIO_Layout::sites_on_node, QDP::Layout::sitesOnNode(), QDP::XMLBufferWriter::str(), QIO_Layout::this_node, QDP::Layout::vol(), and QIO_Layout::volume.
| void QDP::QDPFileWriter::write | ( | XMLBufferWriter & | rec_xml, |
| BinaryBufferWriter & | s1 ) |
Writes an XML plus Binary writer pair.
Writes a BinaryBufferWriter object.
| xml | The user record metadata. |
| sl | The data |
| rec_xml | The (user) record metadata. |
| sl | The data |
Definition at line 528 of file qdp_qdpio.cc.
References QDP::QDPIO::cerr, clear(), get(), QDP::Layout::primaryNode(), QDP::QDP_abort(), QDP::QDPIO_badbit, QDP::QDPOScalarFactoryGet(), QDP::BinaryBufferWriter::str(), and QDP::XMLBufferWriter::str().
|
inline |
Write a QDP object.
| xml | The user record metadata. |
| sl | The data |
Definition at line 633 of file qdp_qdpio.h.
References write().
Referenced by write(), QDP::write(), QDP::write(), QDP::write(), QDP::write(), QDP::write(), QDP::write(), and QDP::write().