Next: , Previous: Reading and writing QDP fields, Up: I/O utilities


4.7.3 Reading and writing QLA arrays

QLA data is global data that carries no lattice site index. Typically these values result from a global reduction. For example, a correlation function might be computed on every time slice of the lattice and summed globally over the entire machine. From the standpoint of data parallel I/O operation the data is treated as a global quantity with the same name and value on every processor. When it is written to a file, it is assumed that the values are the same on each node, so only one node needs to write its value. When it is read from a file, the I/O system does a broadcast to every node, so the result of reading is a global value.

An interface is provided for reading and writing arrays of QLA data. Single QLA values can be passed as an array of length one. The naming conventions for the routines follow conventions of the QDP API. Notice that the encoded QLA data type is lower case and the argument is a pointer to a QLA type.

Reading a QLA array

Syntax int QDP_vread_t(QDP_Reader *in, QDP_String *record_xml, QLA_Type *array, int n);


Meaning Reads the QLA array and its metadata from the next record in the specified file.


Type S, I, R, C, V, H, D, M, P


Example QLA_Complex array[nt];
QDP_vread_c(reader, record_xml, array, nt);

The integer return value is 0 for success and 1 for failure. It is assumed the user has created the record metadata and the field data in advance.

Writing an array of QLA values

Syntax int QDP_write_vt(QDP_Writer *out, QDP_String *record_xml, QLA_Type *array, int n);


Meaning Writes the QLA array and its metadata as the next record in the specified file.


Type S, I, R, C, V, H, D, M, P


Example QLA_Complex array[nt];
QDP_c_eq_V_dot_V_multi(array, prop, src, timeslices, nt);
QDP_write_vc(writer, record_xml, array, nt);

The integer return value is 0 for success and 1 for failure. It is assumed the user has prepared the record metadata and the field data in advance.