mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-04 03:05:55 +01:00
Better timing
This commit is contained in:
parent
b99453083d
commit
9b20f1449c
@ -95,26 +95,34 @@ int main (int argc, char ** argv)
|
|||||||
std::cout << GridLogMessage << "::::::::::::: Starting mixed CG" << std::endl;
|
std::cout << GridLogMessage << "::::::::::::: Starting mixed CG" << std::endl;
|
||||||
MixedPrecisionConjugateGradient<LatticeFermionD,LatticeFermionF> mCG(1.0e-8, 10000, 50, FrbGrid_f, HermOpEO_f, HermOpEO);
|
MixedPrecisionConjugateGradient<LatticeFermionD,LatticeFermionF> mCG(1.0e-8, 10000, 50, FrbGrid_f, HermOpEO_f, HermOpEO);
|
||||||
double t1,t2,flops;
|
double t1,t2,flops;
|
||||||
|
double MdagMsiteflops = 1452; // Mobius (real coeffs)
|
||||||
|
// CG overhead: 8 inner product, 4+8 axpy_norm, 4+4 linear comb (2 of)
|
||||||
|
double CGsiteflops = (8+4+8+4+4)*Nc*Ns ;
|
||||||
|
std:: cout << " MdagM site flops = "<< 4*MdagMsiteflops<<std::endl;
|
||||||
|
std:: cout << " CG site flops = "<< CGsiteflops <<std::endl;
|
||||||
int iters;
|
int iters;
|
||||||
for(int i=0;i<100;i++){
|
for(int i=0;i<200;i++){
|
||||||
result_o = Zero();
|
result_o = Zero();
|
||||||
t1=usecond();
|
t1=usecond();
|
||||||
mCG(src_o,result_o);
|
mCG(src_o,result_o);
|
||||||
t2=usecond();
|
t2=usecond();
|
||||||
iters = mCG.TotalInnerIterations; //Number of inner CG iterations
|
iters = mCG.TotalInnerIterations; //Number of inner CG iterations
|
||||||
flops = 1320.0*2*FGrid->gSites()*iters;
|
flops = MdagMsiteflops*4*FrbGrid->gSites()*iters;
|
||||||
|
flops+= CGsiteflops*FrbGrid->gSites()*iters;
|
||||||
std::cout << " SinglePrecision iterations/sec "<< iters/(t2-t1)*1000.*1000.<<std::endl;
|
std::cout << " SinglePrecision iterations/sec "<< iters/(t2-t1)*1000.*1000.<<std::endl;
|
||||||
std::cout << " SinglePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
|
std::cout << " SinglePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
|
||||||
}
|
}
|
||||||
std::cout << GridLogMessage << "::::::::::::: Starting regular CG" << std::endl;
|
std::cout << GridLogMessage << "::::::::::::: Starting regular CG" << std::endl;
|
||||||
ConjugateGradient<LatticeFermionD> CG(1.0e-8,10000);
|
ConjugateGradient<LatticeFermionD> CG(1.0e-8,10000);
|
||||||
for(int i=0;i<100;i++){
|
for(int i=0;i<1;i++){
|
||||||
result_o_2 = Zero();
|
result_o_2 = Zero();
|
||||||
t1=usecond();
|
t1=usecond();
|
||||||
CG(HermOpEO,src_o,result_o_2);
|
CG(HermOpEO,src_o,result_o_2);
|
||||||
t2=usecond();
|
t2=usecond();
|
||||||
iters = CG.IterationsToComplete;
|
iters = CG.IterationsToComplete;
|
||||||
flops = 1320.0*2*FGrid->gSites()*iters;
|
flops = MdagMsiteflops*4*FrbGrid->gSites()*iters;
|
||||||
|
flops+= CGsiteflops*FrbGrid->gSites()*iters;
|
||||||
|
|
||||||
std::cout << " DoublePrecision iterations/sec "<< iters/(t2-t1)*1000.*1000.<<std::endl;
|
std::cout << " DoublePrecision iterations/sec "<< iters/(t2-t1)*1000.*1000.<<std::endl;
|
||||||
std::cout << " DoublePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
|
std::cout << " DoublePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user