CHROMA
inline_stoch_meson_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Inline measurement of stochastic meson operator
3  *
4  */
5 
6 #include "handle.h"
14 #include "meas/sources/zN_src.h"
16 #include "meas/glue/mesplq.h"
17 #include "util/ft/sftmom.h"
18 #include "util/info/proginfo.h"
20 
22 
23 namespace Chroma
24 {
25  namespace InlineStochMesonEnv
26  {
27  namespace
28  {
29  AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
30  const std::string& path)
31  {
32  return new InlineStochMeson(InlineStochMesonParams(xml_in, path));
33  }
34 
35  //! Local registration flag
36  bool registered = false;
37  }
38 
39  const std::string name = "STOCH_MESON";
40 
41  //! Register all the factories
42  bool registerAll()
43  {
44  bool success = true;
45  if (! registered)
46  {
49  success &= TheInlineMeasurementFactory::Instance().registerObject(name, createMeasurement);
50  registered = true;
51  }
52  return success;
53  }
54  }
55 
56 
57 
58  // Operator parameters
59  void read(XMLReader& xml, const std::string& path, InlineStochMesonParams::Prop_t::Operator_t& input)
60  {
61  XMLReader inputtop(xml, path);
62 
63  read(inputtop, "soln_files", input.soln_files);
64  }
65 
66 
67  // Operator parameters
68  void write(XMLWriter& xml, const std::string& path, const InlineStochMesonParams::Prop_t::Operator_t& input)
69  {
70  push(xml, path);
71  write(xml, "soln_files", input.soln_files);
72  pop(xml);
73  }
74 
75 
76  // Propagator parameters
77  void read(XMLReader& xml, const std::string& path, InlineStochMesonParams::Prop_t& input)
78  {
79  XMLReader inputtop(xml, path);
80 
81  read(inputtop, "operator_file", input.op_file);
82  read(inputtop, "operator", input.op);
83  }
84 
85 
86  // Propagator parameters
87  void write(XMLWriter& xml, const std::string& path, const InlineStochMesonParams::Prop_t& input)
88  {
89  push(xml, path);
90 
91  write(xml, "operator_file", input.op_file);
92  write(xml, "operator", input.op);
93 
94  pop(xml);
95  }
96 
97 
98  // Reader for input parameters
99  void read(XMLReader& xml, const std::string& path, InlineStochMesonParams::Param_t& param)
100  {
101  XMLReader paramtop(xml, path);
102 
103  int version;
104  read(paramtop, "version", version);
105 
106  switch (version)
107  {
108  case 1:
109  /**************************************************************************/
110  break;
111 
112  default :
113  /**************************************************************************/
114 
115  QDPIO::cerr << "Input parameter version " << version << " unsupported." << std::endl;
116  QDP_abort(1);
117  }
118 
119  read(paramtop, "mom2_max", param.mom2_max);
120  }
121 
122 
123  // Reader for input parameters
124  void write(XMLWriter& xml, const std::string& path, const InlineStochMesonParams::Param_t& param)
125  {
126  push(xml, path);
127 
128  int version = 1;
129 
130  write(xml, "version", version);
131  write(xml, "mom2_max", param.mom2_max);
132 
133  pop(xml);
134  }
135 
136 
137  //! Propagator parameters
138  void read(XMLReader& xml, const std::string& path, InlineStochMesonParams::NamedObject_t& input)
139  {
140  XMLReader inputtop(xml, path);
141 
142  read(inputtop, "gauge_id", input.gauge_id);
143  read(inputtop, "Prop", input.prop);
144  }
145 
146  //! Propagator parameters
147  void write(XMLWriter& xml, const std::string& path, const InlineStochMesonParams::NamedObject_t& input)
148  {
149  push(xml, path);
150 
151  write(xml, "gauge_id", input.gauge_id);
152  write(xml, "Prop", input.prop);
153 
154  pop(xml);
155  }
156 
157 
158  // Param stuff
160  {
161  frequency = 0;
162  }
163 
165  {
166  try
167  {
168  XMLReader paramtop(xml_in, path);
169 
170  if (paramtop.count("Frequency") == 1)
171  read(paramtop, "Frequency", frequency);
172  else
173  frequency = 1;
174 
175  // Read program parameters
176  read(paramtop, "Param", param);
177 
178  // Source smearing
179  read(paramtop, "SourceSmearing", source_smearing);
180 
181  // Sink smearing
182  read(paramtop, "SinkSmearing", sink_smearing);
183 
184  // Read in the output propagator/source configuration info
185  read(paramtop, "NamedObject", named_obj);
186 
187  // Possible alternate XML file pattern
188  if (paramtop.count("xml_file") != 0)
189  {
190  read(paramtop, "xml_file", xml_file);
191  }
192  }
193  catch(const std::string& e)
194  {
195  QDPIO::cerr << __func__ << ": Caught Exception reading XML: " << e << std::endl;
196  QDP_abort(1);
197  }
198  }
199 
200 
201  void
202  InlineStochMesonParams::write(XMLWriter& xml_out, const std::string& path)
203  {
204  push(xml_out, path);
205 
206  // Parameters for source construction
207  Chroma::write(xml_out, "Param", param);
208 
209  // Source smearing
210  Chroma::write(xml_out, "SourceSmearing", source_smearing);
211 
212  // Sink smearing
213  Chroma::write(xml_out, "SinkSmearing", sink_smearing);
214 
215  // Write out the output propagator/source configuration info
216  Chroma::write(xml_out, "NamedObject", named_obj);
217 
218  pop(xml_out);
219  }
220 
221 
222 
223  //--------------------------------------------------------------
224 
225  //! Structure holding a source and its solutions
227  {
228  //! Structure holding solutions
229  struct QuarkSolution_t
230  {
231  LatticeFermion source;
232  LatticeFermion soln;
235  };
236 
237  int j_decay;
238  Seed seed;
239  multi1d<QuarkSolution_t> dilutions;
240  };
241 
242 
243  //! Meson operator
245  {
246  //! Serialize generalized operator object
247  multi1d<Complex> serialize();
248 
249  //! Meson operator
251  {
252  //! Meson operator element
254  {
255  multi2d<DComplex> elem; /*!< time slice and momenta number */
256  };
257 
258  multi2d<MesonOperatorElement_t> op; /*!< hybrid list indices */
259  };
260 
261  std::string smearing_l; /*!< std::string holding smearing xml */
262  std::string smearing_r; /*!< std::string holding smearing xml */
263 
264  int mom2_max;
265  int j_decay;
266  Seed seed_l;
267  Seed seed_r;
268  multi1d<MesonOperatorInsertion_t> inser; // outside array is over gammas
269  };
270 
271 
272  //! Serialize generalized operator object
273  multi1d<Complex> MesonOperator_t::serialize()
274  {
275  int inser_size = inser.size();
276  int op_size2 = inser[0].op.size2();
277  int op_size1 = inser[0].op.size1();
278  int elem_size2 = inser[0].op(0,0).elem.size2();
279  int elem_size1 = inser[0].op(0,0).elem.size1();
280 
281  // dreadful hack - use a complex to hold an int
282  Complex inser_sizes, op_sizes, elem_sizes;
283  inser_sizes = cmplx(Real(inser.size()), Real(zero));
284  op_sizes = cmplx(Real(op_size2), Real(op_size1));
285  elem_sizes = cmplx(Real(elem_size2), Real(elem_size1));
286 
287  multi1d<Complex> mesprop_1d(3 + inser_size*op_size2*op_size1*elem_size2*elem_size1);
288 
289  int cnt = 0;
290 
291  mesprop_1d[cnt++] = inser_sizes;
292  mesprop_1d[cnt++] = op_sizes;
293  mesprop_1d[cnt++] = elem_sizes;
294 
295  for(int g=0; g < inser.size(); ++g) // inser
296  for(int i=0; i < inser[g].op.size2(); ++i) // op_l
297  for(int j=0; j < inser[g].op.size1(); ++j) // op_r
298  for(int k=0; k < inser[g].op(i,j).elem.size2(); ++k) // elem_l
299  for(int l=0; l < inser[g].op(i,j).elem.size1(); ++l) // elem_r
300  mesprop_1d[cnt++] = inser[g].op(i,j).elem(k,l);
301 
302  return mesprop_1d;
303  }
304 
305 
306  //! MesonOperator header writer
307  void write(XMLWriter& xml, const std::string& path, const MesonOperator_t& param)
308  {
309  if( path != "." )
310  push(xml, path);
311 
312  int version = 1;
313  write(xml, "version", version);
314  write(xml, "mom2_max", param.mom2_max);
315  write(xml, "j_decay", param.j_decay);
316  write(xml, "seed_l", param.seed_l);
317  write(xml, "seed_r", param.seed_r);
318  write(xml, "smearing_l", param.smearing_l);
319  write(xml, "smearing_r", param.smearing_r);
320 
321  if( path != "." )
322  pop(xml);
323  }
324 
325 
326 
327  //--------------------------------------------------------------
328  // Function call
329  void
330  InlineStochMeson::operator()(unsigned long update_no,
331  XMLWriter& xml_out)
332  {
333  // If xml file not empty, then use alternate
334  if (params.xml_file != "")
335  {
336  std::string xml_file = makeXMLFileName(params.xml_file, update_no);
337 
338  push(xml_out, "stoch_meson");
339  write(xml_out, "update_no", update_no);
340  write(xml_out, "xml_file", xml_file);
341  pop(xml_out);
342 
343  XMLFileWriter xml(xml_file);
344  func(update_no, xml);
345  }
346  else
347  {
348  func(update_no, xml_out);
349  }
350  }
351 
352 
353  // Function call
354  void
355  InlineStochMeson::func(unsigned long update_no,
356  XMLWriter& xml_out)
357  {
358  START_CODE();
359 
360  StopWatch snoop;
361  snoop.reset();
362  snoop.start();
363 
364  // Test and grab a reference to the gauge field
365  XMLBufferWriter gauge_xml;
366  try
367  {
368  TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.named_obj.gauge_id);
369  TheNamedObjMap::Instance().get(params.named_obj.gauge_id).getRecordXML(gauge_xml);
370  }
371  catch( std::bad_cast )
372  {
373  QDPIO::cerr << InlineStochMesonEnv::name << ": caught dynamic cast error"
374  << std::endl;
375  QDP_abort(1);
376  }
377  catch (const std::string& e)
378  {
379  QDPIO::cerr << InlineStochMesonEnv::name << ": std::map call failed: " << e
380  << std::endl;
381  QDP_abort(1);
382  }
383  const multi1d<LatticeColorMatrix>& u =
384  TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(params.named_obj.gauge_id);
385 
386  push(xml_out, "stoch_meson");
387  write(xml_out, "update_no", update_no);
388 
389  QDPIO::cout << InlineStochMesonEnv::name << ": Stochastic Meson Operator" << std::endl;
390 
391  proginfo(xml_out); // Print out basic program info
392 
393  // Write out the input
394  params.write(xml_out, "Input");
395 
396  // Write out the config info
397  write(xml_out, "Config_info", gauge_xml);
398 
399  push(xml_out, "Output_version");
400  write(xml_out, "out_version", 1);
401  pop(xml_out);
402 
403  // First calculate some gauge invariant observables just for info.
404  // This is really cheap.
405  MesPlq(xml_out, "Observables", u);
406 
407  // Save current seed
408  Seed ran_seed;
409  QDP::RNG::savern(ran_seed);
410 
411  //
412  // Read the source and solutions
413  //
414  snoop.start();
415  multi1d<QuarkSourceSolutions_t> quarks(params.named_obj.prop.op.size());
416  QDPIO::cout << "num_quarks= " << params.named_obj.prop.op.size() << std::endl;
417 
418  try
419  {
420  QDPIO::cout << "quarks.size= " << quarks.size() << std::endl;
421  for(int n=0; n < quarks.size(); ++n)
422  {
423  QDPIO::cout << "Attempt to read solutions for source number=" << n << std::endl;
424  quarks[n].dilutions.resize(params.named_obj.prop.op[n].soln_files.size());
425 
426  QDPIO::cout << "dilutions.size= " << quarks[n].dilutions.size() << std::endl;
427  for(int i=0; i < quarks[n].dilutions.size(); ++i)
428  {
429  XMLReader file_xml, record_xml;
430 
431  QDPIO::cout << "reading file= " << params.named_obj.prop.op[n].soln_files[i] << std::endl;
432  QDPFileReader from(file_xml, params.named_obj.prop.op[n].soln_files[i], QDPIO_SERIAL);
433  read(from, record_xml, quarks[n].dilutions[i].soln);
434  close(from);
435 
436  read(record_xml, "/Propagator/PropSource", quarks[n].dilutions[i].source_header);
437  read(record_xml, "/Propagator/ForwardProp", quarks[n].dilutions[i].prop_header);
438  }
439  }
440  }
441  catch (const std::string& e)
442  {
443  QDPIO::cerr << "Error extracting headers: " << e << std::endl;
444  QDP_abort(1);
445  }
446  snoop.stop();
447 
448  QDPIO::cout << "Sources and solutions successfully read: time= "
449  << snoop.getTimeInSeconds()
450  << " secs" << std::endl;
451 
452 
453 
454  //
455  // Check for each quark source that the solutions have their diluted
456  // on every site only once
457  //
458  snoop.start();
459 
460  try
461  {
462  push(xml_out, "Norms");
463  for(int n=0; n < quarks.size(); ++n)
464  {
465  bool first = true;
466  int N;
467  LatticeFermion quark_noise; // noisy source on entire lattice
468 
469  for(int i=0; i < quarks[n].dilutions.size(); ++i)
470  {
471  std::istringstream xml_s(quarks[n].dilutions[i].source_header.source.xml);
472  XMLReader sourcetop(xml_s);
473 // QDPIO::cout << "Source = " << quarks[n].dilutions[i].source_header.source.id << std::endl;
474 
475  if (quarks[n].dilutions[i].source_header.source.id != DiluteZNQuarkSourceConstEnv::getName())
476  {
477  QDPIO::cerr << "Expected source_type = " << DiluteZNQuarkSourceConstEnv::getName() << std::endl;
478  QDP_abort(1);
479  }
480 
481  QDPIO::cout << "Quark num= " << n << " dilution num= " << i << std::endl;
482 
483  // Manually create the params so I can peek into them and use the source constructor
484  DiluteZNQuarkSourceConstEnv::Params srcParams(sourcetop,
485  quarks[n].dilutions[i].source_header.source.path);
487 
488  if (first)
489  {
490  first = false;
491 
492  quarks[0].j_decay = srcParams.j_decay;
493 
494  // Grab N
495  N = srcParams.N;
496 
497  // Set the seed to desired value
498  quarks[n].seed = srcParams.ran_seed;
499  QDP::RNG::setrn(quarks[n].seed);
500 
501  // Create the noisy quark source on the entire lattice
502  zN_src(quark_noise, N);
503  }
504 
505  // The seeds must always agree - here the seed is the unique id of the source
506  if ( toBool(srcParams.ran_seed != quarks[n].seed) )
507  {
508  QDPIO::cerr << "quark source=" << n << " dilution=" << i << " seed does not match" << std::endl;
509  QDP_abort(1);
510  }
511 
512  // The N's must always agree
513  if ( toBool(srcParams.N != N) )
514  {
515  QDPIO::cerr << "quark source=" << n << " dilution=" << i << " N does not match" << std::endl;
516  QDP_abort(1);
517  }
518 
519 #if 0
520  // Use a trick here, create the source and subtract it from the global noisy
521  // Check at the end that the global noisy is zero everywhere.
522  // NOTE: the seed will be set every call
523  quarks[n].dilutions[i].source = srcConst(u);
524  quark_noise -= quarks[n].dilutions[i].source;
525 
526  // Diagnostic
527  {
528  // Keep a copy of the phases with NO momenta
529 
530  multi1d<Double> source_corr = sumMulti(localNorm2(quarks[n].dilutions[i].source),
531  phases_nomom.getSet());
532 
533  multi1d<Double> soln_corr = sumMulti(localNorm2(quarks[n].dilutions[i].soln),
534  phases_nomom.getSet());
535 
536  push(xml_out, "elem");
537  write(xml_out, "n", n);
538  write(xml_out, "i", i);
539  write(xml_out, "source_corr", source_corr);
540  write(xml_out, "soln_corr", soln_corr);
541  pop(xml_out);
542  }
543 #endif
544  } // end for i
545 
546 #if 0
547  Double dcnt = norm2(quark_noise, phases );
548  if (toDouble(dcnt) != 0.0) // problematic - seems to work with unnormalized sources
549  {
550  QDPIO::cerr << "Noise not saturated by all potential solutions: dcnt=" << dcnt << std::endl;
551  QDP_abort(1);
552  }
553 
554 #endif
555  } // end for n
556 
557  pop(xml_out);
558  } // end try
559  catch(const std::string& e)
560  {
561  QDPIO::cerr << ": Caught Exception creating source: " << e << std::endl;
562  QDP_abort(1);
563  }
564 
565  snoop.stop();
566 
567  QDPIO::cout << "Sources saturated: time= "
568  << snoop.getTimeInSeconds()
569  << " secs" << std::endl;
570 
571 
572  //
573  // Meson operators
574  //
575  int j_decay = quarks[0].j_decay;
576 
577  // Initialize the slow Fourier transform phases
578  SftMom phases(params.param.mom2_max, false, j_decay);
579 
580  // Length of lattice in decay direction
581  int length = phases.numSubsets();
582 
583 
584  if (quarks.size() != 2)
585  {
586  QDPIO::cerr << "expecting 2 quarks but have num quarks= " << quarks.size() << std::endl;
587  QDP_abort(1);
588  }
589 
590 
591  // Operator A
592  snoop.start();
593  MesonOperator_t meson_opA;
594  meson_opA.mom2_max = params.param.mom2_max;
595  meson_opA.j_decay = j_decay;
596  meson_opA.seed_l = quarks[1].seed;
597  meson_opA.seed_r = quarks[0].seed;
600  meson_opA.inser.resize(Ns*Ns);
601 
602  // Sanity check
603  if ( toBool(meson_opA.seed_l == meson_opA.seed_r) )
604  {
605  QDPIO::cerr << "meson op seeds are the same" << std::endl;
606  QDP_abort(1);
607  }
608 
609  // Construct operator A
610  try
611  {
612  int G5 = Ns*Ns-1;
613 
614  std::istringstream xml_s(params.source_smearing.source.xml);
615  XMLReader sourcetop(xml_s);
616  QDPIO::cout << "Source = " << params.source_smearing.source.id << std::endl;
617 
619  sourceSmearing(TheFermSourceSmearingFactory::Instance().createObject(
621  sourcetop,
623  u));
624 
625  push(xml_out, "OperatorA");
626 
627  // Source smear all the sources up front
628  multi1d<LatticeFermion> smeared_sources(quarks[1].dilutions.size());
629  for(int i=0; i < smeared_sources.size(); ++i)
630  {
631  smeared_sources[i] = quarks[1].dilutions[i].source;
632  (*sourceSmearing)(smeared_sources[i]);
633  }
634 
635  // Source smear all the solutions up front
636  multi1d<LatticeFermion> smeared_solns(quarks[0].dilutions.size());
637  for(int j=0; j < smeared_solns.size(); ++j)
638  {
639  smeared_solns[j] = quarks[0].dilutions[j].soln;
640  (*sourceSmearing)(smeared_solns[j]);
641  }
642 
643  QDPIO::cout << "source smearings done" << std::endl;
644 
645  for(int gamma_value=0; gamma_value < Ns*Ns; ++gamma_value)
646  {
647  meson_opA.inser[gamma_value].op.resize(smeared_sources.size(), smeared_solns.size());
648 
649  for(int i=0; i < smeared_sources.size(); ++i)
650  {
651  for(int j=0; j < smeared_solns.size(); ++j)
652  {
653  // Optimize by restricting operations to source time slice
654  LatticeComplex corr_fn = zero;
655  corr_fn[phases.getSet()[quarks[1].dilutions[i].source_header.t_source]] =
656  localInnerProduct(smeared_sources[i], Gamma(gamma_value) * smeared_solns[j]);
657  meson_opA.inser[gamma_value].op(i,j).elem = phases.sft(corr_fn);
658  } // end for j
659  } // end for i
660  } // end for g
661 
662  pop(xml_out); // OperatorA
663  } // opA
664  catch(const std::string& e)
665  {
666  QDPIO::cerr << ": Caught Exception creating source smearing: " << e << std::endl;
667  QDP_abort(1);
668  }
669  catch(...)
670  {
671  QDPIO::cerr << ": Caught generic exception creating source smearing" << std::endl;
672  QDP_abort(1);
673  }
674 
675  snoop.stop();
676 
677  QDPIO::cout << "Operator A computed: time= "
678  << snoop.getTimeInSeconds()
679  << " secs" << std::endl;
680 
681 
682  // Operator B
683  snoop.start();
684  MesonOperator_t meson_opB;
685  meson_opB.mom2_max = params.param.mom2_max;
686  meson_opB.j_decay = j_decay;
687  meson_opB.seed_l = quarks[0].seed;
688  meson_opB.seed_r = quarks[1].seed;
689  meson_opB.smearing_l = params.sink_smearing.sink.xml;
690  meson_opB.smearing_r = params.sink_smearing.sink.xml;
691  meson_opB.inser.resize(Ns*Ns);
692 
693  // Sanity check
694  if ( toBool(meson_opB.seed_l == meson_opB.seed_r) )
695  {
696  QDPIO::cerr << "meson op seeds are the same" << std::endl;
697  QDP_abort(1);
698  }
699 
700  // Construct operator B
701  {
702  int G5 = Ns*Ns-1;
703 
704  std::istringstream xml_s(params.sink_smearing.sink.xml);
705  XMLReader sinktop(xml_s);
706  QDPIO::cout << "Sink = " << params.sink_smearing.sink.id << std::endl;
707 
709  sinkSmearing(TheFermSinkSmearingFactory::Instance().createObject(
711  sinktop,
713  u));
714 
715  push(xml_out, "OperatorB");
716 
717  // Sink smear all the sources up front
718  multi1d<LatticeFermion> smeared_sources(quarks[0].dilutions.size());
719  for(int j=0; j < smeared_sources.size(); ++j)
720  {
721  smeared_sources[j] = quarks[0].dilutions[j].source;
722  (*sinkSmearing)(smeared_sources[j]);
723  }
724 
725  // Sink smear all the solutions up front
726  multi1d<LatticeFermion> smeared_solns(quarks[1].dilutions.size());
727  for(int i=0; i < smeared_solns.size(); ++i)
728  {
729  smeared_solns[i] = quarks[1].dilutions[i].soln;
730  (*sinkSmearing)(smeared_solns[i]);
731  }
732 
733  QDPIO::cout << "sink smearings done" << std::endl;
734 
735  for(int gamma_value=0; gamma_value < Ns*Ns; ++gamma_value)
736  {
737  meson_opB.inser[gamma_value].op.resize(smeared_sources.size(), smeared_solns.size());
738 
739  for(int j=0; j < smeared_sources.size(); ++j)
740  {
741  for(int i=0; i < smeared_solns.size(); ++i)
742  {
743  // Optimize by restricting operations to source time slice
744  LatticeComplex corr_fn = zero;
745  corr_fn[phases.getSet()[quarks[0].dilutions[j].source_header.t_source]] =
746  localInnerProduct(smeared_sources[j], Gamma(gamma_value) * smeared_solns[i]);
747  meson_opB.inser[gamma_value].op(j,i).elem = phases.sft(corr_fn);
748  } // end for i
749  } // end for j
750  } // end for g
751 
752  pop(xml_out); // OperatorB
753  } // opB
754 
755  snoop.stop();
756 
757  QDPIO::cout << "Operator B computed: time= "
758  << snoop.getTimeInSeconds()
759  << " secs" << std::endl;
760 
761 
762  // Save the operators
763  // ONLY SciDAC output format is supported!
764  snoop.start();
765  {
766  XMLBufferWriter file_xml;
767  push(file_xml, "meson_operator");
768  write(file_xml, "Config_info", gauge_xml);
769  pop(file_xml);
770 
771  QDPFileWriter to(file_xml, params.named_obj.prop.op_file, // are there one or two files???
772  QDPIO_SINGLEFILE, QDPIO_SERIAL, QDPIO_OPEN);
773 
774  // Write the scalar data
775  {
776  XMLBufferWriter record_xml;
777  write(record_xml, "SourceMesonOperator", meson_opA);
778  write(to, record_xml, meson_opA.serialize());
779  }
780 
781  // Write the scalar data
782  {
783  XMLBufferWriter record_xml;
784  write(record_xml, "SinkMesonOperator", meson_opB);
785  write(to, record_xml, meson_opB.serialize());
786  }
787 
788  close(to);
789  }
790 
791  snoop.stop();
792 
793  QDPIO::cout << "Operators written: time= "
794  << snoop.getTimeInSeconds()
795  << " secs" << std::endl;
796 
797  // Close the namelist output file XMLDAT
798  pop(xml_out); // StochMeson
799 
800  snoop.stop();
801  QDPIO::cout << InlineStochMesonEnv::name << ": total time = "
802  << snoop.getTimeInSeconds()
803  << " secs" << std::endl;
804 
805  QDPIO::cout << InlineStochMesonEnv::name << ": ran successfully" << std::endl;
806 
807  END_CODE();
808  }
809 
810 }
Inline measurement factory.
Random complex Z(N) sources using dilution.
Class for counted reference semantics.
Definition: handle.h:33
Inline measurement of stochastic meson operators.
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.
InlineStochMesonParams params
Fourier transform phase factor support.
Definition: sftmom.h:35
int numSubsets() const
Number of subsets - length in decay direction.
Definition: sftmom.h:63
multi2d< DComplex > sft(const LatticeComplex &cf) const
Do a sumMulti(cf*phases,getSet())
Definition: sftmom.cc:524
const Set & getSet() const
The set to be used in sumMulti.
Definition: sftmom.h:57
static T & Instance()
Definition: singleton.h:432
Random Z(N) source construction using dilution.
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.
void zN_src(LatticeFermion &a, int N)
Volume source of Z(N) noise.
Definition: zN_src.cc:41
Class for counted reference semantics.
ForwardProp_t prop_header
Inline measurement of stochastic meson operator.
unsigned j
Definition: ldumul_w.cc:35
unsigned n
Definition: ldumul_w.cc:36
void setrn(int iseed[4])
Definition: make_seeds.cc:38
void savern(int iseed[4])
Definition: make_seeds.cc:46
Make xml file writer.
int j_decay
Definition: meslate.cc:22
Named object function std::map.
static bool registered
Local registration flag.
std::string getName()
Return the name.
QDPSubTypeTrait< typename BinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Type_t localInnerProduct(const QDPSubType< T1, C1 > &l, const QDPType< T2, C2 > &r)
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int G5
Definition: pbg5p_w.cc:57
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
pop(xml_out)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Definition: mesplq.cc:83
START_CODE()
Double zero
Definition: invbicg.cc:106
int k
Definition: invbicg.cc:119
FloatingPoint< double > Double
Definition: gtest.h:7351
::std::string string
Definition: gtest.h:1979
int l
Definition: pade_trln_w.cc:111
Print out basic info about this program.
Quark source or sink smearing.
Fourier transform phase factor support.
All make sink constructors.
Factory for producing quark prop sinks.
All source smearing.
Factory for producing quark smearing objects.
Propagator parameters.
Definition: qprop_io.h:75
Random complex Z(N) sources using dilution.
void write(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineStochMesonParams::Param_t param
struct Chroma::InlineStochMesonParams::NamedObject_t named_obj
multi1d< MesonOperatorInsertion_t > inser
multi1d< Complex > serialize()
Serialize generalized operator object.
Propagator source construction parameters.
Definition: qprop_io.h:27
Structure holding a source and its solutions.
multi1d< QuarkSolution_t > dilutions
Volume source of Z(N) noise.