diff --git a/Grid/lattice/Lattice_transfer.h b/Grid/lattice/Lattice_transfer.h index 5a26cce9..1a17220f 100644 --- a/Grid/lattice/Lattice_transfer.h +++ b/Grid/lattice/Lattice_transfer.h @@ -49,10 +49,15 @@ inline void subdivides(GridBase *coarse,GridBase *fine) //////////////////////////////////////////////////////////////////////////////////////////// template inline void pickCheckerboard(int cb,Lattice &half,const Lattice &full) { + static double time_autoview = 0; + static double time_loop = 0; half.Checkerboard() = cb; - + + double start = usecond(); autoView( half_v, half, CpuWrite); autoView( full_v, full, CpuRead); + time_autoview += usecond()-start; + start = usecond(); thread_for(ss, full.Grid()->oSites(),{ int cbos; Coordinate coor; @@ -64,12 +69,24 @@ template inline void pickCheckerboard(int cb,Lattice &half,con half_v[ssh] = full_v[ss]; } }); + + time_loop += usecond()-start; + std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl; + std::cout << "pickCheckerboard" << std::endl; + std::cout << "AutoView cumulative time (s) = " << time_autoview/1000000. << "(" << 100*time_autoview/(time_autoview+time_loop) << "% of pickCheckerboard)" << std::endl; + std::cout << "Loop cumulative time (s) = " << time_loop/1000000. << "(" << 100*time_loop/(time_autoview+time_loop) << "% of pickCheckerboard)" << std::endl; } template inline void setCheckerboard(Lattice &full,const Lattice &half) { + static double time_autoview = 0; + static double time_loop = 0; int cb = half.Checkerboard(); + + double start = usecond(); autoView( half_v , half, CpuRead); autoView( full_v , full, CpuWrite); + time_autoview += usecond()-start; + start = usecond(); thread_for(ss,full.Grid()->oSites(),{ Coordinate coor; @@ -83,6 +100,13 @@ template inline void setCheckerboard(Lattice &full,const Latti full_v[ss]=half_v[ssh]; } }); + + time_loop += usecond()-start; + std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl; + std::cout << "setCheckerboard" << std::endl; + std::cout << "AutoView cumulative time (s) = " << time_autoview/1000000. << "(" << 100*time_autoview/(time_autoview+time_loop) << "% of setCheckerboard)" << std::endl; + std::cout << "Loop cumulative time (s) = " << time_loop/1000000. << "(" << 100*time_loop/(time_autoview+time_loop) << "% of setCheckerboard)" << std::endl; + } ////////////////////////////////////////////////////////////////////////////////////////////