27 int main(
int argc,
char **argv)
40 read(
reader,
"/t_invert/params/gauge_start_type", stype);
43 QDPIO::cerr <<
"Error : " << error << std::endl;
48 if( stype ==
"HOT_START" ) {
51 else if( stype ==
"COLD_START" ) {
55 QDPIO::cout <<
"Gauge start type " ;
56 switch (
params.gauge_start_type) {
58 QDPIO::cout <<
"hot start" << std::endl;
61 QDPIO::cout <<
"cold start" << std::endl;
64 QDPIO::cout << std::endl;
65 QDPIO::cerr <<
"Unknown gauge start type " << std::endl;
76 const multi1d<int>& msize = Layout::logicalSize();
77 Layout::setLattSize(
params.nrow);
86 write(xml,
"gauge_start_type", stype);
93 multi1d<LatticeColorMatrix>
u(
Nd);
97 for(
int j = 0;
j <
Nd;
j++) {
103 for(
int j=0;
j <
Nd;
j++) {
109 std::ostringstream startup_error;
110 startup_error <<
"Unknown start type " <<
params.gauge_start_type <<std::endl;
111 throw startup_error.str();
138 LatticeFermion bchi,bpsi;
144 for(iter =1; ; iter <<= 1) {
146 QDPIO::cout <<
"Applying PrecWilsonLinOp " <<iter <<
" times" << std::endl;
149 for(
j=0 ;
j < iter;
j++) {
150 (*D_op)(bchi,bpsi,
PLUS);
153 mydt = swatch.getTimeInSeconds();
154 QDPInternal::globalSum(mydt);
155 mydt /=
Double(Layout::numNodes());
157 if( toBool(mydt >
Double(1)) )
break;
169 Double linop_flops_in_mflops = flops_cpu_iter / mydt;
171 QDPIO::cout <<
"PrecWilsonOp perf: " << linop_flops_in_mflops <<
" Mflop/s/node" << std::endl;
172 push(xml,
"TimeLinOp");
173 write(xml,
"time", mydt);
174 write(xml,
"mflops", linop_flops_in_mflops);
177 for(iter=1; ; iter <<= 1)
180 QDPIO::cout <<
"Let 0 action inverter iterate "<< iter <<
" times" << std::endl;
186 InvCG2_timing_hacks(*D_op,
195 mydt=
Double(swatch.getTimeInSeconds());
196 QDPInternal::globalSum(mydt);
197 mydt /=
Double(Layout::numNodes());
199 QDPIO::cout <<
"Time was " << mydt <<
" seconds" << std::endl;
201 if ( toBool(mydt >
Double(1) ) )
208 int N_mpsi = 3*24 + 2*N_dslash;
209 int Nflops_c = (24 + 2*N_mpsi) + (48);
210 int Nflops_s = (2*N_mpsi + (2*48+2*24));
213 multi1d<Double> mflops(10);
214 multi1d<Double> mydt_a(10);
216 for (
j=0;
j < 10; ++
j)
223 InvCG2_timing_hacks(*D_op,
231 mydt=
Double(swatch.getTimeInSeconds());
233 QDPInternal::globalSum(mydt);
235 mydt /=
Double(Layout::numNodes());
241 mflops[
j] = Nflops / mydt_a[
j];
244 mydt=1.0e6f*mydt/((
Double)(Layout::sitesOnNode())/
Double(2));
246 push(xml,
"TimeCG2");
247 write(xml,
"iter", iter);
248 write(xml,
"N_dslash", N_dslash);
249 write(xml,
"N_mpsi", N_mpsi);
250 write(xml,
"Nflops", Nflops);
251 write(xml,
"mydt_a", mydt_a);
252 write(xml,
"mflops_a", mflops);
Primary include file for CHROMA in application codes.
Even-odd preconditioned Wilson fermion action.
EvenOddPrecConstDetLinearOperator< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
Even-odd preconditioned Wilson-Dirac operator.
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.
Concrete class for all gauge actions with simple boundary conditions.
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.
Conjugate-Gradient algorithm for a generic Linear Operator.
Handle< FermBC< LatticeStaggeredFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the FermionAction readers.
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)
void reunit(LatticeColorMatrixF3 &xa)
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.
FloatingPoint< double > Double
GaugeStartType gauge_start_type
int main(int argc, char **argv)