9 const std::string foo_xml=
"<?xml version='1.0'?><foo><coeffs1>ZOLOTAREV</coeffs1><coeffs2>TANH</coeffs2></foo>";
11 int main(
int argc,
char **argv)
17 const int foo[] = {2,2,2,2};
18 multi1d<int> nrow(
Nd);
20 Layout::setLattSize(nrow);
23 XMLFileWriter xml_out(
"t_io.xml");
24 push(xml_out,
"t_io");
31 push(xml_out,
"xml_test");
36 BinaryFileWriter tobinary(
"t_io.bin");
43 TextFileWriter totext(
"t_io.txt");
44 totext << int(17) <<
"\n";
49 QDPIO::cout <<
"Read some data from t_io.txt\n";
50 TextFileReader from(
"t_io.txt");
54 QDPIO::cout <<
"you entered :" <<
x <<
":\n";
58 multi1d<LatticeColorMatrix>
u(
Nd);
59 for(
int i=0;
i <
u.size(); ++
i)
62 XMLBufferWriter file_xml, record_xml;
63 push(file_xml,
"The_file_xml");
64 write(file_xml,
"mary",
int(3));
67 push(record_xml,
"The_record_xml");
68 write(record_xml,
"lamb",
int(7));
71 push(xml_out,
"QIO_write_test");
72 write(xml_out,
"file_xml", file_xml);
73 write(xml_out,
"record_xml", record_xml);
78 QDPIO_SINGLEFILE, QDPIO_SERIAL);
82 multi1d<LatticeColorMatrix>
u(
Nd);
83 XMLReader file_xml, record_xml;
89 push(xml_out,
"QIO_read_test");
90 write(xml_out,
"file_xml", file_xml);
91 write(xml_out,
"record_xml", record_xml);
99 std::istringstream foo_xml_is(
foo_xml);
100 XMLReader fooreader(foo_xml_is);
103 read(fooreader,
"/foo/coeffs1", t1);
104 read(fooreader,
"/foo/coeffs2", t2);
107 QDPIO::cerr <<
"Caught error : " << e << std::endl;
112 write(xml_out,
"coeffs1", t1);
113 write(xml_out,
"coeffs2", t2);
116 QDPIO::cerr <<
"Caught error : " << e << std::endl;
Primary include file for CHROMA in application codes.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
void readGauge(XMLReader &file_xml, XMLReader &record_xml, multi1d< LatticeColorMatrix > &u, const std::string &file, QDP_serialparallel_t serpar)
Read a gauge config in QIO format.
void writeGauge(XMLBufferWriter &file_xml, XMLBufferWriter &record_xml, const multi1d< LatticeColorMatrix > &u, const std::string &file, QDP_volfmt_t volfmt, QDP_serialparallel_t serpar)
Write a gauge config in QIO format.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
FloatingPoint< double > Double
int main(int argc, char **argv)
const std::string foo_xml