mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-03 02:35:55 +01:00
Improved formating of timing output in mixed-prec multishift
In test of mixed-prec multishift, added comparison against full double precision multishift both for timing and to cross-check the results
This commit is contained in:
parent
7a06826cf1
commit
d161c2dc35
@ -386,12 +386,13 @@ public:
|
||||
}
|
||||
|
||||
std::cout << GridLogMessage << "ConjugateGradientMultiShiftMixedPrec: Time Breakdown for body"<<std::endl;
|
||||
std::cout << GridLogMessage << "\tElapsed " << SolverTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\tAXPY " << AXPYTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\tMatrix " << MatrixTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\tShift " << ShiftTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\tPrecision Change " << PrecChangeTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\tSolver " << SolverTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\t\tAXPY " << AXPYTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\t\tMatrix " << MatrixTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\t\tShift " << ShiftTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\t\tPrecision Change " << PrecChangeTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\tFinal Cleanup " << CleanupTimer.Elapsed() <<std::endl;
|
||||
std::cout << GridLogMessage << "\tSolver+Cleanup " << SolverTimer.Elapsed() + CleanupTimer.Elapsed() << std::endl;
|
||||
|
||||
IterationsToComplete = k;
|
||||
|
||||
|
@ -127,7 +127,21 @@ void run_test(int argc, char ** argv, const typename SpeciesD::ImplParams ¶m
|
||||
mcg(HermOpEO_d, src_o_d, results_o_d);
|
||||
double t2=usecond();
|
||||
|
||||
std::cout<<GridLogMessage << "Test: Total usec = "<< (t2-t1)<<std::endl;
|
||||
//Crosscheck double and mixed prec results
|
||||
ConjugateGradientMultiShift<FermionFieldD> dmcg(10000, shifts);
|
||||
std::vector<FermionFieldD> results_o_d_2(order, FrbGrid_d);
|
||||
dmcg(HermOpEO_d, src_o_d, results_o_d_2);
|
||||
double t3=usecond();
|
||||
|
||||
std::cout << GridLogMessage << "Comparison of mixed prec results to double prec results |mixed - double|^2 :" << std::endl;
|
||||
FermionFieldD tmp(FrbGrid_d);
|
||||
for(int i=0;i<order;i++){
|
||||
RealD ndiff = axpy_norm(tmp, -1., results_o_d[i], results_o_d_2[i]);
|
||||
std::cout << i << " " << ndiff << std::endl;
|
||||
}
|
||||
|
||||
std::cout<<GridLogMessage << "Mixed precision algorithm: Total usec = "<< (t2-t1)<<std::endl;
|
||||
std::cout<<GridLogMessage << "Double precision algorithm: Total usec = "<< (t3-t2)<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user