CHROMA
purgaug.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Main code for pure gauge field generation
3  */
4 
5 #include "chroma.h"
7 
8 using namespace Chroma;
9 
10 namespace Chroma
11 {
12 
13  //! Holds gauge action
14  struct HBGauge
15  {
16  std::string gauge_act; /*!< Holds gauge action xml */
17  };
18 
19 
20  //! Read the parameters
21  void read(XMLReader& xml_in, const std::string& path, HBGauge& p)
22  {
23  try {
24  // Read the inverter Parameters
25  XMLReader xml_tmp(xml_in, "./GaugeAction");
26  std::ostringstream os;
27  xml_tmp.print(os);
28  p.gauge_act = os.str();
29  }
30  catch(const std::string& s) {
31  QDPIO::cerr << "Caught Exception while reading gauge action: " << s <<std::endl;
32  QDP_abort(1);
33  }
34 
35  QDPIO::cout << "Gauge action: read \n" << p.gauge_act << std::endl;
36  }
37 
38 
39  //! Writer
40  void write(XMLWriter& xml, const std::string& path, const HBGauge& p)
41  {
42  xml << p.gauge_act;
43  }
44 
45 
46  //! Reader
47  void read(XMLReader& xml, const std::string& path, HBParams& p)
48  {
49  try {
50  XMLReader paramtop(xml, path);
51  read(paramtop, "NmaxHB", p.NmaxHB);
52  read(paramtop, "nOver", p.nOver);
53  }
54  catch(const std::string& e ) {
55  QDPIO::cerr << "Caught Exception reading HBParams: " << e << std::endl;
56  QDP_abort(1);
57  }
58  }
59 
60  //! Writer
61  void write(XMLWriter& xml, const std::string& path, const HBParams& p)
62  {
63  push(xml, path);
64 
65  write(xml, "NmaxHB", p.NmaxHB);
66  write(xml, "nOver", p.nOver);
67 
68  pop(xml);
69  }
70 
71 
72  //! Params controlling running of monte carlo
73  struct MCControl
74  {
75  QDP::Seed rng_seed;
76  unsigned long start_update_num;
77  unsigned long n_warm_up_updates;
78  unsigned long n_production_updates;
79  unsigned int n_updates_this_run;
80  unsigned int save_interval;
82  QDP_volfmt_t save_volfmt;
83  };
84 
85  void read(XMLReader& xml, const std::string& path, MCControl& p)
86  {
87  try {
88  XMLReader paramtop(xml, path);
89  read(paramtop, "./RNG", p.rng_seed);
90  read(paramtop, "./StartUpdateNum", p.start_update_num);
91  read(paramtop, "./NWarmUpUpdates", p.n_warm_up_updates);
92  read(paramtop, "./NProductionUpdates", p.n_production_updates);
93  read(paramtop, "./NUpdatesThisRun", p.n_updates_this_run);
94  read(paramtop, "./SaveInterval", p.save_interval);
95  read(paramtop, "./SavePrefix", p.save_prefix);
96  read(paramtop, "./SaveVolfmt", p.save_volfmt);
97 
98  if (p.n_updates_this_run % p.save_interval != 0)
99  throw std::string("UpdateThisRun not a multiple of SaveInterval");
100  }
101  catch(const std::string& e ) {
102  QDPIO::cerr << "Caught Exception reading MCControl: " << e << std::endl;
103  QDP_abort(1);
104  }
105  }
106 
107  void write(XMLWriter& xml, const std::string& path, const MCControl& p)
108  {
109  push(xml, path);
110 
111  write(xml, "RNG", p.rng_seed);
112  write(xml, "StartUpdateNum", p.start_update_num);
113  write(xml, "NWarmUpUpdates", p.n_warm_up_updates);
114  write(xml, "NProductionUpdates", p.n_production_updates);
115  write(xml, "NUpdatesThisRun", p.n_updates_this_run);
116  write(xml, "SaveInterval", p.save_interval);
117  write(xml, "SavePrefix", p.save_prefix);
118  write(xml, "SaveVolfmt", p.save_volfmt);
119 
120  pop(xml);
121  }
122 
123 
124  //! Holds params for Heat-bath
125  struct HBItrParams
126  {
127  multi1d<int> nrow;
128 
129  HBGauge hb_gaugeact; /*!< This is polymorphic */
130  HBParams hb_params; /*!< Solely the HB bit */
131  };
132 
133  void write(XMLWriter& xml, const std::string& path, const HBItrParams& p)
134  {
135  push(xml, path);
136  write(xml, "nrow", p.nrow);
137  write(xml, "GaugeAction", p.hb_gaugeact);
138  write(xml, "HBParams", p.hb_params);
139  pop(xml);
140  }
141 
142 
143  void read(XMLReader& xml, const std::string& path, HBItrParams& p)
144  {
145  try {
146  XMLReader paramtop(xml, path);
147 
148  read(paramtop, "nrow", p.nrow);
149  read(paramtop, "GaugeAction", p.hb_gaugeact);
150  read(paramtop, "HBParams", p.hb_params);
151  }
152  catch( const std::string& e ) {
153  QDPIO::cerr << "Error reading HBItrParams XML : " << e << std::endl;
154  QDP_abort(1);
155  }
156  }
157 
158  //! Main struct from input params and output restarts
159  struct HBControl
160  {
165  };
166 
167 
168  //! Reader
169  void read(XMLReader& xml_in, const std::string& path, HBControl& p)
170  {
171  try {
172  XMLReader paramtop(xml_in, path);
173 
174  read(paramtop, "HBItr", p.hbitr_params);
175  read(paramtop, "MCControl", p.mc_control);
176  read(paramtop, "Cfg", p.cfg);
177 
178  if( paramtop.count("./InlineMeasurements") == 0 ) {
179  XMLBufferWriter dummy;
180  push(dummy, "InlineMeasurements");
181  pop(dummy); // InlineMeasurements
182  p.inline_measurement_xml = dummy.printCurrentContext();
183  }
184  else
185  {
186  XMLReader measurements_xml(paramtop, "./InlineMeasurements");
187  std::ostringstream inline_os;
188  measurements_xml.print(inline_os);
189  p.inline_measurement_xml = inline_os.str();
190  QDPIO::cout << "InlineMeasurements are: " << std::endl;
191  QDPIO::cout << p.inline_measurement_xml << std::endl;
192  }
193  }
194  catch(const std::string& e) {
195  QDPIO::cerr << "Caught Exception reading HBControl: " << e << std::endl;
196  QDP_abort(1);
197  }
198  }
199 
200 
201  //! Writer
202  void write(XMLWriter& xml, const std::string& path, const HBControl& p)
203  {
204  push(xml, path);
205 
206  write(xml, "Cfg", p.cfg);
207  write(xml, "MCControl", p.mc_control);
208  xml << p.inline_measurement_xml;
209  write(xml, "HBItr", p.hbitr_params);
210 
211  pop(xml);
212  }
213 
214 
215 
216  //--------------------------------------------------------------------------
217  // Specialise
218  MCControl newMCHeader(const HBItrParams& update_params,
219  const MCControl& mc_control,
220  unsigned long update_no)
221  {
222  START_CODE();
223 
224  // Copy old params
225  MCControl p_new = mc_control;
226 
227  // Get Current RNG Seed
228  QDP::RNG::savern(p_new.rng_seed);
229 
230  // Set the current traj number
231  p_new.start_update_num = update_no;
232 
233  // Reset the warmups
234  p_new.n_warm_up_updates = 0;
235 
236  // Set the num_updates_this_run
237  unsigned long total = mc_control.n_production_updates;
238 
239  if ( total < mc_control.n_updates_this_run + update_no ) {
240  p_new.n_updates_this_run = total - update_no;
241  }
242 
243  END_CODE();
244 
245  return p_new;
246  }
247 
248 
249 
250  // Specialise
251  void saveState(const HBItrParams& update_params,
252  MCControl& mc_control,
253  unsigned long update_no,
254  const std::string& inline_measurement_xml,
255  const multi1d<LatticeColorMatrix>& u)
256  {
257  START_CODE();
258 
259  MCControl mc_new = newMCHeader(update_params, mc_control, update_no);
260 
261  // Files
262  std::ostringstream restart_data_filename;
263  std::ostringstream restart_config_filename;
264 
265  unsigned long save_num = update_no / mc_control.save_interval;
266  restart_data_filename << mc_control.save_prefix << ".ini.xml" << save_num;
267  restart_config_filename << mc_control.save_prefix << ".lime" << save_num;
268 
269  {
270  HBControl hb;
271  hb.hbitr_params = update_params;
272  hb.mc_control = mc_new;
273  hb.inline_measurement_xml = inline_measurement_xml;
274 
275  // Set the name of the restart file
276  hb.cfg.cfg_file = restart_config_filename.str();
277 
278  // Hijack this for now and assumes it means what I want it to mean
280 
281  // Write a restart DATA file from the buffer XML
282  XMLFileWriter restart_xml(restart_data_filename.str().c_str());
283  write(restart_xml, "purgaug", hb);
284  restart_xml.close();
285  }
286 
287  {
288  // Save the config
289 
290  // some dummy header for the file
291  XMLBufferWriter file_xml;
292  push(file_xml, "HB");
293  proginfo(file_xml);
294  pop(file_xml);
295 
296  XMLBufferWriter config_xml;
297  push(config_xml, "ChromaHB");
298  write(config_xml, "MCControl", mc_new);
299  write(config_xml, "HBItr", update_params);
300  pop(config_xml);
301 
302  // Save the config
303  writeGauge(file_xml,
304  config_xml,
305  u,
306  restart_config_filename.str(),
307  mc_new.save_volfmt,
308  QDPIO_SERIAL);
309  }
310 
311  END_CODE();
312  }
313 
314 
315  //--------------------------------------------------------------------------
316  void doMeas(XMLWriter& xml_out,
317  multi1d<LatticeColorMatrix>& u,
318  HBControl& hb_control,
319  bool warm_up_p,
320  unsigned long cur_update,
321  const multi1d< Handle< AbsInlineMeasurement > >& default_measurements,
322  const multi1d< Handle<AbsInlineMeasurement> >& user_measurements)
323  {
324  START_CODE();
325 
326  // Create a gauge header for inline measurements.
327  // Since there are defaults always measured, we must always
328  // create a header.
329  //
330  // NOTE: THIS HEADER STUFF NEEDS A LOT MORE THOUGHT
331  //
332  MCControl mc_new = newMCHeader(hb_control.hbitr_params, hb_control.mc_control, cur_update);
333 
334  XMLBufferWriter gauge_xml;
335  push(gauge_xml, "ChromaHB");
336  write(gauge_xml, "MCControl", mc_new);
337  write(gauge_xml, "HBItr", hb_control.hbitr_params);
338  pop(gauge_xml);
339 
340  // Reset and set the default gauge field
342  InlineDefaultGaugeField::set(u, gauge_xml);
343 
344  // Measure inline observables
345  push(xml_out, "InlineObservables");
346 
347  // Always measure defaults
348  for(int m=0; m < default_measurements.size(); m++)
349  {
350  // Caller writes elem rule
351  AbsInlineMeasurement& the_meas = *(default_measurements[m]);
352  push(xml_out, "elem");
353  the_meas(cur_update, xml_out);
354  pop(xml_out);
355  }
356 
357  // Only measure user measurements after warm up
358  if( ! warm_up_p )
359  {
360  QDPIO::cout << "Doing " << user_measurements.size()
361  <<" user measurements" << std::endl;
362  for(int m=0; m < user_measurements.size(); m++)
363  {
364  AbsInlineMeasurement& the_meas = *(user_measurements[m]);
365  if( cur_update % the_meas.getFrequency() == 0 )
366  {
367  // Caller writes elem rule
368  push(xml_out, "elem");
369  the_meas(cur_update, xml_out );
370  pop(xml_out);
371  }
372  }
373  }
374  pop(xml_out); // pop("InlineObservables");
375 
376  // Reset the default gauge field
378 
379  END_CODE();
380  }
381 
382 
383 
384  //--------------------------------------------------------------------------
385  void doWarmUp(XMLWriter& xml_out,
386  multi1d<LatticeColorMatrix>& u,
387  const LinearGaugeAction& S_g,
388  HBControl& hb_control,
389  const multi1d< Handle< AbsInlineMeasurement > >& default_measurements,
390  const multi1d< Handle<AbsInlineMeasurement> >& user_measurements)
391  {
392  START_CODE();
393 
394  // Set the update number
395  unsigned long cur_update = 0;
396 
397  // Compute how many updates to do
398  unsigned long to_do = hb_control.mc_control.n_warm_up_updates;
399 
400  QDPIO::cout << "WarmUp Control: About to do " << to_do << " updates" << std::endl;
401 
402  // XML Output
403  push(xml_out, "WarmUpdates");
404 
405  for(int i=0; i < to_do; i++)
406  {
407  push(xml_out, "elem"); // Caller writes elem rule
408 
409  push(xml_out, "Update");
410  // Increase current update counter
411  cur_update++;
412 
413  // Log
414  write(xml_out, "update_no", cur_update);
415  write(xml_out, "WarmUpP", true);
416 
417  // Do the update, but with no measurements
418  mciter(u, S_g, hb_control.hbitr_params.hb_params); //one hb sweep
419 
420  // Do measurements
421  doMeas(xml_out, u, hb_control, true, cur_update,
422  default_measurements, user_measurements);
423 
424  pop(xml_out); // pop("Update");
425  pop(xml_out); // pop("elem");
426  }
427 
428  pop(xml_out); // pop("WarmUpdates")
429 
430  END_CODE();
431  }
432 
433 
434  //--------------------------------------------------------------------------
435  void doProd(XMLWriter& xml_out,
436  multi1d<LatticeColorMatrix>& u,
437  const LinearGaugeAction& S_g,
438  HBControl& hb_control,
439  const multi1d< Handle< AbsInlineMeasurement > >& default_measurements,
440  const multi1d< Handle<AbsInlineMeasurement> >& user_measurements)
441  {
442  START_CODE();
443 
444  // Set the update number
445  unsigned long cur_update = hb_control.mc_control.start_update_num;
446 
447  // Compute how many updates to do
448  unsigned long total_updates = hb_control.mc_control.n_production_updates;
449 
450  unsigned long to_do = 0;
451  if ( total_updates > hb_control.mc_control.n_updates_this_run + cur_update +1 ) {
452  to_do = hb_control.mc_control.n_updates_this_run;
453  }
454  else {
455  to_do = total_updates - cur_update ;
456  }
457 
458  QDPIO::cout << "MC Control: About to do " << to_do << " updates" << std::endl;
459 
460  // XML Output
461  push(xml_out, "MCUpdates");
462 
463  for(int i=0; i < to_do; i++)
464  {
465  push(xml_out, "elem"); // Caller writes elem rule
466 
467  push(xml_out, "Update");
468  // Increase current update counter
469  cur_update++;
470 
471  // Decide if the next update is a warm up or not
472  QDPIO::cout << "Doing Update: " << cur_update << " warm_up_p = " << false << std::endl;
473 
474  // Log
475  write(xml_out, "update_no", cur_update);
476  write(xml_out, "WarmUpP", false);
477 
478  // Do the update
479  mciter(u, S_g, hb_control.hbitr_params.hb_params); //one hb sweep
480 
481  // Do measurements
482  doMeas(xml_out, u, hb_control, false, cur_update,
483  default_measurements, user_measurements);
484 
485  // Save if needed
486  if( cur_update % hb_control.mc_control.save_interval == 0 )
487  {
488  saveState(hb_control.hbitr_params, hb_control.mc_control,
489  cur_update,
490  hb_control.inline_measurement_xml, u);
491  }
492 
493  pop(xml_out); // pop("Update");
494  pop(xml_out); // pop("elem");
495  }
496 
497  pop(xml_out); // pop("MCUpdates")
498 
499  END_CODE();
500  }
501 
502 
503  //--------------------------------------------------------------------------
504  void doHB(multi1d<LatticeColorMatrix>& u,
505  const LinearGaugeAction& S_g,
506  HBControl& hb_control,
507  multi1d< Handle<AbsInlineMeasurement> >& user_measurements)
508  {
509  START_CODE();
510 
511  XMLWriter& xml_out = TheXMLOutputWriter::Instance();
512  push(xml_out, "doHB");
513 
514  multi1d< Handle< AbsInlineMeasurement > > default_measurements(1);
515  InlinePlaquetteEnv::Params plaq_params;
516  plaq_params.frequency = 1;
517  // It is a handle
518  default_measurements[0] = new InlinePlaquetteEnv::InlineMeas(plaq_params);
519 
520  try
521  {
522  // Initialise the RNG
523  QDP::RNG::setrn(hb_control.mc_control.rng_seed);
524 
525  // If warmups are required, do them first
526  if (hb_control.mc_control.n_warm_up_updates > 0)
527  {
528  doWarmUp(xml_out, u, S_g, hb_control, default_measurements, user_measurements);
529  hb_control.mc_control.n_warm_up_updates = 0; // reset
530  }
531 
532  // Do the production updates
533  doProd(xml_out, u, S_g, hb_control, default_measurements, user_measurements);
534  }
535  catch( const std::string& e) {
536  QDPIO::cerr << "Caught Exception: " << e << std::endl;
537  QDP_abort(1);
538  }
539 
540  pop(xml_out);
541 
542  END_CODE();
543  }
544 
545  bool linkageHack(void)
546  {
547  bool foo = true;
548 
549  // Gauge actions
550  foo &= GaugeActsEnv::registerAll();
551 
552  // Inline Measurements
554 
555  return foo;
556  }
557 }
558 
559 
560 using namespace Chroma;
561 
562 //! Pure gauge field generation via heatbath
563 /*! \defgroup purgaug Heat-bath
564  * \ingroup main
565  *
566  * Main program for heat-bath generation of
567  */
568 
569 int main(int argc, char *argv[])
570 {
571  Chroma::initialize(&argc, &argv);
572 
573  START_CODE();
574 
575  // Chroma Init stuff -- Open DATA and XMLDAT
576  linkageHack();
577 
578  XMLFileWriter& xml_out = Chroma::getXMLOutputInstance();
579  push(xml_out, "purgaug");
580 
581  HBControl hb_control;
582 
583  try
584  {
585  XMLReader xml_in(Chroma::getXMLInputFileName());
586 
587  read(xml_in, "/purgaug", hb_control);
588 
589  // Write out the input
590  write(xml_out, "Input", xml_in);
591  }
592  catch( const std::string& e ) {
593  QDPIO::cerr << "Caught Exception reading input XML: " << e << std::endl;
594  QDP_abort(1);
595  }
596  catch( std::exception& e ) {
597  QDPIO::cerr << "Caught standard library exception: " << e.what() << std::endl;
598  QDP_abort(1);
599  }
600  catch(...) {
601  QDPIO::cerr << "Caught unknown exception " << std::endl;
602  QDP_abort(1);
603  }
604 
605  Layout::setLattSize(hb_control.hbitr_params.nrow);
606  Layout::create();
607 
608  proginfo(xml_out); // Print out basic program info
609 
610  // Start up the config
611  multi1d<LatticeColorMatrix> u(Nd);
612  {
613  XMLReader file_xml;
614  XMLReader config_xml;
615 
616  gaugeStartup(file_xml, config_xml, u, hb_control.cfg);
617 
618  // Write out the config header
619  push(xml_out, "Config_info");
620  write(xml_out, "file_xml", file_xml);
621  write(xml_out, "config_xml", config_xml);
622  pop(xml_out);
623  }
624 
625 
626  // Create the gauge action
627  // This code is limited to only rb sets and subsets.
628  // The main point is
629  // The number of subsets within the staples, etc. and to get the subsets
630  // straight
632  try
633  {
634  std::istringstream is(hb_control.hbitr_params.hb_gaugeact.gauge_act);
635  XMLReader gaugeact_reader(is);
636 
637  // Get the name of the gauge act
638  std::string gaugeact_string;
639  try {
640  read(gaugeact_reader, "/GaugeAction/Name", gaugeact_string);
641  }
642  catch( const std::string& e)
643  {
644  QDPIO::cerr << "Error grepping the gaugeact name: " << e<< std::endl;
645  QDP_abort(1);
646  }
647 
648  // Throw an exception if not found
649  typedef multi1d<LatticeColorMatrix> P;
650  typedef multi1d<LatticeColorMatrix> Q;
651 
652  GaugeAction<P,Q>* gaugeact =
653  TheGaugeActFactory::Instance().createObject(gaugeact_string,
654  gaugeact_reader,
655  "/GaugeAction");
656  S_g = dynamic_cast<LinearGaugeAction*>(gaugeact);
657  }
658  catch(std::bad_cast)
659  {
660  QDPIO::cerr << "PURGAUG: caught cast error" << std::endl;
661  QDP_abort(1);
662  }
663  catch(std::bad_alloc)
664  {
665  // This might happen on any node, so report it
666  std::cerr << "PURGAUG: caught bad memory allocation" << std::endl;
667  QDP_abort(1);
668  }
669  catch(const std::string& e)
670  {
671  QDPIO::cerr << "PURGAUG: Caught Exception: " << e << std::endl;
672  QDP_abort(1);
673  }
674  catch(std::exception& e)
675  {
676  QDPIO::cerr << "PURGAUG: Caught standard library exception: " << e.what() << std::endl;
677  QDP_abort(1);
678  }
679  catch(...)
680  {
681  // This might happen on any node, so report it
682  std::cerr << "PURGAUG: caught generic exception during measurement" << std::endl;
683  QDP_abort(1);
684  }
685 
686 
687  // Get the measurements
688  multi1d < Handle< AbsInlineMeasurement > > the_measurements;
689 
690  try {
691  std::istringstream Measurements_is(hb_control.inline_measurement_xml);
692 
693  XMLReader MeasXML(Measurements_is);
694 
695  std::ostringstream os;
696  MeasXML.print(os);
697  QDPIO::cout << os.str() << std::endl << std::flush;
698 
699  read(MeasXML, "/InlineMeasurements", the_measurements);
700  }
701  catch(const std::string& e) {
702  QDPIO::cerr << "Caugth exception while reading measurements: " << e << std::endl
703  << std::flush;
704 
705  QDP_abort(1);
706  }
707 
708  QDPIO::cout << "There are " << the_measurements.size() << " user measurements " << std::endl;
709 
710 
711  // Run
712  try
713  {
714  doHB(u, *S_g, hb_control, the_measurements);
715  }
716  catch(std::bad_cast)
717  {
718  QDPIO::cerr << "PURGAUG: caught cast error" << std::endl;
719  QDP_abort(1);
720  }
721  catch(std::bad_alloc)
722  {
723  QDPIO::cerr << "PURGAUG: caught bad memory allocation" << std::endl;
724  QDP_abort(1);
725  }
726  catch(const std::string& e)
727  {
728  QDPIO::cerr << "PURGAUG: Caught std::string exception: " << e << std::endl;
729  QDP_abort(1);
730  }
731  catch(std::exception& e)
732  {
733  QDPIO::cerr << "PURGAUG: Caught standard library exception: " << e.what() << std::endl;
734  QDP_abort(1);
735  }
736  catch(...)
737  {
738  QDPIO::cerr << "PURGAUG: Caught generic/unknown exception" << std::endl;
739  QDP_abort(1);
740  }
741 
742  pop(xml_out);
743 
744  END_CODE();
745 
747  exit(0);
748 }
749 
Primary include file for CHROMA in application codes.
virtual unsigned long getFrequency(void) const =0
Tell me how often I should measure this beastie.
Abstract base class for gauge actions.
Definition: gaugeact.h:25
Class for counted reference semantics.
Definition: handle.h:33
Base class for gauge actions with links appearing linearly in the action.
Definition: gaugeact.h:80
static T & Instance()
Definition: singleton.h:432
All gauge actions.
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 gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
void mciter(multi1d< LatticeColorMatrix > &u, const LinearGaugeAction &S_g, const HBParams &hbp)
One heatbath interation of updating the gauge field configuration.
Definition: mciter.cc:30
void proginfo(XMLWriter &xml)
Print out basic information about this program.
Definition: proginfo.cc:24
void reset()
Reset the default gauge field state.
void set(const multi1d< LatticeColorMatrix > &u, XMLBufferWriter &record_xml)
Set the default gauge field.
void writeGauge(XMLBufferWriter &file_xml, XMLBufferWriter &record_xml, const multi1d< LatticeColorMatrix > &u, const std::string &file, QDP_volfmt_t volfmt, QDP_serialparallel_t serpar)
Write a gauge config in QIO format.
Definition: gauge_io.cc:60
@ CFG_TYPE_SZINQIO
void setrn(int iseed[4])
Definition: make_seeds.cc:38
static int m[4]
Definition: make_seeds.cc:16
void savern(int iseed[4])
Definition: make_seeds.cc:46
Nd
Definition: meslate.cc:74
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
multi1d< LatticeColorMatrix > P
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
void doHB(multi1d< LatticeColorMatrix > &u, const LinearGaugeAction &S_g, HBControl &hb_control, multi1d< Handle< AbsInlineMeasurement > > &user_measurements)
Definition: purgaug.cc:504
void doProd(XMLWriter &xml_out, multi1d< LatticeColorMatrix > &u, const LinearGaugeAction &S_g, HBControl &hb_control, const multi1d< Handle< AbsInlineMeasurement > > &default_measurements, const multi1d< Handle< AbsInlineMeasurement > > &user_measurements)
Definition: purgaug.cc:435
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
MCControl newMCHeader(const HBItrParams &update_params, const MCControl &mc_control, unsigned long update_no)
Definition: purgaug.cc:218
int i
Definition: pbg5p_w.cc:55
void saveState(const UpdateParams &update_params, MCControl &mc_control, unsigned long update_no, const multi1d< LatticeColorMatrix > &u)
Definition: const_hmc.cc:251
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
Definition: chroma_init.cc:114
void doWarmUp(XMLWriter &xml_out, multi1d< LatticeColorMatrix > &u, const LinearGaugeAction &S_g, HBControl &hb_control, const multi1d< Handle< AbsInlineMeasurement > > &default_measurements, const multi1d< Handle< AbsInlineMeasurement > > &user_measurements)
Definition: purgaug.cc:385
void finalize(void)
Chroma finalization routine.
Definition: chroma_init.cc:308
bool linkageHack(void)
Definition: const_hmc.cc:660
std::string getXMLInputFileName()
Get input file name.
Definition: chroma_init.cc:88
pop(xml_out)
START_CODE()
void doMeas(XMLWriter &xml_out, multi1d< LatticeColorMatrix > &u, HBControl &hb_control, bool warm_up_p, unsigned long cur_update, const multi1d< Handle< AbsInlineMeasurement > > &default_measurements, const multi1d< Handle< AbsInlineMeasurement > > &user_measurements)
Definition: purgaug.cc:316
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
Definition: chroma_init.cc:359
multi1d< LatticeFermion > s(Ncb)
::std::string string
Definition: gtest.h:1979
int main(int argc, char *argv[])
Definition: purgaug.cc:569
Real dummy
Definition: qtopcor.cc:36
Gauge configuration structure.
Definition: cfgtype_io.h:16
std::string cfg_file
Definition: cfgtype_io.h:18
CfgType cfg_type
Definition: cfgtype_io.h:17
Main struct from input params and output restarts.
Definition: purgaug.cc:160
MCControl mc_control
Definition: purgaug.cc:162
std::string inline_measurement_xml
Definition: purgaug.cc:164
HBItrParams hbitr_params
Definition: purgaug.cc:161
Holds gauge action.
Definition: purgaug.cc:15
std::string gauge_act
Definition: purgaug.cc:16
Holds params for Heat-bath.
Definition: purgaug.cc:126
HBParams hb_params
Definition: purgaug.cc:130
HBGauge hb_gaugeact
Definition: purgaug.cc:129
multi1d< int > nrow
Definition: purgaug.cc:127
Heat-bath params.
Definition: hb_params.h:16
Params controlling running of monte carlo.
Definition: const_hmc.cc:14
unsigned long n_warm_up_updates
Definition: const_hmc.cc:18
unsigned long n_production_updates
Definition: const_hmc.cc:19
QDP::Seed rng_seed
Definition: const_hmc.cc:16
unsigned int save_interval
Definition: const_hmc.cc:21
unsigned int n_updates_this_run
Definition: const_hmc.cc:20
QDP_volfmt_t save_volfmt
Definition: const_hmc.cc:23
std::string save_prefix
Definition: const_hmc.cc:22
unsigned long start_update_num
Definition: const_hmc.cc:17