24 namespace InlineMultiPropagatorEnv
58 XMLReader inputtop(xml, path);
85 XMLReader paramtop(xml_in, path);
87 if (paramtop.count(
"Frequency") == 1)
96 if( paramtop.count(
"Param/StateInfo") == 1 ) {
97 XMLReader xml_state_info(paramtop,
"Param/StateInfo");
98 std::ostringstream os;
99 xml_state_info.print(os);
103 XMLBufferWriter s_i_xml;
104 push(s_i_xml,
"StateInfo");
106 stateInfo = s_i_xml.printCurrentContext();
113 if (paramtop.count(
"xml_file") != 0)
120 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
135 XMLReader xml_header(header_is);
136 xml_out << xml_header;
154 push(xml_out,
"multi_propagator");
155 write(xml_out,
"update_no", update_no);
156 write(xml_out,
"xml_file", xml_file);
159 XMLFileWriter xml(xml_file);
160 func(update_no, xml);
164 func(update_no, xml_out);
181 XMLBufferWriter gauge_xml;
187 catch( std::bad_cast )
199 const multi1d<LatticeColorMatrix>&
u =
202 push(xml_out,
"multi_propagator");
204 write(xml_out,
"update_no", update_no);
206 QDPIO::cout <<
"MULTI_PROPAGATOR: multimass propagator calculation" << std::endl;
212 write(xml_out,
"Config_info", gauge_xml);
214 push(xml_out,
"Output_version");
215 write(xml_out,
"out_version", 1);
219 MesPlq(xml_out,
"Observables",
u);
224 XMLReader source_file_xml, source_record_xml;
225 bool make_sourceP =
false;
226 bool seqsourceP =
false;
238 if (source_record_xml.count(
"/MakeSource") != 0)
242 read(source_record_xml,
"/MakeSource/PropSource", source_header);
245 else if (source_record_xml.count(
"/SequentialSource") != 0)
249 read(source_record_xml,
"/SequentialSource/SeqSource", seqsource_header);
256 write(xml_out,
"Source_file_info", source_file_xml);
257 write(xml_out,
"Source_record_info", source_record_xml);
259 catch (std::bad_cast)
273 QDPIO::cerr <<
"Sequential propagator not supportd under multi-mass " << std::endl;
274 QDPIO::cerr <<
"since source is not mass independent " << std::endl;
286 multi1d<Double> source_corr =
290 push(xml_out,
"Source_correlator");
291 write(xml_out,
"source_corr", source_corr);
296 multi1d<LatticePropagator> quark_propagator(num_mass);
303 XMLReader fermacttop(xml_s);
317 XMLReader state_info_xml(state_info_is);
324 QDPIO::cout <<
"Try the various factories" << std::endl;
327 typedef LatticeFermion
T;
328 typedef multi1d<LatticeColorMatrix>
P;
329 typedef multi1d<LatticeColorMatrix>
Q;
345 QDPIO::cout <<
"Suitable factory found: compute the quark prop" << std::endl;
357 QDPIO::cout <<
"4D: " << e << std::endl;
359 catch(std::bad_cast) {
360 QDPIO::cerr <<
"Fermion action created cannot be used for multi mass qprop" << std::endl;
364 push(xml_out,
"Relaxation_Iterations");
365 write(xml_out,
"ncg_had", ncg_had);
372 for(
int m=0;
m < num_mass;
m++) {
373 multi1d<Double> prop_corr = sumMulti(localNorm2(quark_propagator[
m]),
376 push(xml_out,
"Prop_correlator");
377 write(xml_out,
"Number",
m);
379 write(xml_out,
"prop_corr", prop_corr);
386 for(
int m=0;
m < num_mass;
m++)
390 XMLBufferWriter file_xml;
391 push(file_xml,
"propagator");
395 XMLBufferWriter record_xml;
398 push(record_xml,
"Propagator");
417 XMLReader fermact_reader(fermact_is);
425 QDPIO::cerr <<
"Caught exception processing XML: " << e << std::endl;
431 XMLReader xml_read(fermact_reader,
"/");
435 QDPIO::cout <<
"Modified fermact is: " << out_param.
fermact.
xml << std::endl << std::flush;
443 write(record_xml,
"ForwardProp", out_param);
444 XMLReader xml_tmp(source_record_xml,
"/MakeSource");
445 record_xml << xml_tmp;
448 std::ostringstream outfile;
451 QDPIO::cout <<
"Attempting to save " << outfile.str() << std::endl;
456 = quark_propagator[
m];
462 catch (std::bad_cast)
480 << snoop.getTimeInSeconds()
481 <<
" secs" << std::endl;
Inline measurement factory.
virtual FermState< T, P, Q > * createState(const Q &q) const
Given links (coordinates Q) create the state needed for the linear operators.
Class for counted reference semantics.
Inline task for multi-mass propagators.
InlineMultiPropagatorParams params
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.
Base class for unpreconditioned overlap-like fermion actions.
Fourier transform phase factor support.
const Set & getSet() const
The set to be used in sumMulti.
Class structure for fermion actions.
Fermion action factories.
All Wilson-type fermion actions.
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.
std::string uniqueId()
Return a unique id.
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.
void multiQuarkProp(multi1d< LatticePropagator > &q_sol, XMLWriter &xml_out, const LatticePropagator &q_src, Handle< FermState< T, P, Q > > state, const multi1d< Real > &masses, const GroupXML_t &invParam, const int n_soln, int &ncg_had)
Define a multi mass qprop.
Inline construction of multi_propagator – overlap only.
Named object function std::map.
static bool registered
Local registration flag.
multi1d< LatticeColorMatrix > P
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
Base class for unpreconditioned overlap-like fermion actions.
Print out basic info about this program.
Fourier transform phase factor support.
QuarkSpinType quarkSpinType
GroupXML_t fermact
String holding XML of the FermionAction section.
multi1d< Real > MultiMasses
QuarkSpinType quarkSpinType
struct Chroma::InlineMultiPropagatorParams::NamedObject_t named_obj
void write(XMLWriter &xml_out, const std::string &path)
InlineMultiPropagatorParams()
Propagator source construction parameters.
Sequential source parameters.