1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-19 16:55:37 +01:00

Broadcast time info

This commit is contained in:
Peter Boyle 2024-06-11 15:16:25 -04:00
parent ed20b39ab3
commit b5926c1d21

View File

@ -142,7 +142,9 @@ int main (int argc, char ** argv)
std:: cout << " CG site flops = "<< CGsiteflops <<std::endl; std:: cout << " CG site flops = "<< CGsiteflops <<std::endl;
int iters; int iters;
time_t now;
time_t start = time(NULL); time_t start = time(NULL);
UGrid->Broadcast(0,(void *)&start,sizeof(start));
FlightRecorder::ContinueOnFail = 0; FlightRecorder::ContinueOnFail = 0;
FlightRecorder::PrintEntireLog = 0; FlightRecorder::PrintEntireLog = 0;
@ -162,9 +164,9 @@ int main (int argc, char ** argv)
} }
std::cerr << "******************* SINGLE PRECISION SOLVE "<<iter<<std::endl; std::cerr << "******************* SINGLE PRECISION SOLVE "<<iter<<std::endl;
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 = MdagMsiteflops*4*FrbGrid->gSites()*iters; flops = MdagMsiteflops*4*FrbGrid->gSites()*iters;
flops+= CGsiteflops*FrbGrid->gSites()*iters; flops+= CGsiteflops*FrbGrid->gSites()*iters;
@ -176,7 +178,8 @@ int main (int argc, char ** argv)
std::cout << " FlightRecorder is OK! "<<std::endl; std::cout << " FlightRecorder is OK! "<<std::endl;
iter ++; iter ++;
} while (time(NULL) < (start + nsecs/10) ); now = time(NULL); UGrid->Broadcast(0,(void *)&now,sizeof(now));
} while (now < (start + nsecs/10) );
std::cout << GridLogMessage << "::::::::::::: Starting double precision CG" << std::endl; std::cout << GridLogMessage << "::::::::::::: Starting double precision CG" << std::endl;
ConjugateGradient<LatticeFermionD> CG(1.0e-8,10000); ConjugateGradient<LatticeFermionD> CG(1.0e-8,10000);
@ -189,7 +192,7 @@ int main (int argc, char ** argv)
} }
std::cerr << "******************* DOUBLE PRECISION SOLVE "<<i<<std::endl; std::cerr << "******************* DOUBLE PRECISION SOLVE "<<i<<std::endl;
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;
@ -201,8 +204,9 @@ int main (int argc, char ** argv)
std::cout << " DoublePrecision error count "<< FlightRecorder::ErrorCount()<<std::endl; std::cout << " DoublePrecision error count "<< FlightRecorder::ErrorCount()<<std::endl;
assert(FlightRecorder::ErrorCount()==0); assert(FlightRecorder::ErrorCount()==0);
std::cout << " FlightRecorder is OK! "<<std::endl; std::cout << " FlightRecorder is OK! "<<std::endl;
now = time(NULL); UGrid->Broadcast(0,(void *)&now,sizeof(now));
i++; i++;
} while (time(NULL) < (start + nsecs) ); } while (now < (start + nsecs) );
LatticeFermionD diff_o(FrbGrid); LatticeFermionD diff_o(FrbGrid);
RealD diff = axpy_norm(diff_o, -1.0, result_o, result_o_2); RealD diff = axpy_norm(diff_o, -1.0, result_o, result_o_2);