28 QDP_volfmt_t prop_volfmt;
43 XMLReader inputtop(xml, path);
55 XMLReader paramtop(xml, path);
58 read(paramtop,
"version", version);
69 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
80 XMLReader inputtop(xml, path);
93 QDPIO::cerr <<
"Error reading qpropadd data: " << e << std::endl;
110 int main(
int argc,
char *argv[])
124 read(xml_in,
"/qpropadd", input);
130 QDPIO::cout <<
" QPROPADD: Add 2 propagators" << std::endl;
135 push(xml_out,
"qpropadd");
140 write(xml_out,
"Input", xml_in);
142 push(xml_out,
"Output_version");
143 write(xml_out,
"out_version", 1);
151 XMLReader prop_file_xml1, prop_record_xml1;
152 LatticePropagator quark_propagator1;
156 QDPIO::cout <<
"Attempt to read first forward propagator" << std::endl;
158 prop_record_xml1, quark_propagator1,
165 read(prop_record_xml1,
"/Propagator/ForwardProp", prop_header1);
166 read(prop_record_xml1,
"/Propagator/PropSource", source_header1);
170 QDPIO::cerr <<
"Error extracting forward_prop header: " << e << std::endl;
174 QDPIO::cout <<
"First forward propagator successfully read\n" << std::endl;
183 multi1d<Double> forward_prop_corr = sumMulti(localNorm2(quark_propagator1),
186 push(xml_out,
"Forward_prop_correlator1");
187 write(xml_out,
"forward_prop_corr", forward_prop_corr);
192 push(xml_out,
"Propagator1");
193 write(xml_out,
"ForwardProp", prop_header1);
194 write(xml_out,
"PropSource", source_header1);
201 XMLReader prop_file_xml2, prop_record_xml2;
202 LatticePropagator quark_propagator2;
206 QDPIO::cout <<
"Attempt to read second forward propagator" << std::endl;
208 prop_record_xml2, quark_propagator2,
215 read(prop_record_xml2,
"/Propagator/ForwardProp", prop_header2);
216 read(prop_record_xml2,
"/Propagator/PropSource", source_header2);
220 QDPIO::cerr <<
"Error extracting forward_prop header: " << e << std::endl;
224 QDPIO::cout <<
"Second forward propagator successfully read" << std::endl;
232 multi1d<Double> forward_prop_corr = sumMulti(localNorm2(quark_propagator2),
235 push(xml_out,
"Forward_prop_correlator1");
236 write(xml_out,
"forward_prop_corr", forward_prop_corr);
241 push(xml_out,
"Propagator2");
242 write(xml_out,
"ForwardProp", prop_header2);
243 write(xml_out,
"PropSource", source_header2);
251 QDPIO::cerr <<
"Prop j_decay mismatch" << std::endl;
255 for(
int i=0;
i < source_header1.
t_source.size(); ++
i)
258 QDPIO::cerr <<
"Prop t_source mismatch" << std::endl;
266 LatticePropagator quark_propagator = 0.5*(quark_propagator1 + quark_propagator2);
273 QDPIO::cout <<
"Save the new forward propagator" << std::endl;
275 XMLBufferWriter file_xml;
276 push(file_xml,
"propagator");
278 write(file_xml,
"id",
id);
281 XMLBufferWriter record_xml;
282 push(record_xml,
"Propagator");
284 write(record_xml,
"PropSource", source_header);
287 QDPIO::cout <<
"Create config info" << std::endl;
288 XMLReader gauge_xml(prop_record_xml1,
"/Propagator/Config_info");
289 std::ostringstream gauge_str;
290 gauge_xml.print(gauge_str);
291 write(record_xml,
"Config_info", gauge_str);
292 QDPIO::cout <<
"Done config info" << std::endl;
299 writeQprop(file_xml, record_xml, quark_propagator,
303 QDPIO::cout <<
"New forward propagator successfully written" << std::endl;
Primary include file for CHROMA in application codes.
Fourier transform phase factor support.
const Set & getSet() const
The set to be used in sumMulti.
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 proginfo(XMLWriter &xml)
Print out basic information about this program.
ForwardProp_t prop_header
Asqtad Staggered-Dirac operator.
push(xml_out,"Condensates")
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void readQprop(XMLReader &file_xml, XMLReader &record_xml, LatticePropagator &quark_prop, const std::string &file, QDP_serialparallel_t serpar)
Read a Chroma propagator.
void writeQprop(XMLBufferWriter &file_xml, XMLBufferWriter &record_xml, const LatticePropagator &quark_prop, const std::string &file, QDP_volfmt_t volfmt, QDP_serialparallel_t serpar)
Write a Chroma propagator.
std::string getXMLInputFileName()
Get input file name.
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
int main(int argc, char *argv[])
Propagator source construction parameters.
Parameters for running program.