From bf60764e4b1cc7b0cb926a15f82994248adb6850 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Tue, 5 May 2015 18:08:53 +0100 Subject: [PATCH] Updated bandwidth test --- benchmarks/Grid_memory_bandwidth.cc | 95 +++++++++++++++-------------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/benchmarks/Grid_memory_bandwidth.cc b/benchmarks/Grid_memory_bandwidth.cc index e4e81445..dc25fe51 100644 --- a/benchmarks/Grid_memory_bandwidth.cc +++ b/benchmarks/Grid_memory_bandwidth.cc @@ -14,26 +14,26 @@ int main (int argc, char ** argv) const int Nvec=8; typedef Lattice< iVector< vReal,Nvec> > LatticeVec; - int Nloop=100; + int Nloop=1000; std::cout << "===================================================================================================="< latt_size ({lat,lat,lat,lat}); GridCartesian Grid(latt_size,simd_layout,mpi_layout); - GridParallelRNG pRNG(&Grid); pRNG.SeedRandomDevice(); + //GridParallelRNG pRNG(&Grid); pRNG.SeedRandomDevice(); - LatticeVec z(&Grid); random(pRNG,z); - LatticeVec x(&Grid); random(pRNG,x); - LatticeVec y(&Grid); random(pRNG,y); - double a=1.0; + LatticeVec z(&Grid); //random(pRNG,z); + LatticeVec x(&Grid); //random(pRNG,x); + LatticeVec y(&Grid); //random(pRNG,y); + double a=2.0; double start=usecond(); @@ -43,31 +43,32 @@ int main (int argc, char ** argv) axpy(z,a,x,y); } double stop=usecond(); - double time = stop-start; + double time = (stop-start)/Nloop/1000; - double bytes=3*lat*lat*lat*lat*Nvec*sizeof(Real)*Nloop; - std::cout << lat<<"\t\t"< latt_size ({lat,lat,lat,lat}); GridCartesian Grid(latt_size,simd_layout,mpi_layout); - GridParallelRNG pRNG(&Grid); pRNG.SeedRandomDevice(); + //GridParallelRNG pRNG(&Grid); pRNG.SeedRandomDevice(); - LatticeVec z(&Grid); random(pRNG,z); - LatticeVec x(&Grid); random(pRNG,x); - LatticeVec y(&Grid); random(pRNG,y); - double a=1.0; + LatticeVec z(&Grid); //random(pRNG,z); + LatticeVec x(&Grid); //random(pRNG,x); + LatticeVec y(&Grid); //random(pRNG,y); + double a=2.0; double start=usecond(); @@ -75,63 +76,63 @@ int main (int argc, char ** argv) z=a*x+y; } double stop=usecond(); - double time = stop-start; + double time = (stop-start)/Nloop/1000; - double bytes=3*lat*lat*lat*lat*Nvec*sizeof(Real)*Nloop; - std::cout << lat<<"\t\t"< latt_size ({lat,lat,lat,lat}); GridCartesian Grid(latt_size,simd_layout,mpi_layout); - GridParallelRNG pRNG(&Grid); pRNG.SeedRandomDevice(); + //GridParallelRNG pRNG(&Grid); pRNG.SeedRandomDevice(); - LatticeVec z(&Grid); random(pRNG,z); - LatticeVec x(&Grid); random(pRNG,x); - LatticeVec y(&Grid); random(pRNG,y); - RealD a=1.0; + LatticeVec z(&Grid); //random(pRNG,z); + LatticeVec x(&Grid); //random(pRNG,x); + LatticeVec y(&Grid); //random(pRNG,y); + RealD a=2.0; double start=usecond(); for(int i=0;i latt_size ({lat,lat,lat,lat}); GridCartesian Grid(latt_size,simd_layout,mpi_layout); - GridParallelRNG pRNG(&Grid); pRNG.SeedRandomDevice(); + //GridParallelRNG pRNG(&Grid); pRNG.SeedRandomDevice(); - LatticeVec z(&Grid); random(pRNG,z); - LatticeVec x(&Grid); random(pRNG,x); - LatticeVec y(&Grid); random(pRNG,y); - RealD a=1.0; + LatticeVec z(&Grid); //random(pRNG,z); + LatticeVec x(&Grid); //random(pRNG,x); + LatticeVec y(&Grid); //random(pRNG,y); + RealD a=2.0; ComplexD nn; double start=usecond(); @@ -139,10 +140,10 @@ int main (int argc, char ** argv) nn=norm2(x); } double stop=usecond(); - double time = stop-start; + double time = (stop-start)/Nloop/1000; - double bytes=lat*lat*lat*lat*Nvec*sizeof(Real)*Nloop; - std::cout << lat<<"\t\t"<