24 namespace InlineNprVertexEnv
55 const multi1d<int> mom,
56 const multi1d<int> t_src){
59 SftMom phases(0, t_src, mom);
60 multi1d<int> mm = phases.
numToMom(0);
61 QDPIO::cout<<
"Sink momentum: " ;
62 QDPIO::cout<<mm[0]<<mm[1]<<mm[2]<<mm[3]<<std::endl;
69 XMLReader paramtop(xml, path);
72 read(paramtop,
"version", version);
74 if (paramtop.count(
"FermState") != 0)
86 << version <<
" unsupported." << std::endl;
101 write(xml,
"version", version);
112 XMLReader inputtop(xml, path);
137 XMLReader paramtop(xml_in, path);
139 if (paramtop.count(
"Frequency") == 1)
151 if (paramtop.count(
"xml_file") != 0)
158 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
182 bool & DoFurtherPatterns,
183 multi1d< int > & LinkPattern )
185 DoThisPattern =
true;
186 DoFurtherPatterns =
true;
202 push(xml_out,
"NprVertex");
203 write(xml_out,
"update_no", update_no);
204 write(xml_out,
"xml_file", xml_file);
207 XMLFileWriter xml(xml_file);
208 func(update_no, xml);
212 func(update_no, xml_out);
228 push(XmlOut,
"NprVertex");
229 write(XmlOut,
"update_no", update_no);
231 QDPIO::cout <<
" ExampleNprVertex" << std::endl;
232 QDPIO::cout <<
" volume: " << QDP::Layout::lattSize()[0];
233 for (
int i=1;
i<
Nd; ++
i) {
234 QDPIO::cout <<
" x " << QDP::Layout::lattSize()[
i];
236 QDPIO::cout << std::endl;
244 push(XmlOut,
"Output_version");
245 write(XmlOut,
"out_version", 2);
252 QDPIO::cout <<
"Attempt to initialize the gauge field" << std::endl << std::flush ;
255 multi1d<LatticeColorMatrix>
U;
256 XMLBufferWriter gauge_xml;
267 XMLReader fermtop(xml_s);
283 catch( std::bad_cast )
306 write(XmlOut,
"Config_info", gauge_xml);
309 MesPlq(XmlOut,
"Observables",
U);
315 SftMom phases_nomom( 0,
true,
Nd-1 );
320 QDPIO::cout <<
"Attempt to parse forward propagator" << std::endl;
321 QDPIO::cout <<
"parsing forward propagator " <<
params.
named_obj.
prop_id <<
" ... " << std::endl << std::flush;
329 XMLReader PropXML, PropRecordXML;
336 read(PropRecordXML,
"/Propagator/PropSource", source_header);
342 multi1d<Double> PropCheck =
343 sumMulti( localNorm2(
F ), phases_nomom.
getSet() );
345 QDPIO::cout <<
"forward propagator check = " << PropCheck[0] << std::endl;
348 push(XmlOut,
"ForwardProp");
349 write(XmlOut,
"PropXML", PropXML);
350 write(XmlOut,
"PropRecordXML", PropRecordXML);
351 write(XmlOut,
"PropCheck", PropCheck);
355 catch( std::bad_cast )
368 QDPIO::cout <<
"Forward propagator successfully parsed" << std::endl;
375 int t_dir = source_header.
j_decay ;
378 mom = source_header.
getMom() ;
382 QDPIO::cerr <<
InlineNprVertexEnv::name <<
": propagator does not have a momentum source or t_src not present: error message: " << e << std::endl;
390 QDP::StopWatch swatch;
393 XMLBufferWriter file_xml;
394 push(file_xml,
"NprVertex");
397 write(file_xml,
"PropSource", source_header);
398 write(file_xml,
"Config", gauge_xml);
402 QDPIO_SERIAL, QDPIO_OPEN);
406 QDPIO::cout <<
"Fourier Transforming propagator" << std::endl;
408 multi1d<int> neg_mom(mom.size());
410 for(
int i(0);
i<mom.size();
i++)
411 neg_mom[
i] = -mom[
i] ;
414 XMLBufferWriter prop_xml;
415 push(prop_xml,
"QuarkPropagator");
416 write(prop_xml,
"mom",mom);
417 write(prop_xml,
"origin",t_src);
418 write(prop_xml,
"t_dir",t_dir);
420 write(qio_file, prop_xml, FTprop);
422 QDPIO::cout <<
"finished Fourier Transforming propagator"
424 << swatch.getTimeInSeconds()
425 <<
" secs" << std::endl;
427 QDPIO::cout <<
"Calculating building blocks" << std::endl;
435 QDPIO::cout <<
"finished calculating NprVertex"
437 << swatch.getTimeInSeconds()
438 <<
" secs" << std::endl;
444 << snoop.getTimeInSeconds()
445 <<
" secs" << std::endl;
Inline measurement factory.
Class for counted reference semantics.
Inline measurement of NPR vertices.
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.
InlineNprVertexParams params
Fourier transform phase factor support.
multi1d< int > numToMom(int mom_num) const
Convert momenta id to actual array of momenta.
const Set & getSet() const
The set to be used in sumMulti.
All ferm create-state method.
Fermion create state factory.
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 NprVertex(const LatticePropagator &F, const multi1d< LatticeColorMatrix > &U, const unsigned short int MaxNLinks, const BBLinkPattern LinkPattern, QDPFileWriter &qio_file)
NPR vertices.
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.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
std::map< std::string, SinkPropContainer_t > prop
ForwardProp_t prop_header
Inline construction of NPR vertices.
Named object function std::map.
static bool registered
Local registration flag.
GroupXML_t nullXMLGroup()
Returns a periodic createstate group.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
push(xml_out,"Condensates")
void AllLinkPatterns(bool &DoThisPattern, bool &DoFurtherPatterns, multi1d< unsigned short int > &LinkPattern)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
void write(XMLWriter &xml, const std::string &path, const InlineNprVertexParams::NamedObject_t &input)
Propagator output.
DPropagator FTpropagator(const LatticePropagator &prop, const multi1d< int > mom, const multi1d< int > t_src)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
FloatingPoint< double > Double
Print out basic info about this program.
Fourier transform phase factor support.
void write(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineNprVertexParams::Param_t param
struct Chroma::InlineNprVertexParams::NamedObject_t named_obj
Propagator source construction parameters.
multi1d< int > getMom() const
multi1d< int > getTSrce() const
multi1d< LatticeColorMatrix > U
static INTERNAL_PRECISION F