25 XMLReader inputtop(xml, path);
45 namespace InlineStaggeredPropagatorEnv
82 XMLReader paramtop(xml_in, path);
84 if (paramtop.count(
"Frequency") == 1)
96 if (paramtop.count(
"xml_file") != 0)
103 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
131 push(xml_out,
"propagator_stag");
132 write(xml_out,
"update_no", update_no);
133 write(xml_out,
"xml_file", xml_file);
136 XMLFileWriter xml(xml_file);
137 func(update_no, xml);
141 func(update_no, xml_out);
158 XMLBufferWriter gauge_xml;
164 catch( std::bad_cast )
166 QDPIO::cerr <<
name <<
": caught dynamic cast error"
172 QDPIO::cerr <<
name <<
": std::map call failed: " << e
176 const multi1d<LatticeColorMatrix>&
u =
179 push(xml_out,
"propagator_stag");
180 write(xml_out,
"update_no", update_no);
182 QDPIO::cout <<
name <<
": propagator calculation" << std::endl;
190 write(xml_out,
"Config_info", gauge_xml);
192 push(xml_out,
"Output_version");
193 write(xml_out,
"out_version", 1);
197 MesPlq(xml_out,
"Observables",
u);
202 XMLReader source_file_xml, source_record_xml;
206 bool make_sourceP =
false;
207 bool seqsourceP =
false;
208 QDPIO::cout <<
"Snarf the source from a named buffer" << std::endl;
212 LatticeStaggeredPropagator& source_tmp =
221 if (source_record_xml.count(
"/MakeSource") != 0)
225 read(source_record_xml,
"/MakeSource/PropSource", source_header);
230 else if (source_record_xml.count(
"/SequentialSource") != 0)
236 read(source_record_xml,
"/SequentialSource/SeqSource", seqsource_header);
238 read(source_record_xml,
"/SequentialSource/ForwardProps/elem[1]/ForwardProp",
240 read(source_record_xml,
"/SequentialSource/ForwardProps/elem[1]/PropSource",
252 write(xml_out,
"Source_file_info", source_file_xml);
253 write(xml_out,
"Source_record_info", source_record_xml);
255 catch (std::bad_cast)
257 QDPIO::cerr <<
name <<
": caught dynamic cast error"
263 QDPIO::cerr <<
name <<
": error extracting source_header: " << e << std::endl;
268 const LatticeStaggeredPropagator& quark_prop_source =
271 QDPIO::cout <<
"Source successfully read and parsed" << std::endl;
279 multi1d<Double> source_corr = sumMulti(localNorm2(quark_prop_source),
282 push(xml_out,
"Source_correlator");
283 write(xml_out,
"source_corr", source_corr);
297 catch (std::bad_cast)
299 QDPIO::cerr <<
name <<
": caught dynamic cast error"
305 QDPIO::cerr <<
name <<
": error creating prop: " << e << std::endl;
310 LatticeStaggeredPropagator& quark_propagator =
318 XMLReader fermacttop(xml_s);
325 bool success =
false;
333 QDPIO::cout <<
"Try the various factories" << std::endl;
336 typedef LatticeStaggeredFermion
T;
337 typedef multi1d<LatticeColorMatrix>
P;
338 typedef multi1d<LatticeColorMatrix>
Q;
349 QDPIO::cout <<
"Suitable factory found: compute the quark prop" << std::endl;
351 S_f->quarkProp(quark_propagator,
359 QDPIO::cout <<
"Propagator computed: time= "
360 << swatch.getTimeInSeconds()
361 <<
" secs" << std::endl;
367 QDPIO::cout <<
name <<
": caught exception around quarkprop: " << e << std::endl;
374 QDPIO::cerr <<
"Error: no fermact found" << std::endl;
379 push(xml_out,
"Relaxation_Iterations");
380 write(xml_out,
"ncg_had", ncg_had);
388 multi1d<Double> prop_corr = sumMulti(localNorm2(quark_propagator),
391 push(xml_out,
"Prop_correlator");
392 write(xml_out,
"prop_corr", prop_corr);
400 QDPIO::cout <<
"Start writing propagator info" << std::endl;
402 XMLBufferWriter file_xml;
403 push(file_xml,
"propagator");
407 XMLBufferWriter record_xml;
410 XMLReader xml_tmp(source_record_xml,
"/MakeSource");
412 push(record_xml,
"Propagator");
414 record_xml << xml_tmp;
419 XMLReader xml_tmp(source_record_xml,
"/SequentialSource");
421 push(record_xml,
"SequentialProp");
423 record_xml << xml_tmp;
431 QDPIO::cout <<
"Propagator successfully updated" << std::endl;
433 catch (std::bad_cast)
435 QDPIO::cerr <<
name <<
": caught dynamic cast error"
441 QDPIO::cerr <<
name <<
": error extracting prop_header: " << e << std::endl;
448 QDPIO::cout <<
name <<
": total time = "
449 << snoop.getTimeInSeconds()
450 <<
" secs" << std::endl;
452 QDPIO::cout <<
name <<
": ran successfully" << std::endl;
Inline measurement factory.
Class for counted reference semantics.
Inline computation of propagators.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Fourier transform phase factor support.
const Set & getSet() const
The set to be used in sumMulti.
Class structure for fermion actions.
Fermion action factories.
All Staggered-type fermion actions.
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.
std::string uniqueId()
Return a unique id.
void proginfo(XMLWriter &xml)
Print out basic information about this program.
std::string makeXMLFileName(std::string xml_file, unsigned long update_no)
Return a xml file name for inline measurements.
ForwardProp_t prop_header
Inline construction of propagator.
Named object function std::map.
static bool registered
Local registration flag.
multi1d< LatticeColorMatrix > P
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
Print out basic info about this program.
Fourier transform phase factor support.
QuarkSpinType quarkSpinType
void writeXML(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineStaggeredPropagatorEnv::Params::NamedObject_t named_obj
Propagator source construction parameters.
Sequential source parameters.