25 XMLReader inputtop(xml, path);
36 XMLReader inputtop(xml, path);
42 namespace InlineEigenBinLimeColVecReadNamedObjEnv
47 multi1d<int>
coords(
const int x,
const int y,
const int z,
const int t)
60 void unserialize(LatticeColorVector &cvec,
const multi1d< Complex > &vec,
63 int vsize = QDP::Layout::lattSize()[0] * QDP::Layout::lattSize()[0] * QDP::Layout::lattSize()[0] * Nc;
65 if (vec.size() != vsize)
67 QDPIO::cerr <<
"in unserialize: invalid size of serialized std::vector"
74 for (
int x = 0 ;
x < QDP::Layout::lattSize()[0] ; ++
x)
75 for (
int y = 0 ;
y < QDP::Layout::lattSize()[0] ; ++
y)
76 for (
int z = 0 ;
z < QDP::Layout::lattSize()[0] ; ++
z)
78 ColorVector sitevec =
zero;
80 for (
int c = 0 ;
c < Nc ; ++
c)
82 Complex temp = vec[
c + Nc*(
z + QDP::Layout::lattSize()[0]*(
y + QDP::Layout::lattSize()[0]*
x)) ];
84 pokeColor(sitevec, temp,
c);
100 return new InlineMeas(Params(xml_in, path));
106 const std::string name =
"EIGENINFO_BIN_LIME_COLORVEC_READ_NAMED_OBJECT";
129 XMLReader paramtop(xml_in, path);
131 if (paramtop.count(
"Frequency") == 1)
145 QDPIO::cerr << __func__ <<
": caught Exception reading XML: " << e << std::endl;
156 push(xml_out,
"eigeninfo_bin_lime_colorvec_read_named_obj");
157 write(xml_out,
"update_no", update_no);
159 QDPIO::cout <<
name <<
": object reader" << std::endl;
173 XMLBufferWriter file_xml;
175 push(file_xml,
"MODMetaData");
177 write(file_xml,
"lattSize", QDP::Layout::lattSize());
181 file_str = file_xml.str();
186 XMLReader MapObjReader(xml_s);
197 int nt = QDP::Layout::lattSize()[
Nd-1];
198 int ns = QDP::Layout::lattSize()[0];
200 int ndim = ns * ns * ns * Nc;
207 XMLBufferWriter final_file_xml;
209 XMLBufferWriter final_record_xml;
210 push(final_record_xml,
"SubsetVectors");
211 push(final_record_xml,
"InfoArray");
216 QDPFileReader rdr(file_xml, filename, QDPIO_SERIAL);
219 write(final_file_xml,
"Input", file_xml);
222 multi1d<LatticeColorVector> evecs;
223 multi1d<SubsetVectorWeight_t> evals;
228 for (
int t = 0 ;
t < nt ; ++
t)
231 XMLReader curr_record_xml;
232 BinaryBufferReader bin_rdr;
233 read(rdr, curr_record_xml, bin_rdr);
237 multi1d<Real> evals_t;
239 if (curr_record_xml.count(
"/LaplaceEigInfo/EigenValues") != 0)
240 read(curr_record_xml,
"/LaplaceEigInfo/EigenValues", evals_t);
241 else if (curr_record_xml.count(
"/LaplaceEigInfo/EigParams/EigenValues") != 0)
242 read(curr_record_xml,
"/LaplaceEigInfo/EigParams/EigenValues", evals_t);
245 QDPIO::cerr << __func__ <<
": LaplaceEigInfo tag for EigenValues not found\n" << std::endl;
253 nev = evals_t.size();
256 QDPIO::cout <<
"Initializing eigenpairs" << std::endl;
257 for (
int v = 0 ; v < nev ; ++v)
260 evals[v].weights.resize(nt);
263 QDPIO::cout <<
"Unserealizing evecs for timeslice " <<
t << std::endl;
264 for (
int n = 0 ;
n < nev ;
n++)
267 evals[
n].weights[
t] = evals_t[
n];
269 multi1d<Complex> temp;
272 if (temp.size() != ndim )
274 QDPIO::cerr <<
"Invalid array size" << std::endl;
279 write(final_record_xml,
"elem", curr_record_xml);
283 for(
int n=0;
n < nev;
n++) {
284 QDPIO::cout <<
"Inserting eval/evec pair " <<
n << std::endl;
288 eigen->insert(
n,pair);
291 pop(final_record_xml);
292 pop(final_record_xml);
299 QDPIO::cout <<
"Object successfully read: time= "
300 << swatch.getTimeInSeconds()
301 <<
" secs" << std::endl;
303 catch( std::bad_cast )
305 QDPIO::cerr <<
name <<
": cast error" << std::endl;
310 QDPIO::cerr <<
name <<
": error message: " << e << std::endl;
314 QDPIO::cout <<
name <<
": ran successfully" << std::endl;
Inline measurement factory.
Primary include file for CHROMA library code.
Class for counted reference semantics.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the writing.
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.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
Inline task to read an object from a named buffer.
Named object function std::map.
static bool registered
Local registration flag.
const std::string name
Name to be used.
void unserialize(LatticeColorVector &cvec, const multi1d< Complex > &vec, const int &t)
multi1d< int > coords(const int x, const int y, const int z, const int t)
bool registerAll()
Register all the factories.
bool registerAll()
aggregate everything
Asqtad Staggered-Dirac operator.
push(xml_out,"Condensates")
SubsetVectorWeight_t eigenValue
struct Chroma::InlineEigenBinLimeColVecReadNamedObjEnv::Params::File_t file
struct Chroma::InlineEigenBinLimeColVecReadNamedObjEnv::Params::NamedObject_t named_obj
Holds of vectors and weights.