11 int main(
int argc,
char **argv)
17 XMLReader xml_in(
"input.xml");
20 multi1d<int> nrow(
Nd);
21 read(xml_in,
"/param/nrow", nrow);
26 Layout::setLattSize(nrow);
29 XMLFileWriter xml(
"t_lwldslash.xml");
31 push(xml,
"t_lwldslash");
36 multi1d<LatticeColorMatrix>
u(
Nd);
37 for(
int m=0;
m <
u.size(); ++
m)
42 LatticeFermion
psi,
chi, chi2;
47 QDPIO::cout <<
"Constructing naive QDPWilsonDslash" << std::endl;
50 multi1d<LatticeColorMatrix>,
52 multi1d<LatticeColorMatrix>,
53 multi1d<LatticeColorMatrix> >(
u));
58 QDPIO::cout <<
"Done" << std::endl;
61 push(xml,
"Unoptimized_test");
66 for(
cb = 0;
cb < 2; ++
cb) {
68 QDP::StopWatch swatch;
73 for(iter=1; ; iter <<= 1)
75 QDPIO::cout <<
"Applying D " << iter <<
" times" << std::endl;
79 for(
int i=iter;
i-- > 0; ) {
83 mydt=swatch.getTimeInSeconds();
85 QDPInternal::globalSum(mydt);
86 mydt /= Layout::numNodes();
95 QDPIO::cout <<
"Applying D for timings" << std::endl;
99 for(
int i=iter;
i-- > 0; ) {
104 mydt=swatch.getTimeInSeconds();
105 mydt=1.0e6*mydt/double(iter*(Layout::sitesOnNode()/2));
106 QDPInternal::globalSum(mydt);
107 mydt /= Layout::numNodes();
109 float mflops = float(1320.0f/mydt);
110 QDPIO::cout <<
"cb = " <<
cb <<
" isign = " <<
isign << std::endl;
111 QDPIO::cout <<
"The time per lattice point is "<< mydt
112 <<
" micro sec (" << mflops <<
") Mflops " << std::endl;
117 write(xml,
"mflops",mflops);
125 QDPIO::cout <<
"Constructing (possibly optimized) WilsonDslash" << std::endl;
129 QDPIO::cout <<
"Done" << std::endl;
131 push(xml,
"Optimized_test");
135 for(
cb = 0;
cb < 2; ++
cb) {
138 QDP::StopWatch swatch;
142 for(iter=1; ; iter <<= 1)
144 QDPIO::cout <<
"Applying D " << iter <<
" times" << std::endl;
149 for(
int i=iter;
i-- > 0; ) {
155 mydt=swatch.getTimeInSeconds();
156 QDPInternal::globalSum(mydt);
157 mydt /= Layout::numNodes();
166 QDPIO::cout <<
"Applying D for timings" << std::endl;
170 for(
int i=iter;
i-- > 0; ) {
174 mydt=swatch.getTimeInSeconds();
175 mydt=1.0e6*mydt/double(iter*(Layout::sitesOnNode()/2));
176 QDPInternal::globalSum(mydt);
177 mydt /= Layout::numNodes();
179 float mflops = float(1320.0f/mydt);
180 QDPIO::cout <<
"cb = " <<
cb <<
" isign = " <<
isign << std::endl;
181 QDPIO::cout <<
"After " << iter <<
" calls, the time per lattice point is "<< mydt
182 <<
" micro sec (" << mflops <<
") Mflops " << std::endl;
187 write(xml,
"mflops",mflops);
199 for(
cb = 0;
cb < 2;
cb++) {
207 n2 = norm2( chi2 -
chi );
209 QDPIO::cout <<
"Paranoia test: || D(psi, "
210 << (
isign > 0 ?
"+, " :
"-, ") <<
cb
212 << (
isign > 0 ?
"+, " :
"-, ") <<
cb <<
" ) || = " << n2
219 for(
cb = 0;
cb < 2;
cb++) {
227 n2 = norm2( chi2 -
chi );
229 QDPIO::cout <<
"OPT test: || D(psi, "
230 << (
isign > 0 ?
"+, " :
"-, ") <<
cb
232 << (
isign > 0 ?
"+, " :
"-, ") <<
cb <<
" ) || = " << n2
235 push(xml,
"OPT test");
238 write(xml,
"norm2_diff",n2);
Primary include file for CHROMA in application codes.
Support class for fermion actions and linear operators.
Class for counted reference semantics.
Periodic version of FermState.
General Wilson-Dirac dslash.
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 apply(T &chi, const T &psi, enum PlusMinus isign, int cb) const
General Wilson-Dirac dslash.
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.
multi1d< LatticeFermion > chi(Ncb)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
FloatingPoint< double > Double
int main(int argc, char **argv)