1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

Upgrade of the Britney test with flight recorder and fast xor checksum

This commit is contained in:
Peter Boyle 2024-03-22 15:39:27 +00:00
parent 6f59fed563
commit e49e95b037

View File

@ -285,13 +285,25 @@ inline ComplexD rankInnerProduct(const Lattice<vobj> &left,const Lattice<vobj> &
template<class vobj> template<class vobj>
inline ComplexD innerProduct(const Lattice<vobj> &left,const Lattice<vobj> &right) { inline ComplexD innerProduct(const Lattice<vobj> &left,const Lattice<vobj> &right) {
GridBase *grid = left.Grid(); GridBase *grid = left.Grid();
uint32_t csum=0;
// Uint32Checksum(left,csum); #ifdef GRID_SYCL
uint64_t csum=0;
if ( FlightRecorder::LoggingMode != FlightRecorder::LoggingModeNone)
{
// Hack
// Fast integer xor checksum. Can also be used in comms now.
autoView(l_v,left,AcceleratorRead);
Integer words = left.Grid()->oSites()*sizeof(vobj)/sizeof(uint64_t);
uint64_t *base= (uint64_t *)&l_v[0];
csum=svm_xor(base,words);
}
FlightRecorder::CsumLog(csum);
#endif
ComplexD nrm = rankInnerProduct(left,right); ComplexD nrm = rankInnerProduct(left,right);
RealD local = real(nrm); RealD local = real(nrm);
GridNormLog(real(nrm),csum); // Could log before and after global sum to distinguish local and MPI FlightRecorder::NormLog(real(nrm));
grid->GlobalSum(nrm); grid->GlobalSum(nrm);
GridMPINormLog(local,real(nrm)); FlightRecorder::ReductionLog(local,real(nrm));
return nrm; return nrm;
} }