CHROMA
inline_noisy_building_blocks_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Inline construction of noisy BuildingBlocks
3  *
4  * Noisy Building Blocks on forward props and noisy sources
5  */
6 
9 #include "meas/glue/mesplq.h"
10 #include "util/ft/sftmom.h"
12 #include "util/info/proginfo.h"
14 
16 
19 
20 namespace Chroma
21 {
22  namespace InlineNoisyBuildingBlocksEnv
23  {
24  namespace
25  {
26  AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
27  const std::string& path)
28  {
30  }
31 
32  //! Local registration flag
33  bool registered = false;
34  }
35 
36  const std::string name = "NOISY_BUILDING_BLOCKS";
37 
38  //! Register all the factories
39  bool registerAll()
40  {
41  bool success = true;
42  if (! registered)
43  {
44  success &= TheInlineMeasurementFactory::Instance().registerObject(name, createMeasurement);
45  registered = true;
46  }
47  return success;
48  }
49  }
50 
51 
52  //! Param input
53  void read(XMLReader& xml, const std::string& path, InlineNoisyBuildingBlocksParams::Param_t& input)
54  {
55  XMLReader paramtop(xml, path);
56 
57  int version;
58  read(paramtop, "version", version);
59  input.use_sink_offset = false;
60  input.canonical = false;
61  input.time_reverse = false;
62 
64 
65  switch (version)
66  {
67  case 1:
68  break;
69 
70  case 2:
71 // read(paramtop, "use_sink_offset", input.use_sink_offset);
72  break;
73 
74  case 3:
75 // read(paramtop, "use_sink_offset", input.use_sink_offset);
76  read(paramtop, "canonical", input.canonical);
77  break;
78 
79  case 4:
80  read(paramtop, "use_sink_offset", input.use_sink_offset);
81  read(paramtop, "canonical", input.canonical);
82 
83  if (paramtop.count("FermState") != 0)
84  input.cfs = readXMLGroup(paramtop, "FermState", "Name");
85  break;
86 
87  case 5:
88  read(paramtop, "use_sink_offset", input.use_sink_offset);
89  read(paramtop, "canonical", input.canonical);
90  read(paramtop, "time_reverse", input.time_reverse);
91 
92  if (paramtop.count("FermState") != 0)
93  input.cfs = readXMLGroup(paramtop, "FermState", "Name");
94  break;
95 
96  default :
97  QDPIO::cerr << InlineNoisyBuildingBlocksEnv::name << ": input parameter version "
98  << version << " unsupported." << std::endl;
99  QDP_abort(1);
100  }
101 
102  read(paramtop, "links_max", input.links_max);
103  read(paramtop, "mom2_max", input.mom2_max);
104  }
105 
106 
107  //! Param write
108  void write(XMLWriter& xml, const std::string& path, const InlineNoisyBuildingBlocksParams::Param_t& input)
109  {
110  push(xml, path);
111 
112  int version = 5;
113  write(xml, "version", version);
114  write(xml, "links_max", input.links_max);
115  write(xml, "mom2_max", input.mom2_max);
116  write(xml, "canonical", input.canonical);
117  write(xml, "time_reverse", input.time_reverse);
118  xml << input.cfs.xml;
119 
120  pop(xml);
121  }
122 
123  //! Propagator input
124 //void read(XMLReader& xml, const std::string& path, InlineNoisyBuildingBlocksParams::NamedObject_t& input)
125 //{
126 // XMLReader inputtop(xml, path);
127 //
128 // read(inputtop, "BkwdPropId", input.BkwdPropId);
129 // read(inputtop, "BkwdPropG5Format", input.BkwdPropG5Format);
130 // read(inputtop, "GammaInsertion", input.GammaInsertion);
131 // read(inputtop, "Flavor", input.Flavor);
132 // read(inputtop, "BBFileNamePattern", input.BBFileNamePattern);
133 //}
134 
135  //! Propagator output
136 //void write(XMLWriter& xml, const std::string& path, const InlineNoisyBuildingBlocksParams::NamedObject_t& input)
137 //{
138 // push(xml, path);
139 //
140 // write(xml, "BkwdPropId", input.BkwdPropId);
141 // write(xml, "BkwdPropG5Format", input.BkwdPropG5Format);
142 // write(xml, "GammaInsertion", input.GammaInsertion);
143 // write(xml, "Flavor", input.Flavor);
144 // write(xml, "BBFileNamePattern", input.BBFileNamePattern);
145 //
146 // pop(xml);
147 //}
148 
149  //! BB parameters
150  void read(XMLReader& xml, const std::string& path, InlineNoisyBuildingBlocksParams::BB_out_t& input)
151  {
152  XMLReader inputtop(xml, path);
153 
154  read(inputtop, "OutFileName", input.OutFileName);
155  read(inputtop, "GaugeId", input.GaugeId);
156  read(inputtop, "FrwdPropId", input.FrwdPropId);
157 // read(inputtop, "BkwdProps", input.BkwdProps);
158  read(inputtop, "NoisySrcId", input.NoisySrcId);
159  read(inputtop, "GammaInsertion", input.GammaInsertion);
160  read(inputtop, "Flavor", input.Flavor);
161  read(inputtop, "BBFileNamePattern", input.BBFileNamePattern);
162  }
163 
164  //! BB parameters
165  void write(XMLWriter& xml, const std::string& path, const InlineNoisyBuildingBlocksParams::BB_out_t& input)
166  {
167  push(xml, path);
168 
169  write(xml, "OutFileName", input.OutFileName);
170  write(xml, "GaugeId", input.GaugeId);
171  write(xml, "FrwdPropId", input.FrwdPropId);
172 // write(xml, "BkwdProps", input.BkwdProps);
173  write(xml, "NoisySrcId", input.NoisySrcId);
174  write(xml, "GammaInsertion", input.GammaInsertion);
175  write(xml, "Flavor", input.Flavor);
176  write(xml, "BBFileNamePattern", input.BBFileNamePattern);
177 
178  pop(xml);
179  }
180 
181 
182  // Param stuff
184 
186  {
187  try
188  {
189  XMLReader paramtop(xml_in, path);
190 
191  if (paramtop.count("Frequency") == 1)
192  read(paramtop, "Frequency", frequency);
193  else
194  frequency = 1;
195 
196  // Read program parameters
197  read(paramtop, "Param", param);
198 
199  // Read in the building block setup
200  read(paramtop, "BuildingBlocks", bb);
201 
202  // Possible alternate XML file pattern
203  if (paramtop.count("xml_file") != 0)
204  {
205  read(paramtop, "xml_file", xml_file);
206  }
207  }
208  catch(const std::string& e)
209  {
210  QDPIO::cerr << __func__ << ": Caught Exception reading XML: " << e << std::endl;
211  QDP_abort(1);
212  }
213  }
214 
215 
216  void
217  InlineNoisyBuildingBlocksParams::write(XMLWriter& xml_out, const std::string& path)
218  {
219  push(xml_out, path);
220 
221  Chroma::write(xml_out, "Param", param);
222  Chroma::write(xml_out, "BuildingBlocks", bb);
223  QDP::write(xml_out, "xml_file", xml_file);
224 
225  pop(xml_out);
226  }
227 
228 
229  //########################################################################//
230  // Accept All Link Patterns //
231  //########################################################################//
232 
233  void AllNoisyLinkPatterns( bool & DoThisPattern, bool & DoFurtherPatterns,
234  multi1d< unsigned short int > & LinkPattern )
235  {
236  DoThisPattern = true;
237  DoFurtherPatterns = true;
238 
239  return;
240  }
241 
242 
243  // Function call
244  void
245  InlineNoisyBuildingBlocks::operator()(unsigned long update_no,
246  XMLWriter& xml_out)
247  {
248  // If xml file not empty, then use alternate
249  if (params.xml_file != "")
250  {
251  std::string xml_file = makeXMLFileName(params.xml_file, update_no);
252 
253  push(xml_out, "ExampleBuildingBlocks");
254  write(xml_out, "update_no", update_no);
255  write(xml_out, "xml_file", xml_file);
256  pop(xml_out);
257 
258  XMLFileWriter xml(xml_file);
259  func(update_no, xml);
260  }
261  else
262  {
263  func(update_no, xml_out);
264  }
265  }
266 
267 
268  // Function call
269  void
270  InlineNoisyBuildingBlocks::func(unsigned long update_no,
271  XMLWriter& XmlOut)
272  {
273  START_CODE();
274 
275  StopWatch snoop;
276  snoop.reset();
277  snoop.start();
278 
279  push(XmlOut, "ExampleBuildingBlocks");
280  write(XmlOut, "update_no", update_no);
281 
282  QDPIO::cout << " ExampleBuildingBlocks" << std::endl;
283  QDPIO::cout << " volume: " << QDP::Layout::lattSize()[0];
284  for (int i=1; i<Nd; ++i) {
285  QDPIO::cout << " x " << QDP::Layout::lattSize()[i];
286  }
287  QDPIO::cout << std::endl;
288 
289  //#################################################################################//
290  // Echo Arguments //
291  //#################################################################################//
292 
293  // will capture all would-be standard output
294  TextFileWriter Out( params.bb.OutFileName );
295 
296  Out << "\n";
297  Out << " NX = " << QDP::Layout::lattSize()[0] << "\n";
298  Out << " NY = " << QDP::Layout::lattSize()[1] << "\n";
299  Out << " NZ = " << QDP::Layout::lattSize()[2] << "\n";
300  Out << " NT = " << QDP::Layout::lattSize()[3] << "\n";
301  Out << " Forward Propagator = " << params.bb.FrwdPropId << "\n";
302  Out << "\n";
303 // for(int loop=0; loop < params.bb.BkwdProps.size(); ++loop)
304 // {
305 // const InlineNoisyBuildingBlocksParams::NamedObject_t& prop = params.bb.BkwdProps[loop];
306 // Out << " Backward Propagator = " << prop.BkwdPropId << "\n";
307 // Out << " Backward Propagator Gamma5 Format = " << prop.BkwdPropG5Format << "\n";
308 // Out << " Gamma Insertion = " << prop.GammaInsertion << "\n";
309 // Out << " Flavor = " << prop.Flavor << "\n";
310 // Out << " Building Blocks = " << prop.BBFileNamePattern << "\n";
311 // Out << "\n";
312 // }
313  Out << " Noisy Source = " << params.bb.NoisySrcId
314  << "\n";
315  Out << " Gamma Insertion = "
316  << params.bb.GammaInsertion << "\n";
317  Out << " Flavor = " << params.bb.Flavor
318  << "\n";
319  Out << " Building Blocks = "
320  << params.bb.BBFileNamePattern << "\n";
321 
322  Out << " Maximum Number of Links = " << params.param.links_max << "\n";
323  Out << " Maximum Spatial Momentum Squared = " << params.param.mom2_max << "\n";
324  Out << " Filename Canonicalization = " << params.param.canonical << "\n";
325  Out << " Time reverse building blocks = " << params.param.time_reverse << "\n";
326 
327  Out << " Text Output File Name = " << params.bb.OutFileName << "\n";
328  Out << "\n";
329  Out.flush();
330 
331  //#################################################################################//
332  // Record the CVS Info for BuildingBlocks //
333  //#################################################################################//
334 
335  CVSBuildingBlocks( Out );
336  Out << "CVSBuildingBlocks_hh = " << CVSBuildingBlocks_hh << "\n";
337  Out << "\n";
338 
339  //#################################################################################//
340  // XML output
341  //#################################################################################//
342 
343  proginfo(XmlOut); // Print out basic program info
344 
345  push(XmlOut, "Output_version");
346  write(XmlOut, "out_version", 2);
347  pop(XmlOut);
348 
349  //###############################################################################//
350  // Read Gauge Field //
351  //###############################################################################//
352 
353  Out << "Attempt to initialize the gauge field" << "\n"; Out.flush();
354 
355  // Grab the gauge field
356  multi1d<LatticeColorMatrix> U;
357  XMLBufferWriter gauge_xml;
358 
359  try
360  {
361  U = TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.bb.GaugeId);
362  TheNamedObjMap::Instance().get(params.bb.GaugeId).getRecordXML(gauge_xml);
363 
364  // Set the construct state and modify the fields
365  {
366  std::istringstream xml_s(params.param.cfs.xml);
367  XMLReader fermtop(xml_s);
368 
371  fermtop,
372  params.param.cfs.path));
373 
374  Handle<FermState< LatticeFermion, multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > >
375  state((*cfs)(U));
376 
377  // Pull the u fields back out from the state since they might have been
378  // munged with fermBC's
379  U = state->getLinks();
380  }
381 
382  }
383  catch( std::bad_cast )
384  {
385  QDPIO::cerr << InlineNoisyBuildingBlocksEnv::name << ": caught dynamic cast error"
386  << std::endl;
387  QDP_abort(1);
388  }
389  catch (const std::string& e)
390  {
391  QDPIO::cerr << InlineNoisyBuildingBlocksEnv::name << ": std::map call failed: " << e
392  << std::endl;
393  QDP_abort(1);
394  }
395 
396  // Write out the input
397  params.write(XmlOut, "Input");
398 
399  // Write out the config info
400  write(XmlOut, "Config_info", gauge_xml);
401 
402  // check that the gauge field seems normal
403  Double ave_plaq, ave_spacelike_plaq, ave_timelike_plaq, ave_link_trace;
404  MesPlq( U, ave_plaq, ave_spacelike_plaq, ave_timelike_plaq, ave_link_trace );
405  Out << "basic gauge field observables" << "\n";
406  Out << "average plaquette = " << ave_plaq << "\n";
407  Out << "average space-like plaquette = " << ave_spacelike_plaq << "\n";
408  Out << "average time-like plaquette = " << ave_timelike_plaq << "\n";
409  Out << "average link trace = " << ave_link_trace << "\n";
410 
411  push(XmlOut, "Observables");
412  write(XmlOut, "ave_plaq", ave_plaq);
413  write(XmlOut, "ave_spacelike_plaq", ave_spacelike_plaq);
414  write(XmlOut, "ave_timelike_plaq", ave_timelike_plaq);
415  write(XmlOut, "ave_link_trace", ave_link_trace);
416  pop(XmlOut);
417 
418  StopWatch swatch;
419 
420  //######################################################################//
421  // Read Forward Propagator //
422  //######################################################################//
423 
424  // used to check props. Fix to Nd-1 direction.
425  SftMom phases_nomom( 0, true, Nd-1 );
426 
427  LatticePropagator F;
429  PropSourceConst_t source_header_check;
430  QDPIO::cout << "Attempt to parse forward propagator" << std::endl;
431  Out << "parsing forward propagator " << params.bb.FrwdPropId
432  << " ... " << "\n";
433  Out.flush();
434 
435  try
436  {
437  // Snarf a copy
438  F = TheNamedObjMap::Instance().getData<LatticePropagator>(params.bb.FrwdPropId);
439 
440  // Snarf the frwd prop info. This is will throw if the frwd prop id is not there
441  XMLReader FrwdPropXML, FrwdPropRecordXML;
442  TheNamedObjMap::Instance().get(params.bb.FrwdPropId).getFileXML(FrwdPropXML);
443  TheNamedObjMap::Instance().get(params.bb.FrwdPropId).getRecordXML(FrwdPropRecordXML);
444 
445  // Try to invert this record XML into a ChromaProp struct
446  {
447  read(FrwdPropRecordXML, "/Propagator/ForwardProp", prop_header);
448  read(FrwdPropRecordXML, "/Propagator/PropSource", source_header_check);
449  }
450 
451  // Sanity check - write out the norm2 of the forward prop in the j_decay direction
452  // Use this for any possible verification
453  {
454  multi1d<Double> FrwdPropCheck =
455  sumMulti( localNorm2( F ), phases_nomom.getSet() );
456 
457  Out << "forward propagator check = " << FrwdPropCheck[0] << "\n"; Out.flush();
458 
459  // Write out the forward propagator header
460  push(XmlOut, "ForwardProp");
461  write(XmlOut, "FrwdPropId", params.bb.FrwdPropId);
462  write(XmlOut, "FrwdPropXML", FrwdPropXML);
463  write(XmlOut, "FrwdPropRecordXML", FrwdPropRecordXML);
464  write(XmlOut, "FrwdPropCheck", FrwdPropCheck);
465  pop(XmlOut);
466  }
467  }
468  catch( std::bad_cast )
469  {
470  QDPIO::cerr << InlineNoisyBuildingBlocksEnv::name << ": caught dynamic cast error"
471  << std::endl;
472  QDP_abort(1);
473  }
474  catch (const std::string& e)
475  {
476  QDPIO::cerr << InlineNoisyBuildingBlocksEnv::name << ": forward prop: error message: " << e
477  << std::endl;
478  QDP_abort(1);
479  }
480 
481  QDPIO::cout << "Forward propagator successfully parsed" << std::endl;
482  Out << "finished parsing forward propagator " << params.bb.FrwdPropId << "\n"; Out.flush();
483 
484  //######################################################################//
485  // Read Noisy Source //
486  //######################################################################//
487 
488  multi1d<LatticePropagator> S( 1 );
489  PropSourceConst_t source_header;
490  QDPIO::cout << "Attempt to parse noisy source" << std::endl;
491  Out << "parsing noisy source " << params.bb.NoisySrcId << " ... " << "\n";
492  Out.flush();
493 
494  try
495  {
496  // Try the cast to see if this is a valid source
497  S[0] = TheNamedObjMap::Instance().getData<LatticePropagator>(params.bb.NoisySrcId);
498 
499  // Snarf the noisy src info. This is will throw if the noisy src id
500  // is not there
501  XMLReader NoisySrcXML, NoisySrcRecordXML;
502  TheNamedObjMap::Instance().get(params.bb.NoisySrcId).getFileXML(NoisySrcXML);
503  TheNamedObjMap::Instance().get(params.bb.NoisySrcId).getRecordXML(NoisySrcRecordXML);
504 
505  // Try to invert this record XML into a source struct
506  // First identify what kind of source might be here
507  if (NoisySrcRecordXML.count("/MakeSource") != 0) {
508  read(NoisySrcRecordXML, "/MakeSource/PropSource", source_header);
509  } else {
510  throw std::string("No appropriate header found");
511  }
512 
513  // Sanity check - write out the norm2 of the source in the Nd-1 direction
514  // Use this for any possible verification
515  {
516  multi1d<Double> NoisySrcCheck =
517  sumMulti( localNorm2( S[0] ), phases_nomom.getSet() );
518 
519  Out << "noisy source check = " << NoisySrcCheck[0] << "\n";
520  Out.flush();
521 
522  // Write out the forward propagator header
523  push(XmlOut, "NoisySource");
524  write(XmlOut, "NoisySrcId", params.bb.NoisySrcId);
525  write(XmlOut, "NoisySrcXML", NoisySrcXML);
526  write(XmlOut, "NoisySrcRecordXML", NoisySrcRecordXML);
527  write(XmlOut, "NoisySrcCheck", NoisySrcCheck);
528  pop(XmlOut);
529  }
530  }
531  catch( std::bad_cast )
532  {
534  << ": caught dynamic cast error" << std::endl;
535  QDP_abort(1);
536  }
537  catch (const std::string& e)
538  {
540  << ": noisy source: error message: " << e << std::endl;
541  QDP_abort(1);
542  }
543 
544  QDPIO::cout << "Noisy source successfully parsed" << std::endl;
545  Out << "finished parsing noisy source " << params.bb.NoisySrcId << "\n";
546  Out.flush();
547 
548  // Derived from input prop
549  int j_decay = source_header.j_decay;
550 
551  //######################################################################//
552  // Additional Gamma Matrix Insertions //
553  //######################################################################//
554 
555  multi1d<int> GammaInsertions(1);
556  GammaInsertions[0] = params.bb.GammaInsertion;
557 
558  if (GammaInsertions[0] < 0 || GammaInsertions[0] >= Ns*Ns) {
559  QDPIO::cerr
560  << "InlineNoisyBuildingBlocks: Gamma insertion out of bounds: "
561  << GammaInsertions[0] << std::endl;
562  QDP_abort(1);
563  }
564 
565  //######################################################################//
566  // Convert Noisy Source Format //
567  //######################################################################//
568 
569  LatticePropagator Su = S[0] ;
570 
571  if ( params.bb.NoisySrcG5Format == "G5_B" ) {
572  S[0] = Gamma( 15 ) * Su;
573  } else if ( params.bb.NoisySrcG5Format == "B_G5" ) {
574  S[0] = Su * Gamma( 15 );
575  } else if ( params.bb.NoisySrcG5Format == "G5_B_G5" ) {
576  S[0] = Gamma( 15 ) * Su * Gamma( 15 );
577  }
578 
579  //######################################################################//
580  // Set Momenta //
581  //######################################################################//
582 
583  multi1d< int > SnkMom( Nd - 1 );
584 // if (params.param.use_sink_offset)
585 // SnkMom = seqsource_header.sink_mom;
586 // else
587  SnkMom = 0;
588 
589  multi1d<int> t_srce(Nd);
590  t_srce = 0;
591 
592  SftMom Phases( params.param.mom2_max, t_srce, SnkMom, false, j_decay );
593  SftMom PhasesCanonical( params.param.mom2_max, t_srce, SnkMom,
595 
596  //######################################################################//
597  // Construct File Names //
598  //######################################################################//
599 
600  int NumO = PhasesCanonical.numMom();
601 
602  multi2d< std::string > Files( 1, NumO );
603 
604  const int BBFileNameLength
605  = params.bb.BBFileNamePattern.length() + 3 * 3 + 1;
606 
607  for ( int o = 0; o < NumO; o ++ ) {
608 
609  multi1d< int > Q = PhasesCanonical.numToMom( o );
610 
611  char XSign = '+';
612  char YSign = '+';
613  char ZSign = '+';
614 
615  if ( Q[0] < 0 ) {
616  XSign = '-';
617  }
618  if( Q[1] < 0 ) {
619  YSign = '-';
620  }
621  if( Q[2] < 0 ) {
622  ZSign = '-';
623  }
624 
625  char* bbf = new char[BBFileNameLength + 1];
626  sprintf( bbf, params.bb.BBFileNamePattern.c_str(),
627  ZSign, abs(Q[2]), YSign, abs(Q[1]), XSign, abs(Q[0]) );
628 
629  Files(0,o) = bbf;
630 
631  delete[] bbf;
632  }
633 
634  //######################################################################//
635  // Flavor-ology //
636  //######################################################################//
637 
638  multi1d< int > Flavors( 1 );
639 
640  //
641  // Dru puts a Flavor into the BB
642  // Telephone book std::map of flavor name to a number
643  //
644  if (params.bb.Flavor == "U") {
645  Flavors[0] = 0;
646  } else if (params.bb.Flavor == "D") {
647  Flavors[0] = 1;
648  } else if (params.bb.Flavor == "S") {
649  Flavors[0] = 2;
650  } else if (params.bb.Flavor == "C") {
651  Flavors[0] = 3;
652  } else if (params.bb.Flavor == "B") {
653  Flavors[0] = 4;
654  } else if (params.bb.Flavor == "T") {
655  Flavors[0] = 5;
656  } else {
658  << ": invalid flavor tag = " << params.bb.Flavor
659  << ", should be one of U,D,S,C,T,B" << std::endl;
660  QDP_abort(1);
661  }
662 
663  //######################################################################//
664  // Construct Building Blocks //
665  //######################################################################//
666 
667  swatch.reset();
668  Out << "calculating building blocks" << "\n";
669  Out.flush();
670  QDPIO::cout << "calculating building blocks" << std::endl;
671 
672  const signed short int T1 = 0;
673  const signed short int T2 = QDP::Layout::lattSize()[j_decay] - 1;
674  const signed short int DecayDir = j_decay;
675  const signed short int Tsrc = T1;
676  const signed short int Tsnk = T2;
677 
678  swatch.start();
679 
680  BuildingBlocks( S, F, U, GammaInsertions, Flavors,
681  params.param.links_max, AllNoisyLinkPatterns, Phases, PhasesCanonical,
682  Files, T1, T2, Tsrc, Tsnk,
683  source_header.source.id,
684  SnkMom, DecayDir,
686  false );
687 
688  swatch.stop();
689 
690  Out << "finished calculating building blocks" << "\n";
691  Out.flush();
692  QDPIO::cout << "finished calculating building blocks, time= "
693  << swatch.getTimeInSeconds() << " secs" << std::endl;
694 
695  pop(XmlOut); // ExampleBuildingBlocks
696 
697  Out << "\n" << "FINISHED" << "\n" << "\n";
698  Out.close();
699 
700 
701  snoop.stop();
702  QDPIO::cout << InlineNoisyBuildingBlocksEnv::name << ": total time = "
703  << snoop.getTimeInSeconds()
704  << " secs" << std::endl;
705 
706  QDPIO::cout << InlineNoisyBuildingBlocksEnv::name << ": ran successfully" << std::endl;
707 
708  END_CODE();
709  }
710 
711 }
Inline measurement factory.
Class for counted reference semantics.
Definition: handle.h:33
Inline measurement of noisy building blocks.
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Fourier transform phase factor support.
Definition: sftmom.h:35
multi1d< int > numToMom(int mom_num) const
Convert momenta id to actual array of momenta.
Definition: sftmom.h:78
int numMom() const
Number of momenta.
Definition: sftmom.h:60
const Set & getSet() const
The set to be used in sumMulti.
Definition: sftmom.h:57
static T & Instance()
Definition: singleton.h:432
All ferm create-state method.
Fermion create state factory.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void proginfo(XMLWriter &xml)
Print out basic information about this program.
Definition: proginfo.cc:24
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.
multi1d< int > t_srce
ForwardProp_t prop_header
Inline construction of noisy BuildingBlocks.
Make xml file writer.
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
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.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
void AllNoisyLinkPatterns(bool &DoThisPattern, bool &DoFurtherPatterns, multi1d< unsigned short int > &LinkPattern)
static const char *const CVSBuildingBlocks_hh
void BuildingBlocks(const multi1d< LatticePropagator > &B, const LatticePropagator &F, const multi1d< LatticeColorMatrix > &U, const multi1d< int > &GammaInsertions, const multi1d< int > &Flavors, const unsigned short int MaxNLinks, const BBLinkPattern LinkPattern, const SftMom &Phases, const SftMom &PhasesCanonical, const multi2d< std::string > &BinaryDataFileNames, const signed short int T1, const signed short int T2, const signed short int Tsrc, const signed short int Tsnk, const std::string &SeqSourceType, const multi1d< int > &SnkMom, const signed short int DecayDir, const bool TimeReverse, const bool ShiftFlag)
pop(xml_out)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Definition: mesplq.cc:83
void write(XMLWriter &xml, const std::string &path, const InlineNoisyBuildingBlocksParams::BB_out_t &input)
BB parameters.
START_CODE()
void CVSBuildingBlocks(TextWriter &Out)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
FloatingPoint< double > Double
Definition: gtest.h:7351
::std::string string
Definition: gtest.h:1979
Print out basic info about this program.
Fourier transform phase factor support.
Propagator parameters.
Definition: qprop_io.h:75
struct Chroma::InlineNoisyBuildingBlocksParams::Param_t param
void write(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineNoisyBuildingBlocksParams::BB_out_t bb
Propagator source construction parameters.
Definition: qprop_io.h:27
multi1d< LatticeColorMatrix > U
static INTERNAL_PRECISION F