From 54f19990308e284d007f901e6d926ee87abb45cc Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Fri, 11 Oct 2024 03:22:18 +0000 Subject: [PATCH] axpy_norm_fast -- wasn't using the determinstic MPI sum causing issues --- Grid/lattice/Lattice_reduction.h | 38 +++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/Grid/lattice/Lattice_reduction.h b/Grid/lattice/Lattice_reduction.h index 0bd1098e..dffcae92 100644 --- a/Grid/lattice/Lattice_reduction.h +++ b/Grid/lattice/Lattice_reduction.h @@ -375,8 +375,44 @@ axpby_norm_fast(Lattice &z,sobj a,sobj b,const Lattice &x,const Latt coalescedWrite(inner_tmp_v[ss],innerProduct(tmp,tmp)); coalescedWrite(z_v[ss],tmp); }); + bool ok; + uint64_t csum=0; + uint64_t csum2=0; +#ifdef GRID_SYCL + if ( FlightRecorder::LoggingMode != FlightRecorder::LoggingModeNone) + { + // z_v + { + Integer words = sites*sizeof(vobj)/sizeof(uint64_t); + uint64_t *base= (uint64_t *)&z_v[0]; + csum=svm_xor(base,words); + ok = FlightRecorder::CsumLog(csum); + if ( !ok ) { + csum2=svm_xor(base,words); + std::cerr<< " Bad z_v CSUM " << std::hex<< csum << " recomputed as "<GlobalSum(nrm); + ok = FlightRecorder::NormLog(real(nrm)); + assert(ok); + RealD local = real(nrm); + grid->GlobalSumP2P(nrm); + FlightRecorder::ReductionLog(local,real(nrm)); return nrm; }