29 namespace InlinePropAndMatElemColorVecEnv
34 XMLReader inputtop(xml, path);
63 XMLReader inputtop(xml, path);
88 XMLReader inputtop(xml, path);
90 read(inputtop,
"Propagator", input.
prop);
131 return new InlineMeas(Params(xml_in, path));
163 XMLReader paramtop(xml_in, path);
165 if (paramtop.count(
"Frequency") == 1)
177 if (paramtop.count(
"xml_file") != 0)
184 QDPIO::cerr <<
name <<
": Caught Exception reading XML: " << e << std::endl;
201 push(xml_out,
"PropColorVec");
202 write(xml_out,
"update_no", update_no);
203 write(xml_out,
"xml_file", xml_file);
206 XMLFileWriter xml(xml_file);
207 func(update_no, xml);
211 func(update_no, xml_out);
228 multi1d<LatticeColorMatrix>
u;
229 XMLBufferWriter gauge_xml;
235 catch( std::bad_cast )
237 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
242 QDPIO::cerr <<
name <<
": std::map call failed: " << e << std::endl;
246 push(xml_out,
"PropColorVec");
247 write(xml_out,
"update_no", update_no);
249 QDPIO::cout <<
name <<
": propagator calculation" << std::endl;
257 write(xml_out,
"Config_info", gauge_xml);
259 push(xml_out,
"Output_version");
260 write(xml_out,
"out_version", 1);
264 MesPlq(xml_out,
"Observables",
u);
269 XMLReader source_file_xml, source_record_xml;
271 QDPIO::cout <<
"Snarf the source from a named buffer" << std::endl;
282 write(xml_out,
"Source_file_info", source_file_xml);
283 write(xml_out,
"Source_record_info", source_record_xml);
285 catch (std::bad_cast) {
286 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
290 QDPIO::cerr <<
name <<
": error extracting source_header: " << e << std::endl;
293 catch(
const char* e) {
294 QDPIO::cerr <<
name <<
": Caught some char* exception:" << std::endl;
295 QDPIO::cerr << e << std::endl;
296 QDPIO::cerr <<
"Rethrowing" << std::endl;
301 const QDP::MapObject<int,EVPair<LatticeColorVector> >&
eigen_source =
304 QDPIO::cout <<
"Source successfully read and parsed" << std::endl;
315 XMLBufferWriter file_xml;
317 push(file_xml,
"MODMetaData");
319 write(file_xml,
"lattSize", QDP::Layout::lattSize());
326 write(file_xml,
"Config_info", gauge_xml);
329 file_str = file_xml.str();
334 XMLReader MapObjReader(xml_s);
344 catch (std::bad_cast)
346 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
351 QDPIO::cerr <<
name <<
": error creating prop: " << e << std::endl;
356 QDP::MapObject<KeyPropColorVec_t,LatticeFermion>& prop_obj =
366 multi1d<Double> source_corrs = sumMulti(localNorm2(tmpvec.
eigenVector), phases.
getSet());
368 push(xml_out,
"Source_correlators");
369 write(xml_out,
"source_corrs", source_corrs);
377 <<
" is greater than the number of available colorvectors= "
391 XMLBufferWriter file_xml;
393 push(file_xml,
"DBMetaData");
395 write(file_xml,
"lattSize", QDP::Layout::lattSize());
399 write(file_xml,
"Config_info", gauge_xml);
404 qdp_db.setMaxUserInfoLen(file_str.size());
408 qdp_db.insertUserdata(file_str);
426 QDPIO::cout <<
"Try the various factories" << std::endl;
429 typedef LatticeFermion
T;
430 typedef multi1d<LatticeColorMatrix>
P;
431 typedef multi1d<LatticeColorMatrix>
Q;
437 XMLReader fermacttop(xml_s);
451 QDPIO::cout <<
"Suitable factory found: compute all the quark props" << std::endl;
463 SftMom phases(0,
true, decay_dir);
467 for(
int tt=0; tt < t_sources.size(); ++tt)
470 QDPIO::cout <<
"t_source = " <<
t_source << std::endl;
473 for(
int spin_source=0; spin_source < Ns; ++spin_source)
475 QDPIO::cout <<
"spin_source = " << spin_source << std::endl;
480 multi2d<KeyValPropElementalOperator_t> buf(phases.
numSubsets(),Ns);
481 for(
int spin_sink=0; spin_sink < Ns; ++spin_sink)
485 buf(
t,spin_sink).key.key().t_slice =
t;
486 buf(
t,spin_sink).key.key().t_source =
t_source;
487 buf(
t,spin_sink).key.key().spin_src = spin_source;
488 buf(
t,spin_sink).key.key().spin_snk = spin_sink;
490 buf(
t,spin_sink).val.data().mat.resize(num_vecs,num_vecs);
495 for(
int colorvec_source=0; colorvec_source < num_vecs; ++colorvec_source)
497 QDPIO::cout <<
"colorvec_source = " << colorvec_source << std::endl;
500 LatticeColorVector vec_srce =
zero;
512 LatticeFermion quark_soln =
zero;
524 prop_obj.insert(key, quark_soln);
529 for(
int colorvec_sink=0; colorvec_sink < num_vecs; ++colorvec_sink)
533 for(
int spin_sink=0; spin_sink < Ns; ++spin_sink)
538 for(
int t=0;
t < hsum.size(); ++
t)
540 buf(
t,spin_sink).val.data().mat(colorvec_sink,colorvec_source) = hsum[
t];
546 for(
int spin_sink=0; spin_sink < Ns; ++spin_sink)
548 QDPIO::cout <<
"insert: spin_source= " << spin_source <<
" spin_sink= " << spin_sink << std::endl;
551 qdp_db.insert(buf(
t,spin_sink).key, buf(
t,spin_sink).val);
559 QDPIO::cout <<
"Propagators computed: time= "
560 << swatch.getTimeInSeconds()
561 <<
" secs" << std::endl;
565 QDPIO::cout <<
name <<
": caught exception around qprop: " << e << std::endl;
569 push(xml_out,
"Relaxation_Iterations");
570 write(xml_out,
"ncg_had", ncg_had);
580 XMLBufferWriter file_xml;
582 push(file_xml,
"PropColorVectors");
583 write(file_xml,
"num_records", prop_obj.size());
585 write(file_xml,
"Config_info", gauge_xml);
588 XMLBufferWriter record_xml;
589 push(record_xml,
"PropColorVector");
590 write(record_xml,
"num_records", prop_obj.size());
599 QDPIO::cout <<
name <<
": total time = "
600 << snoop.getTimeInSeconds()
601 <<
" secs" << std::endl;
603 QDPIO::cout <<
name <<
": ran successfully" << std::endl;
Inline measurement factory.
Class for counted reference semantics.
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.
Serializable value harness.
Fourier transform phase factor support.
int numSubsets() const
Number of subsets - length in decay direction.
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 CvToFerm(const LatticeColorVectorF &a, LatticeFermionF &b, int spin_index)
Convert (insert) a LatticeColorVector into a LatticeFermion.
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.
MODS_t & eigen_source
Eigenvectors.
Compute the perambulators.
Key for propagator colorstd::vector sources.
Key for propagator colorstd::vector matrix elements.
Named object function std::map.
static bool registered
Local registration flag.
const std::string name
Name to be used.
multi1d< LatticeColorMatrix > P
void read(XMLReader &xml, const std::string &path, Params::NamedObject_t &input)
Propagator input.
bool registerAll()
Register all the factories.
void write(XMLWriter &xml, const std::string &path, const Params::NamedObject_t &input)
Propagator output.
QDPSubTypeTrait< typename BinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Type_t localInnerProduct(const QDPSubType< T1, C1 > &l, const QDPType< T2, C2 > &r)
bool registerAll()
aggregate everything
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
multi1d< SubsetVectorWeight_t > getEigenValues(const MapObject< int, EVPair< LatticeColorVector > > &eigen_source, int num_vecs)
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
Print out basic info about this program.
Fourier transform phase factor support.
Holds return info from SystemSolver call.
Holds of vectors and weights.