31 XMLReader paramtop(xml, path);
32 read(paramtop,
"nrow",
p.nrow);
34 XMLReader measurements_xml(paramtop,
"InlineMeasurements");
35 std::ostringstream inline_os;
36 measurements_xml.print(inline_os);
37 p.inline_measurement_xml = inline_os.str();
38 QDPIO::cout <<
"InlineMeasurements are: " << std::endl;
39 QDPIO::cout <<
p.inline_measurement_xml << std::endl;
46 XMLReader paramtop(xml, path);
48 read(paramtop,
"Param",
p.param);
51 if (paramtop.count(
"RNG") > 0)
52 read(paramtop,
"RNG",
p.rng_seed);
58 QDPIO::cerr <<
"Error reading XML : " << e << std::endl;
83 int main(
int argc,
char *argv[])
90 QDPIO::cout <<
"Linkage = " <<
linkageHack() << std::endl;
103 read(xml_in,
"/chroma", input);
107 QDPIO::cerr <<
"CHROMA: Caught Exception reading XML: " << e << std::endl;
110 catch(std::exception& e)
112 QDPIO::cerr <<
"CHROMA: Caught standard library exception: " << e.what() << std::endl;
117 QDPIO::cerr <<
"CHROMA: caught generic exception reading XML" << std::endl;
122 push(xml_out,
"chroma");
125 write(xml_out,
"Input", xml_in);
139 multi1d<LatticeColorMatrix>
u(
Nd);
140 XMLReader gauge_file_xml, gauge_xml;
143 QDPIO::cout <<
"CHROMA: Attempt to read gauge field" << std::endl;
147 std::istringstream xml_c(input.
cfg.
xml);
148 XMLReader cfgtop(xml_c);
149 QDPIO::cout <<
"CHROMA: Gauge initialization: cfg_type = " << input.
cfg.
id << std::endl;
155 (*gaugeInit)(gauge_file_xml, gauge_xml,
u);
159 QDPIO::cerr <<
"CHROMA: caught cast error" << std::endl;
162 catch(std::bad_alloc)
165 std::cerr <<
"CHROMA: caught bad memory allocation" << std::endl;
170 QDPIO::cerr <<
"CHROMA: Caught Exception: " << e << std::endl;
173 catch(std::exception& e)
175 QDPIO::cerr <<
"CHROMA: Caught standard library exception: " << e.what() << std::endl;
181 std::cerr <<
"CHROMA: caught generic exception during gaugeInit" << std::endl;
187 QDPIO::cout <<
"CHROMA: Gauge field successfully read: time= "
188 << swatch.getTimeInSeconds()
189 <<
" secs" << std::endl;
191 XMLBufferWriter config_xml;
192 config_xml << gauge_xml;
195 write(xml_out,
"Config_info", gauge_xml);
201 MesPlq(xml_out,
"Observables",
u);
203 QDPIO::cout <<
"CHROMA: initial plaquette measurement time=" << swatch.getTimeInSeconds() <<
" secs" << std::endl;
213 XMLReader MeasXML(Measurements_is);
214 multi1d < Handle< AbsInlineMeasurement > > the_measurements;
215 read(MeasXML,
"/InlineMeasurements", the_measurements);
217 QDPIO::cout <<
"CHROMA: There are " << the_measurements.size() <<
" measurements " << std::endl;
224 push(xml_out,
"InlineObservables");
228 QDPIO::cout <<
"CHROMA: parsing inline measurements time=" << swatch.getTimeInSeconds() <<
" secs" << std::endl;
229 QDPIO::cout <<
"CHROMA: Doing " << the_measurements.size()
230 <<
" measurements" << std::endl;
233 unsigned long cur_update = 0;
234 for(
int m=0;
m < the_measurements.size();
m++)
240 push(xml_out,
"elem");
241 the_meas(cur_update, xml_out);
249 QDPIO::cout <<
"CHROMA: measurements: time= "
250 << swatch.getTimeInSeconds()
251 <<
" secs" << std::endl;
261 QDPIO::cerr <<
"CHROMA: caught cast error" << std::endl;
264 catch(std::bad_alloc)
267 std::cerr <<
"CHROMA: caught bad memory allocation" << std::endl;
272 QDPIO::cerr <<
"CHROMA: Caught Exception: " << e << std::endl;
277 QDPIO::cout <<
"CHROMA: Caught const char * exception: " << e << std::endl;
280 catch(std::exception& e)
282 QDPIO::cerr <<
"CHROMA: Caught standard library exception: " << e.what() << std::endl;
288 std::cerr <<
"CHROMA: caught generic exception during measurement" << std::endl;
289 std::cerr <<
"Rethrowing" << std::endl;
295 QDPIO::cout <<
"CHROMA: total time = "
296 << snoop.getTimeInSeconds()
297 <<
" secs" << std::endl;
299 QDPIO::cout <<
"CHROMA: ran successfully" << std::endl;
int main(int argc, char *argv[])
Primary include file for CHROMA in application codes.
virtual unsigned long getFrequency(void) const =0
Tell me how often I should measure this beastie.
Class for counted reference semantics.
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 proginfo(XMLWriter &xml)
Print out basic information about this program.
void reset()
Reset the default gauge field state.
void set(const multi1d< LatticeColorMatrix > &u, XMLBufferWriter &record_xml)
Set the default gauge field.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
std::string getXMLInputFileName()
Get input file name.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
Hold group xml and type id.
std::string inline_measurement_xml