diff --git a/.travis.yml b/.travis.yml index 129fd582..3a0e1e35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,6 @@ matrix: - os: osx osx_image: xcode8.3 compiler: clang - env: PREC=single - - os: osx - osx_image: xcode8.3 - compiler: clang - env: PREC=double before_install: - export GRIDDIR=`pwd` @@ -55,7 +50,7 @@ script: - make -j4 - make install - cd $CWD/build - - ../configure --enable-precision=$PREC --enable-simd=SSE4 --enable-comms=none --with-lime=$CWD/build/lime/install ${EXTRACONF} + - ../configure --enable-simd=SSE4 --enable-comms=none --with-lime=$CWD/build/lime/install ${EXTRACONF} - make -j4 - ./benchmarks/Benchmark_dwf --threads 1 --debug-signals - make check diff --git a/Grid/GridStd.h b/Grid/GridStd.h index ecb561ea..28f6bc46 100644 --- a/Grid/GridStd.h +++ b/Grid/GridStd.h @@ -28,4 +28,7 @@ /////////////////// #include "Config.h" +#ifdef TOFU +#undef GRID_COMMS_THREADS +#endif #endif /* GRID_STD_H */ diff --git a/Grid/allocator/AlignedAllocator.h b/Grid/allocator/AlignedAllocator.h index 249732fb..4b357523 100644 --- a/Grid/allocator/AlignedAllocator.h +++ b/Grid/allocator/AlignedAllocator.h @@ -165,9 +165,17 @@ template inline bool operator!=(const devAllocator<_Tp>&, const d //////////////////////////////////////////////////////////////////////////////// // Template typedefs //////////////////////////////////////////////////////////////////////////////// -//template using commAllocator = devAllocator; +#ifdef ACCELERATOR_CSHIFT +// Cshift on device +template using cshiftAllocator = devAllocator; +#else +// Cshift on host +template using cshiftAllocator = std::allocator; +#endif + template using Vector = std::vector >; template using commVector = std::vector >; +template using cshiftVector = std::vector >; NAMESPACE_END(Grid); diff --git a/Grid/allocator/MemoryManagerShared.cc b/Grid/allocator/MemoryManagerShared.cc index 537f7c32..3f165007 100644 --- a/Grid/allocator/MemoryManagerShared.cc +++ b/Grid/allocator/MemoryManagerShared.cc @@ -1,7 +1,6 @@ #include #ifdef GRID_UVM -#warning "Grid is assuming unified virtual memory address space" NAMESPACE_BEGIN(Grid); ///////////////////////////////////////////////////////////////////////////////// // View management is 1:1 address space mapping diff --git a/Grid/communicator/Communicator_mpi3.cc b/Grid/communicator/Communicator_mpi3.cc index 83f71233..c6543851 100644 --- a/Grid/communicator/Communicator_mpi3.cc +++ b/Grid/communicator/Communicator_mpi3.cc @@ -44,7 +44,7 @@ void CartesianCommunicator::Init(int *argc, char ***argv) MPI_Initialized(&flag); // needed to coexist with other libs apparently if ( !flag ) { -#if defined (TOFU) // FUGAKU, credits go to Issaku Kanamori +#ifndef GRID_COMMS_THREADS nCommThreads=1; // wrong results here too // For now: comms-overlap leads to wrong results in Benchmark_wilson even on single node MPI runs @@ -358,16 +358,19 @@ double CartesianCommunicator::StencilSendToRecvFromBegin(std::vector ranks(size); for(int r=0;r > Cshift_table; // Gather for when there is no need to SIMD split /////////////////////////////////////////////////////////////////// template void -Gather_plane_simple (const Lattice &rhs,commVector &buffer,int dimension,int plane,int cbmask, int off=0) +Gather_plane_simple (const Lattice &rhs,cshiftVector &buffer,int dimension,int plane,int cbmask, int off=0) { int rd = rhs.Grid()->_rdimensions[dimension]; @@ -73,12 +73,19 @@ Gather_plane_simple (const Lattice &rhs,commVector &buffer,int dimen } } { - autoView(rhs_v , rhs, AcceleratorRead); auto buffer_p = & buffer[0]; auto table = &Cshift_table[0]; +#ifdef ACCELERATOR_CSHIFT + autoView(rhs_v , rhs, AcceleratorRead); accelerator_for(i,ent,vobj::Nsimd(),{ coalescedWrite(buffer_p[table[i].first],coalescedRead(rhs_v[table[i].second])); }); +#else + autoView(rhs_v , rhs, CpuRead); + thread_for(i,ent,{ + buffer_p[table[i].first]=rhs_v[table[i].second]; + }); +#endif } } @@ -103,6 +110,7 @@ Gather_plane_extract(const Lattice &rhs, int n1=rhs.Grid()->_slice_stride[dimension]; if ( cbmask ==0x3){ +#ifdef ACCELERATOR_CSHIFT autoView(rhs_v , rhs, AcceleratorRead); accelerator_for2d(n,e1,b,e2,1,{ int o = n*n1; @@ -111,12 +119,22 @@ Gather_plane_extract(const Lattice &rhs, vobj temp =rhs_v[so+o+b]; extract(temp,pointers,offset); }); +#else + autoView(rhs_v , rhs, CpuRead); + thread_for2d(n,e1,b,e2,{ + int o = n*n1; + int offset = b+n*e2; + + vobj temp =rhs_v[so+o+b]; + extract(temp,pointers,offset); + }); +#endif } else { - autoView(rhs_v , rhs, AcceleratorRead); - Coordinate rdim=rhs.Grid()->_rdimensions; Coordinate cdm =rhs.Grid()->_checker_dim_mask; std::cout << " Dense packed buffer WARNING " < &rhs, extract(temp,pointers,offset); } }); +#else + autoView(rhs_v , rhs, CpuRead); + thread_for2d(n,e1,b,e2,{ + + Coordinate coor; + + int o=n*n1; + int oindex = o+b; + + int cb = RedBlackCheckerBoardFromOindex(oindex, rdim, cdm); + + int ocb=1<(temp,pointers,offset); + } + }); +#endif } } ////////////////////////////////////////////////////// // Scatter for when there is no need to SIMD split ////////////////////////////////////////////////////// -template void Scatter_plane_simple (Lattice &rhs,commVector &buffer, int dimension,int plane,int cbmask) +template void Scatter_plane_simple (Lattice &rhs,cshiftVector &buffer, int dimension,int plane,int cbmask) { int rd = rhs.Grid()->_rdimensions[dimension]; @@ -182,12 +220,19 @@ template void Scatter_plane_simple (Lattice &rhs,commVector void Scatter_plane_merge(Lattice &rhs,ExtractPointerA int e2=rhs.Grid()->_slice_block[dimension]; if(cbmask ==0x3 ) { - autoView( rhs_v , rhs, AcceleratorWrite); int _slice_stride = rhs.Grid()->_slice_stride[dimension]; int _slice_block = rhs.Grid()->_slice_block[dimension]; +#ifdef ACCELERATOR_CSHIFT + autoView( rhs_v , rhs, AcceleratorWrite); accelerator_for2d(n,e1,b,e2,1,{ int o = n*_slice_stride; int offset = b+n*_slice_block; merge(rhs_v[so+o+b],pointers,offset); }); +#else + autoView( rhs_v , rhs, CpuWrite); + thread_for2d(n,e1,b,e2,{ + int o = n*_slice_stride; + int offset = b+n*_slice_block; + merge(rhs_v[so+o+b],pointers,offset); + }); +#endif } else { // Case of SIMD split AND checker dim cannot currently be hit, except in @@ -280,12 +334,20 @@ template void Copy_plane(Lattice& lhs,const Lattice &rhs } { + auto table = &Cshift_table[0]; +#ifdef ACCELERATOR_CSHIFT autoView(rhs_v , rhs, AcceleratorRead); autoView(lhs_v , lhs, AcceleratorWrite); - auto table = &Cshift_table[0]; accelerator_for(i,ent,vobj::Nsimd(),{ coalescedWrite(lhs_v[table[i].first],coalescedRead(rhs_v[table[i].second])); }); +#else + autoView(rhs_v , rhs, CpuRead); + autoView(lhs_v , lhs, CpuWrite); + thread_for(i,ent,{ + lhs_v[table[i].first]=rhs_v[table[i].second]; + }); +#endif } } @@ -324,12 +386,20 @@ template void Copy_plane_permute(Lattice& lhs,const Lattice void Cshift_comms_simd(Lattice& ret,const Lattice void Cshift_comms(Lattice &ret,const Lattice &rhs,int dimension,int shift,int cbmask) { typedef typename vobj::vector_type vector_type; @@ -121,9 +122,9 @@ template void Cshift_comms(Lattice &ret,const Lattice &r assert(shift_slice_nblock[dimension]*rhs.Grid()->_slice_block[dimension]; - commVector send_buf(buffer_size); - commVector recv_buf(buffer_size); - + cshiftVector send_buf(buffer_size); + cshiftVector recv_buf(buffer_size); + int cb= (cbmask==0x2)? Odd : Even; int sshift= rhs.Grid()->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,cb); @@ -138,7 +139,7 @@ template void Cshift_comms(Lattice &ret,const Lattice &r } else { - int words = send_buf.size(); + int words = buffer_size; if (cbmask != 0x3) words=words>>1; int bytes = words * sizeof(vobj); @@ -150,12 +151,14 @@ template void Cshift_comms(Lattice &ret,const Lattice &r int xmit_to_rank; grid->ShiftedRanks(dimension,comm_proc,xmit_to_rank,recv_from_rank); + grid->Barrier(); grid->SendToRecvFrom((void *)&send_buf[0], xmit_to_rank, (void *)&recv_buf[0], recv_from_rank, bytes); + grid->Barrier(); Scatter_plane_simple (ret,recv_buf,dimension,x,cbmask); @@ -195,8 +198,15 @@ template void Cshift_comms_simd(Lattice &ret,const Lattice_slice_nblock[dimension]*grid->_slice_block[dimension]; // int words = sizeof(vobj)/sizeof(vector_type); - std::vector > send_buf_extract(Nsimd,commVector(buffer_size) ); - std::vector > recv_buf_extract(Nsimd,commVector(buffer_size) ); + std::vector > send_buf_extract(Nsimd); + std::vector > recv_buf_extract(Nsimd); + scalar_object * recv_buf_extract_mpi; + scalar_object * send_buf_extract_mpi; + + for(int s=0;s void Cshift_comms_simd(Lattice &ret,const LatticeShiftedRanks(dimension,nbr_proc,xmit_to_rank,recv_from_rank); - grid->SendToRecvFrom((void *)&send_buf_extract[nbr_lane][0], + grid->Barrier(); + + send_buf_extract_mpi = &send_buf_extract[nbr_lane][0]; + recv_buf_extract_mpi = &recv_buf_extract[i][0]; + grid->SendToRecvFrom((void *)send_buf_extract_mpi, xmit_to_rank, - (void *)&recv_buf_extract[i][0], + (void *)recv_buf_extract_mpi, recv_from_rank, bytes); + + grid->Barrier(); + + rpointers[i] = &recv_buf_extract[i][0]; + } else { + rpointers[i] = &send_buf_extract[nbr_lane][0]; + } + + } + Scatter_plane_merge(ret,rpointers,dimension,x,cbmask); + } + +} +#else +template void Cshift_comms(Lattice &ret,const Lattice &rhs,int dimension,int shift,int cbmask) +{ + typedef typename vobj::vector_type vector_type; + typedef typename vobj::scalar_type scalar_type; + + GridBase *grid=rhs.Grid(); + Lattice temp(rhs.Grid()); + + int fd = rhs.Grid()->_fdimensions[dimension]; + int rd = rhs.Grid()->_rdimensions[dimension]; + int pd = rhs.Grid()->_processors[dimension]; + int simd_layout = rhs.Grid()->_simd_layout[dimension]; + int comm_dim = rhs.Grid()->_processors[dimension] >1 ; + assert(simd_layout==1); + assert(comm_dim==1); + assert(shift>=0); + assert(shift_slice_nblock[dimension]*rhs.Grid()->_slice_block[dimension]; + cshiftVector send_buf_v(buffer_size); + cshiftVector recv_buf_v(buffer_size); + vobj *send_buf; + vobj *recv_buf; + { + grid->ShmBufferFreeAll(); + size_t bytes = buffer_size*sizeof(vobj); + send_buf=(vobj *)grid->ShmBufferMalloc(bytes); + recv_buf=(vobj *)grid->ShmBufferMalloc(bytes); + } + + int cb= (cbmask==0x2)? Odd : Even; + int sshift= rhs.Grid()->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,cb); + + for(int x=0;x>1; + + int bytes = words * sizeof(vobj); + + Gather_plane_simple (rhs,send_buf_v,dimension,sx,cbmask); + + // int rank = grid->_processor; + int recv_from_rank; + int xmit_to_rank; + grid->ShiftedRanks(dimension,comm_proc,xmit_to_rank,recv_from_rank); + + + grid->Barrier(); + + acceleratorCopyDeviceToDevice((void *)&send_buf_v[0],(void *)&send_buf[0],bytes); + grid->SendToRecvFrom((void *)&send_buf[0], + xmit_to_rank, + (void *)&recv_buf[0], + recv_from_rank, + bytes); + acceleratorCopyDeviceToDevice((void *)&recv_buf[0],(void *)&recv_buf_v[0],bytes); + + grid->Barrier(); + + Scatter_plane_simple (ret,recv_buf_v,dimension,x,cbmask); + } + } +} + +template void Cshift_comms_simd(Lattice &ret,const Lattice &rhs,int dimension,int shift,int cbmask) +{ + GridBase *grid=rhs.Grid(); + const int Nsimd = grid->Nsimd(); + typedef typename vobj::vector_type vector_type; + typedef typename vobj::scalar_object scalar_object; + typedef typename vobj::scalar_type scalar_type; + + int fd = grid->_fdimensions[dimension]; + int rd = grid->_rdimensions[dimension]; + int ld = grid->_ldimensions[dimension]; + int pd = grid->_processors[dimension]; + int simd_layout = grid->_simd_layout[dimension]; + int comm_dim = grid->_processors[dimension] >1 ; + + //std::cout << "Cshift_comms_simd dim "<< dimension << " fd "<=0); + assert(shiftPermuteType(dimension); + + /////////////////////////////////////////////// + // Simd direction uses an extract/merge pair + /////////////////////////////////////////////// + int buffer_size = grid->_slice_nblock[dimension]*grid->_slice_block[dimension]; + // int words = sizeof(vobj)/sizeof(vector_type); + + std::vector > send_buf_extract(Nsimd); + std::vector > recv_buf_extract(Nsimd); + scalar_object * recv_buf_extract_mpi; + scalar_object * send_buf_extract_mpi; + { + size_t bytes = sizeof(scalar_object)*buffer_size; + grid->ShmBufferFreeAll(); + send_buf_extract_mpi = (scalar_object *)grid->ShmBufferMalloc(bytes); + recv_buf_extract_mpi = (scalar_object *)grid->ShmBufferMalloc(bytes); + } + for(int s=0;s pointers(Nsimd); // + ExtractPointerArray rpointers(Nsimd); // received pointers + + /////////////////////////////////////////// + // Work out what to send where + /////////////////////////////////////////// + int cb = (cbmask==0x2)? Odd : Even; + int sshift= grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,cb); + + // loop over outer coord planes orthog to dim + for(int x=0;x>(permute_type+1)); + int ic= (i&inner_bit)? 1:0; + + int my_coor = rd*ic + x; + int nbr_coor = my_coor+sshift; + int nbr_proc = ((nbr_coor)/ld) % pd;// relative shift in processors + + int nbr_ic = (nbr_coor%ld)/rd; // inner coord of peer + int nbr_ox = (nbr_coor%rd); // outer coord of peer + int nbr_lane = (i&(~inner_bit)); + + int recv_from_rank; + int xmit_to_rank; + + if (nbr_ic) nbr_lane|=inner_bit; + + assert (sx == nbr_ox); + + if(nbr_proc){ + grid->ShiftedRanks(dimension,nbr_proc,xmit_to_rank,recv_from_rank); + + grid->Barrier(); + + acceleratorCopyDeviceToDevice((void *)&send_buf_extract[nbr_lane][0],(void *)send_buf_extract_mpi,bytes); + grid->SendToRecvFrom((void *)send_buf_extract_mpi, + xmit_to_rank, + (void *)recv_buf_extract_mpi, + recv_from_rank, + bytes); + acceleratorCopyDeviceToDevice((void *)recv_buf_extract_mpi,(void *)&recv_buf_extract[i][0],bytes); + grid->Barrier(); rpointers[i] = &recv_buf_extract[i][0]; } else { @@ -258,7 +461,7 @@ template void Cshift_comms_simd(Lattice &ret,const Lattice #include #include #include -//#include +#include #include #include #include diff --git a/Grid/lattice/Lattice_ET.h b/Grid/lattice/Lattice_ET.h index c43844f8..4a8a7423 100644 --- a/Grid/lattice/Lattice_ET.h +++ b/Grid/lattice/Lattice_ET.h @@ -342,19 +342,14 @@ inline void ExpressionViewClose(LatticeTrinaryExpression &expr) GridUnopClass(UnarySub, -a); GridUnopClass(UnaryNot, Not(a)); -GridUnopClass(UnaryAdj, adj(a)); -GridUnopClass(UnaryConj, conjugate(a)); GridUnopClass(UnaryTrace, trace(a)); GridUnopClass(UnaryTranspose, transpose(a)); GridUnopClass(UnaryTa, Ta(a)); GridUnopClass(UnaryProjectOnGroup, ProjectOnGroup(a)); -GridUnopClass(UnaryToReal, toReal(a)); -GridUnopClass(UnaryToComplex, toComplex(a)); GridUnopClass(UnaryTimesI, timesI(a)); GridUnopClass(UnaryTimesMinusI, timesMinusI(a)); GridUnopClass(UnaryAbs, abs(a)); GridUnopClass(UnarySqrt, sqrt(a)); -GridUnopClass(UnaryRsqrt, rsqrt(a)); GridUnopClass(UnarySin, sin(a)); GridUnopClass(UnaryCos, cos(a)); GridUnopClass(UnaryAsin, asin(a)); @@ -456,20 +451,17 @@ GridTrinOpClass(TrinaryWhere, GRID_DEF_UNOP(operator-, UnarySub); GRID_DEF_UNOP(Not, UnaryNot); GRID_DEF_UNOP(operator!, UnaryNot); -GRID_DEF_UNOP(adj, UnaryAdj); -GRID_DEF_UNOP(conjugate, UnaryConj); +//GRID_DEF_UNOP(adj, UnaryAdj); +//GRID_DEF_UNOP(conjugate, UnaryConj); GRID_DEF_UNOP(trace, UnaryTrace); GRID_DEF_UNOP(transpose, UnaryTranspose); GRID_DEF_UNOP(Ta, UnaryTa); GRID_DEF_UNOP(ProjectOnGroup, UnaryProjectOnGroup); -GRID_DEF_UNOP(toReal, UnaryToReal); -GRID_DEF_UNOP(toComplex, UnaryToComplex); GRID_DEF_UNOP(timesI, UnaryTimesI); GRID_DEF_UNOP(timesMinusI, UnaryTimesMinusI); GRID_DEF_UNOP(abs, UnaryAbs); // abs overloaded in cmath C++98; DON'T do the // abs-fabs-dabs-labs thing GRID_DEF_UNOP(sqrt, UnarySqrt); -GRID_DEF_UNOP(rsqrt, UnaryRsqrt); GRID_DEF_UNOP(sin, UnarySin); GRID_DEF_UNOP(cos, UnaryCos); GRID_DEF_UNOP(asin, UnaryAsin); @@ -494,27 +486,27 @@ GRID_DEF_TRINOP(where, TrinaryWhere); ///////////////////////////////////////////////////////////// template auto closure(const LatticeUnaryExpression &expr) - -> Lattice + -> Lattice::type > { - Lattice ret(expr); + Lattice::type > ret(expr); return ret; } template auto closure(const LatticeBinaryExpression &expr) - -> Lattice + -> Lattice::type > { - Lattice ret(expr); + Lattice::type > ret(expr); return ret; } template auto closure(const LatticeTrinaryExpression &expr) - -> Lattice Lattice + vecEval(0, expr.arg3)))>::type > { - Lattice ret(expr); + vecEval(0, expr.arg3)))>::type > ret(expr); return ret; } #define EXPRESSION_CLOSURE(function) \ diff --git a/Grid/lattice/Lattice_basis.h b/Grid/lattice/Lattice_basis.h index af9d7280..95f55d10 100644 --- a/Grid/lattice/Lattice_basis.h +++ b/Grid/lattice/Lattice_basis.h @@ -62,7 +62,7 @@ void basisRotate(VField &basis,Matrix& Qt,int j0, int j1, int k0,int k1,int Nm) basis_v.push_back(basis[k].View(AcceleratorWrite)); } -#if ( (!defined(GRID_SYCL)) && (!defined(GRID_CUDA)) && (!defined(GRID_HIP)) ) +#if ( (!defined(GRID_SYCL)) && (!defined(GRID_CUDA)) ) int max_threads = thread_max(); Vector < vobj > Bt(Nm * max_threads); thread_region @@ -161,11 +161,12 @@ void basisRotateJ(Field &result,std::vector &basis,Eigen::MatrixXd& Qt,in double * Qt_j = & Qt_jv[0]; for(int k=0;koSites(),vobj::Nsimd(),{ auto B=coalescedRead(zz); for(int k=k0; k inline Lattice adj(const Lattice &lhs){ autoView( ret_v, ret, AcceleratorWrite); ret.Checkerboard()=lhs.Checkerboard(); - accelerator_for( ss, lhs_v.size(), vobj::Nsimd(), { - coalescedWrite(ret_v[ss], adj(lhs_v(ss))); + accelerator_for( ss, lhs_v.size(), 1, { + ret_v[ss] = adj(lhs_v[ss]); }); return ret; }; @@ -64,6 +64,53 @@ template inline Lattice conjugate(const Lattice &lhs){ return ret; }; +template inline Lattice toComplex(const Lattice &lhs){ + Lattice ret(lhs.Grid()); + + autoView( lhs_v, lhs, AcceleratorRead); + autoView( ret_v, ret, AcceleratorWrite); + + ret.Checkerboard() = lhs.Checkerboard(); + accelerator_for( ss, lhs_v.size(), 1, { + ret_v[ss] = toComplex(lhs_v[ss]); + }); + return ret; +}; +template inline Lattice toReal(const Lattice &lhs){ + Lattice ret(lhs.Grid()); + + autoView( lhs_v, lhs, AcceleratorRead); + autoView( ret_v, ret, AcceleratorWrite); + + ret.Checkerboard() = lhs.Checkerboard(); + accelerator_for( ss, lhs_v.size(), 1, { + ret_v[ss] = toReal(lhs_v[ss]); + }); + return ret; +}; + + +template::value,void>::type * = nullptr> +auto toComplex(const Expression &expr) -> decltype(closure(expr)) +{ + return toComplex(closure(expr)); +} +template::value,void>::type * = nullptr> +auto toReal(const Expression &expr) -> decltype(closure(expr)) +{ + return toReal(closure(expr)); +} +template::value,void>::type * = nullptr> +auto adj(const Expression &expr) -> decltype(closure(expr)) +{ + return adj(closure(expr)); +} +template::value,void>::type * = nullptr> +auto conjugate(const Expression &expr) -> decltype(closure(expr)) +{ + return conjugate(closure(expr)); +} + NAMESPACE_END(Grid); #endif diff --git a/Grid/log/Log.h b/Grid/log/Log.h index d459a4a9..68693647 100644 --- a/Grid/log/Log.h +++ b/Grid/log/Log.h @@ -130,6 +130,8 @@ public: friend std::ostream& operator<< (std::ostream& stream, Logger& log){ if ( log.active ) { + std::ios_base::fmtflags f(stream.flags()); + stream << log.background()<< std::left; if (log.topWidth > 0) { @@ -152,6 +154,8 @@ public: << now << log.background() << " : " ; } stream << log.colour(); + stream.flags(f); + return stream; } else { return devnull; diff --git a/Grid/parallelIO/BinaryIO.cc b/Grid/parallelIO/BinaryIO.cc index 221a7fe8..ef1b6683 100644 --- a/Grid/parallelIO/BinaryIO.cc +++ b/Grid/parallelIO/BinaryIO.cc @@ -1,3 +1,4 @@ #include -int Grid::BinaryIO::latticeWriteMaxRetry = -1; +int Grid::BinaryIO::latticeWriteMaxRetry = -1; +Grid::BinaryIO::IoPerf Grid::BinaryIO::lastPerf; diff --git a/Grid/parallelIO/BinaryIO.h b/Grid/parallelIO/BinaryIO.h index 1f11add9..e9893aa1 100644 --- a/Grid/parallelIO/BinaryIO.h +++ b/Grid/parallelIO/BinaryIO.h @@ -79,6 +79,13 @@ inline void removeWhitespace(std::string &key) /////////////////////////////////////////////////////////////////////////////////////////////////// class BinaryIO { public: + struct IoPerf + { + uint64_t size{0},time{0}; + double mbytesPerSecond{0.}; + }; + + static IoPerf lastPerf; static int latticeWriteMaxRetry; ///////////////////////////////////////////////////////////////////////////// @@ -502,12 +509,15 @@ class BinaryIO { timer.Stop(); } + lastPerf.size = sizeof(fobj)*iodata.size()*nrank; + lastPerf.time = timer.useconds(); + lastPerf.mbytesPerSecond = lastPerf.size/1024./1024./(lastPerf.time/1.0e6); std::cout< tmp(RngStateCount); std::copy(iodata[lidx].begin(),iodata[lidx].end(),tmp.begin()); - parallel_rng.SetState(tmp,lidx); + Coordinate lcoor; + grid->LocalIndexToLocalCoor(lidx, lcoor); + int o_idx=grid->oIndex(lcoor); + int i_idx=grid->iIndex(lcoor); + int gidx=parallel_rng.generator_idx(o_idx,i_idx); + parallel_rng.SetState(tmp,gidx); }); timer.Stop(); @@ -723,7 +738,12 @@ class BinaryIO { std::vector iodata(lsites); thread_for(lidx,lsites,{ std::vector tmp(RngStateCount); - parallel_rng.GetState(tmp,lidx); + Coordinate lcoor; + grid->LocalIndexToLocalCoor(lidx, lcoor); + int o_idx=grid->oIndex(lcoor); + int i_idx=grid->iIndex(lcoor); + int gidx=parallel_rng.generator_idx(o_idx,i_idx); + parallel_rng.GetState(tmp,gidx); std::copy(tmp.begin(),tmp.end(),iodata[lidx].begin()); }); timer.Stop(); diff --git a/Grid/qcd/QCD.h b/Grid/qcd/QCD.h index faacac63..76d7def4 100644 --- a/Grid/qcd/QCD.h +++ b/Grid/qcd/QCD.h @@ -47,7 +47,7 @@ static constexpr int Ym = 5; static constexpr int Zm = 6; static constexpr int Tm = 7; -static constexpr int Nc=3; +static constexpr int Nc=Config_Nc; static constexpr int Ns=4; static constexpr int Nd=4; static constexpr int Nhs=2; // half spinor diff --git a/Grid/qcd/action/fermion/implementation/WilsonCloverFermionImplementation.h b/Grid/qcd/action/fermion/implementation/WilsonCloverFermionImplementation.h index df1bce7c..3032a80c 100644 --- a/Grid/qcd/action/fermion/implementation/WilsonCloverFermionImplementation.h +++ b/Grid/qcd/action/fermion/implementation/WilsonCloverFermionImplementation.h @@ -92,20 +92,16 @@ void WilsonCloverFermion::ImportGauge(const GaugeField &_Umu) int lvol = _Umu.Grid()->lSites(); int DimRep = Impl::Dimension; - Eigen::MatrixXcd EigenCloverOp = Eigen::MatrixXcd::Zero(Ns * DimRep, Ns * DimRep); - Eigen::MatrixXcd EigenInvCloverOp = Eigen::MatrixXcd::Zero(Ns * DimRep, Ns * DimRep); - - Coordinate lcoor; - typename SiteCloverType::scalar_object Qx = Zero(), Qxinv = Zero(); - { autoView(CTv,CloverTerm,CpuRead); autoView(CTIv,CloverTermInv,CpuWrite); - for (int site = 0; site < lvol; site++) { + thread_for(site, lvol, { + Coordinate lcoor; grid->LocalIndexToLocalCoor(site, lcoor); - EigenCloverOp = Eigen::MatrixXcd::Zero(Ns * DimRep, Ns * DimRep); + Eigen::MatrixXcd EigenCloverOp = Eigen::MatrixXcd::Zero(Ns * DimRep, Ns * DimRep); + Eigen::MatrixXcd EigenInvCloverOp = Eigen::MatrixXcd::Zero(Ns * DimRep, Ns * DimRep); + typename SiteCloverType::scalar_object Qx = Zero(), Qxinv = Zero(); peekLocalSite(Qx, CTv, lcoor); - Qxinv = Zero(); //if (csw!=0){ for (int j = 0; j < Ns; j++) for (int k = 0; k < Ns; k++) @@ -126,21 +122,21 @@ void WilsonCloverFermion::ImportGauge(const GaugeField &_Umu) // if (site==0) std::cout << "site =" << site << "\n" << EigenInvCloverOp << std::endl; // } pokeLocalSite(Qxinv, CTIv, lcoor); - } + }); } // Separate the even and odd parts pickCheckerboard(Even, CloverTermEven, CloverTerm); pickCheckerboard(Odd, CloverTermOdd, CloverTerm); - pickCheckerboard(Even, CloverTermDagEven, closure(adj(CloverTerm))); - pickCheckerboard(Odd, CloverTermDagOdd, closure(adj(CloverTerm))); + pickCheckerboard(Even, CloverTermDagEven, adj(CloverTerm)); + pickCheckerboard(Odd, CloverTermDagOdd, adj(CloverTerm)); pickCheckerboard(Even, CloverTermInvEven, CloverTermInv); pickCheckerboard(Odd, CloverTermInvOdd, CloverTermInv); - pickCheckerboard(Even, CloverTermInvDagEven, closure(adj(CloverTermInv))); - pickCheckerboard(Odd, CloverTermInvDagOdd, closure(adj(CloverTermInv))); + pickCheckerboard(Even, CloverTermInvDagEven, adj(CloverTermInv)); + pickCheckerboard(Odd, CloverTermInvDagOdd, adj(CloverTermInv)); } template diff --git a/Grid/qcd/hmc/GenericHMCrunner.h b/Grid/qcd/hmc/GenericHMCrunner.h index c2443dd0..98e8175a 100644 --- a/Grid/qcd/hmc/GenericHMCrunner.h +++ b/Grid/qcd/hmc/GenericHMCrunner.h @@ -159,6 +159,13 @@ private: Resources.GetCheckPointer()->CheckpointRestore(Parameters.StartTrajectory, U, Resources.GetSerialRNG(), Resources.GetParallelRNG()); + } else { + // others + std::cout << GridLogError << "Unrecognized StartingType\n"; + std::cout + << GridLogError + << "Valid [HotStart, ColdStart, TepidStart, CheckpointStart]\n"; + exit(1); } Smearing.set_Field(U); diff --git a/Grid/qcd/utils/BaryonUtils.h b/Grid/qcd/utils/BaryonUtils.h index b268b684..15516b56 100644 --- a/Grid/qcd/utils/BaryonUtils.h +++ b/Grid/qcd/utils/BaryonUtils.h @@ -51,7 +51,7 @@ public: private: template - static void baryon_site(const mobj &D1, + static void BaryonSite(const mobj &D1, const mobj &D2, const mobj &D3, const Gamma GammaA_left, @@ -61,8 +61,18 @@ public: const int parity, const bool * wick_contractions, robj &result); + template + static void BaryonSiteMatrix(const mobj &D1, + const mobj &D2, + const mobj &D3, + const Gamma GammaA_left, + const Gamma GammaB_left, + const Gamma GammaA_right, + const Gamma GammaB_right, + const bool * wick_contractions, + robj &result); public: - static void Wick_Contractions(std::string qi, + static void WickContractions(std::string qi, std::string qf, bool* wick_contractions); static void ContractBaryons(const PropagatorField &q1_left, @@ -75,8 +85,17 @@ public: const bool* wick_contractions, const int parity, ComplexField &baryon_corr); + static void ContractBaryonsMatrix(const PropagatorField &q1_left, + const PropagatorField &q2_left, + const PropagatorField &q3_left, + const Gamma GammaA_left, + const Gamma GammaB_left, + const Gamma GammaA_right, + const Gamma GammaB_right, + const bool* wick_contractions, + SpinMatrixField &baryon_corr); template - static void ContractBaryons_Sliced(const mobj &D1, + static void ContractBaryonsSliced(const mobj &D1, const mobj &D2, const mobj &D3, const Gamma GammaA_left, @@ -87,9 +106,20 @@ public: const int parity, const int nt, robj &result); + template + static void ContractBaryonsSlicedMatrix(const mobj &D1, + const mobj &D2, + const mobj &D3, + const Gamma GammaA_left, + const Gamma GammaB_left, + const Gamma GammaA_right, + const Gamma GammaB_right, + const bool* wick_contractions, + const int nt, + robj &result); private: template - static void Baryon_Gamma_3pt_Group1_Site( + static void BaryonGamma3ptGroup1Site( const mobj &Dq1_ti, const mobj2 &Dq2_spec, const mobj2 &Dq3_spec, @@ -101,7 +131,7 @@ public: robj &result); template - static void Baryon_Gamma_3pt_Group2_Site( + static void BaryonGamma3ptGroup2Site( const mobj2 &Dq1_spec, const mobj &Dq2_ti, const mobj2 &Dq3_spec, @@ -113,7 +143,7 @@ public: robj &result); template - static void Baryon_Gamma_3pt_Group3_Site( + static void BaryonGamma3ptGroup3Site( const mobj2 &Dq1_spec, const mobj2 &Dq2_spec, const mobj &Dq3_ti, @@ -125,7 +155,7 @@ public: robj &result); public: template - static void Baryon_Gamma_3pt( + static void BaryonGamma3pt( const PropagatorField &q_ti, const mobj &Dq_spec1, const mobj &Dq_spec2, @@ -138,7 +168,7 @@ public: SpinMatrixField &stn_corr); private: template - static void Sigma_to_Nucleon_Q1_Eye_site(const mobj &Dq_loop, + static void SigmaToNucleonQ1EyeSite(const mobj &Dq_loop, const mobj2 &Du_spec, const mobj &Dd_tf, const mobj &Ds_ti, @@ -147,7 +177,7 @@ public: const Gamma GammaB_nucl, robj &result); template - static void Sigma_to_Nucleon_Q1_NonEye_site(const mobj &Du_ti, + static void SigmaToNucleonQ1NonEyeSite(const mobj &Du_ti, const mobj &Du_tf, const mobj2 &Du_spec, const mobj &Dd_tf, @@ -159,7 +189,7 @@ public: template - static void Sigma_to_Nucleon_Q2_Eye_site(const mobj &Dq_loop, + static void SigmaToNucleonQ2EyeSite(const mobj &Dq_loop, const mobj2 &Du_spec, const mobj &Dd_tf, const mobj &Ds_ti, @@ -168,7 +198,7 @@ public: const Gamma GammaB_nucl, robj &result); template - static void Sigma_to_Nucleon_Q2_NonEye_site(const mobj &Du_ti, + static void SigmaToNucleonQ2NonEyeSite(const mobj &Du_ti, const mobj &Du_tf, const mobj2 &Du_spec, const mobj &Dd_tf, @@ -179,7 +209,7 @@ public: robj &result); public: template - static void Sigma_to_Nucleon_Eye(const PropagatorField &qq_loop, + static void SigmaToNucleonEye(const PropagatorField &qq_loop, const mobj &Du_spec, const PropagatorField &qd_tf, const PropagatorField &qs_ti, @@ -189,7 +219,7 @@ public: const std::string op, SpinMatrixField &stn_corr); template - static void Sigma_to_Nucleon_NonEye(const PropagatorField &qq_ti, + static void SigmaToNucleonNonEye(const PropagatorField &qq_ti, const PropagatorField &qq_tf, const mobj &Du_spec, const PropagatorField &qd_tf, @@ -217,7 +247,7 @@ const Real BaryonUtils::epsilon_sgn[6] = {1.,1.,1.,-1.,-1.,-1.}; //This is the old version template template -void BaryonUtils::baryon_site(const mobj &D1, +void BaryonUtils::BaryonSite(const mobj &D1, const mobj &D2, const mobj &D3, const Gamma GammaA_i, @@ -329,12 +359,132 @@ void BaryonUtils::baryon_site(const mobj &D1, }} } +//New version without parity projection or trace +template +template +void BaryonUtils::BaryonSiteMatrix(const mobj &D1, + const mobj &D2, + const mobj &D3, + const Gamma GammaA_i, + const Gamma GammaB_i, + const Gamma GammaA_f, + const Gamma GammaB_f, + const bool * wick_contraction, + robj &result) +{ + + auto D1_GAi = D1 * GammaA_i; + auto GAf_D1_GAi = GammaA_f * D1_GAi; + auto GBf_D1_GAi = GammaB_f * D1_GAi; + + auto D2_GBi = D2 * GammaB_i; + auto GBf_D2_GBi = GammaB_f * D2_GBi; + auto GAf_D2_GBi = GammaA_f * D2_GBi; + + auto GBf_D3 = GammaB_f * D3; + auto GAf_D3 = GammaA_f * D3; + + for (int ie_f=0; ie_f < 6 ; ie_f++){ + int a_f = epsilon[ie_f][0]; //a + int b_f = epsilon[ie_f][1]; //b + int c_f = epsilon[ie_f][2]; //c + for (int ie_i=0; ie_i < 6 ; ie_i++){ + int a_i = epsilon[ie_i][0]; //a' + int b_i = epsilon[ie_i][1]; //b' + int c_i = epsilon[ie_i][2]; //c' + + Real ee = epsilon_sgn[ie_f] * epsilon_sgn[ie_i]; + //This is the \delta_{456}^{123} part + if (wick_contraction[0]){ + for (int rho_i=0; rho_i -void BaryonUtils::Wick_Contractions(std::string qi, std::string qf, bool* wick_contractions) { +void BaryonUtils::WickContractions(std::string qi, std::string qf, bool* wick_contractions) { const int epsilon[6][3] = {{0,1,2},{1,2,0},{2,0,1},{0,2,1},{2,1,0},{1,0,2}}; for (int ie=0; ie < 6 ; ie++) { wick_contractions[ie] = (qi.size() == 3 && qf.size() == 3 @@ -364,11 +514,6 @@ void BaryonUtils::ContractBaryons(const PropagatorField &q1_left, assert(Ns==4 && "Baryon code only implemented for N_spin = 4"); assert(Nc==3 && "Baryon code only implemented for N_colour = 3"); - - std::cout << "GammaA (left) " << (GammaA_left.g) << std::endl; - std::cout << "GammaB (left) " << (GammaB_left.g) << std::endl; - std::cout << "GammaA (right) " << (GammaA_right.g) << std::endl; - std::cout << "GammaB (right) " << (GammaB_right.g) << std::endl; assert(parity==1 || parity == -1 && "Parity must be +1 or -1"); @@ -397,13 +542,62 @@ void BaryonUtils::ContractBaryons(const PropagatorField &q1_left, auto D2 = v2[ss]; auto D3 = v3[ss]; vobj result=Zero(); - baryon_site(D1,D2,D3,GammaA_left,GammaB_left,GammaA_right,GammaB_right,parity,wick_contractions,result); + BaryonSite(D1,D2,D3,GammaA_left,GammaB_left,GammaA_right,GammaB_right,parity,wick_contractions,result); vbaryon_corr[ss] = result; } );//end loop over lattice sites t += usecond(); - std::cout << std::setw(10) << bytes/t*1.0e6/1024/1024/1024 << " GB/s " << std::endl; + std::cout << GridLogDebug << std::setw(10) << bytes/t*1.0e6/1024/1024/1024 << " GB/s " << std::endl; +} + +template +void BaryonUtils::ContractBaryonsMatrix(const PropagatorField &q1_left, + const PropagatorField &q2_left, + const PropagatorField &q3_left, + const Gamma GammaA_left, + const Gamma GammaB_left, + const Gamma GammaA_right, + const Gamma GammaB_right, + const bool* wick_contractions, + SpinMatrixField &baryon_corr) +{ + + assert(Ns==4 && "Baryon code only implemented for N_spin = 4"); + assert(Nc==3 && "Baryon code only implemented for N_colour = 3"); + + GridBase *grid = q1_left.Grid(); + + autoView(vbaryon_corr, baryon_corr,CpuWrite); + autoView( v1 , q1_left, CpuRead); + autoView( v2 , q2_left, CpuRead); + autoView( v3 , q3_left, CpuRead); + + // Real bytes =0.; + // bytes += grid->oSites() * (432.*sizeof(vComplex) + 126.*sizeof(int) + 36.*sizeof(Real)); + // for (int ie=0; ie < 6 ; ie++){ + // if(ie==0 or ie==3){ + // bytes += grid->oSites() * (4.*sizeof(int) + 4752.*sizeof(vComplex)) * wick_contractions[ie]; + // } + // else{ + // bytes += grid->oSites() * (64.*sizeof(int) + 5184.*sizeof(vComplex)) * wick_contractions[ie]; + // } + // } + // Real t=0.; + // t =-usecond(); + + accelerator_for(ss, grid->oSites(), grid->Nsimd(), { + auto D1 = v1[ss]; + auto D2 = v2[ss]; + auto D3 = v3[ss]; + sobj result=Zero(); + BaryonSiteMatrix(D1,D2,D3,GammaA_left,GammaB_left,GammaA_right,GammaB_right,wick_contractions,result); + vbaryon_corr[ss] = result; + } );//end loop over lattice sites + + // t += usecond(); + + // std::cout << GridLogDebug << std::setw(10) << bytes/t*1.0e6/1024/1024/1024 << " GB/s " << std::endl; } @@ -414,7 +608,7 @@ void BaryonUtils::ContractBaryons(const PropagatorField &q1_left, * Wick_Contractions function above */ template template -void BaryonUtils::ContractBaryons_Sliced(const mobj &D1, +void BaryonUtils::ContractBaryonsSliced(const mobj &D1, const mobj &D2, const mobj &D3, const Gamma GammaA_left, @@ -429,16 +623,33 @@ void BaryonUtils::ContractBaryons_Sliced(const mobj &D1, assert(Ns==4 && "Baryon code only implemented for N_spin = 4"); assert(Nc==3 && "Baryon code only implemented for N_colour = 3"); - - std::cout << "GammaA (left) " << (GammaA_left.g) << std::endl; - std::cout << "GammaB (left) " << (GammaB_left.g) << std::endl; - std::cout << "GammaA (right) " << (GammaA_right.g) << std::endl; - std::cout << "GammaB (right) " << (GammaB_right.g) << std::endl; assert(parity==1 || parity == -1 && "Parity must be +1 or -1"); for (int t=0; t +template +void BaryonUtils::ContractBaryonsSlicedMatrix(const mobj &D1, + const mobj &D2, + const mobj &D3, + const Gamma GammaA_left, + const Gamma GammaB_left, + const Gamma GammaA_right, + const Gamma GammaB_right, + const bool* wick_contractions, + const int nt, + robj &result) +{ + + assert(Ns==4 && "Baryon code only implemented for N_spin = 4"); + assert(Nc==3 && "Baryon code only implemented for N_colour = 3"); + + for (int t=0; t::ContractBaryons_Sliced(const mobj &D1, * Dq4_tf is a quark line from t_f to t_J */ template template -void BaryonUtils::Baryon_Gamma_3pt_Group1_Site( +void BaryonUtils::BaryonGamma3ptGroup1Site( const mobj &Dq1_ti, const mobj2 &Dq2_spec, const mobj2 &Dq3_spec, @@ -546,7 +757,7 @@ void BaryonUtils::Baryon_Gamma_3pt_Group1_Site( * Dq4_tf is a quark line from t_f to t_J */ template template -void BaryonUtils::Baryon_Gamma_3pt_Group2_Site( +void BaryonUtils::BaryonGamma3ptGroup2Site( const mobj2 &Dq1_spec, const mobj &Dq2_ti, const mobj2 &Dq3_spec, @@ -636,7 +847,7 @@ void BaryonUtils::Baryon_Gamma_3pt_Group2_Site( * Dq4_tf is a quark line from t_f to t_J */ template template -void BaryonUtils::Baryon_Gamma_3pt_Group3_Site( +void BaryonUtils::BaryonGamma3ptGroup3Site( const mobj2 &Dq1_spec, const mobj2 &Dq2_spec, const mobj &Dq3_ti, @@ -728,7 +939,7 @@ void BaryonUtils::Baryon_Gamma_3pt_Group3_Site( * https://aportelli.github.io/Hadrons-doc/#/mcontraction */ template template -void BaryonUtils::Baryon_Gamma_3pt( +void BaryonUtils::BaryonGamma3pt( const PropagatorField &q_ti, const mobj &Dq_spec1, const mobj &Dq_spec2, @@ -751,7 +962,7 @@ void BaryonUtils::Baryon_Gamma_3pt( auto Dq_ti = vq_ti[ss]; auto Dq_tf = vq_tf[ss]; sobj result=Zero(); - Baryon_Gamma_3pt_Group1_Site(Dq_ti,Dq_spec1,Dq_spec2,Dq_tf,GammaJ,GammaBi,GammaBf,wick_contraction,result); + BaryonGamma3ptGroup1Site(Dq_ti,Dq_spec1,Dq_spec2,Dq_tf,GammaJ,GammaBi,GammaBf,wick_contraction,result); vcorr[ss] += result; });//end loop over lattice sites } else if (group == 2) { @@ -759,7 +970,7 @@ void BaryonUtils::Baryon_Gamma_3pt( auto Dq_ti = vq_ti[ss]; auto Dq_tf = vq_tf[ss]; sobj result=Zero(); - Baryon_Gamma_3pt_Group2_Site(Dq_spec1,Dq_ti,Dq_spec2,Dq_tf,GammaJ,GammaBi,GammaBf,wick_contraction,result); + BaryonGamma3ptGroup2Site(Dq_spec1,Dq_ti,Dq_spec2,Dq_tf,GammaJ,GammaBi,GammaBf,wick_contraction,result); vcorr[ss] += result; });//end loop over lattice sites } else if (group == 3) { @@ -767,7 +978,7 @@ void BaryonUtils::Baryon_Gamma_3pt( auto Dq_ti = vq_ti[ss]; auto Dq_tf = vq_tf[ss]; sobj result=Zero(); - Baryon_Gamma_3pt_Group3_Site(Dq_spec1,Dq_spec2,Dq_ti,Dq_tf,GammaJ,GammaBi,GammaBf,wick_contraction,result); + BaryonGamma3ptGroup3Site(Dq_spec1,Dq_spec2,Dq_ti,Dq_tf,GammaJ,GammaBi,GammaBf,wick_contraction,result); vcorr[ss] += result; });//end loop over lattice sites @@ -787,7 +998,7 @@ void BaryonUtils::Baryon_Gamma_3pt( * Ds_ti is a quark line from t_i to t_H */ template template -void BaryonUtils::Sigma_to_Nucleon_Q1_Eye_site(const mobj &Dq_loop, +void BaryonUtils::SigmaToNucleonQ1EyeSite(const mobj &Dq_loop, const mobj2 &Du_spec, const mobj &Dd_tf, const mobj &Ds_ti, @@ -838,7 +1049,7 @@ void BaryonUtils::Sigma_to_Nucleon_Q1_Eye_site(const mobj &Dq_loop, * Ds_ti is a quark line from t_i to t_H */ template template -void BaryonUtils::Sigma_to_Nucleon_Q1_NonEye_site(const mobj &Du_ti, +void BaryonUtils::SigmaToNucleonQ1NonEyeSite(const mobj &Du_ti, const mobj &Du_tf, const mobj2 &Du_spec, const mobj &Dd_tf, @@ -897,7 +1108,7 @@ void BaryonUtils::Sigma_to_Nucleon_Q1_NonEye_site(const mobj &Du_ti, * Ds_ti is a quark line from t_i to t_H */ template template -void BaryonUtils::Sigma_to_Nucleon_Q2_Eye_site(const mobj &Dq_loop, +void BaryonUtils::SigmaToNucleonQ2EyeSite(const mobj &Dq_loop, const mobj2 &Du_spec, const mobj &Dd_tf, const mobj &Ds_ti, @@ -948,7 +1159,7 @@ void BaryonUtils::Sigma_to_Nucleon_Q2_Eye_site(const mobj &Dq_loop, * Ds_ti is a quark line from t_i to t_H */ template template -void BaryonUtils::Sigma_to_Nucleon_Q2_NonEye_site(const mobj &Du_ti, +void BaryonUtils::SigmaToNucleonQ2NonEyeSite(const mobj &Du_ti, const mobj &Du_tf, const mobj2 &Du_spec, const mobj &Dd_tf, @@ -1002,7 +1213,7 @@ void BaryonUtils::Sigma_to_Nucleon_Q2_NonEye_site(const mobj &Du_ti, template template -void BaryonUtils::Sigma_to_Nucleon_Eye(const PropagatorField &qq_loop, +void BaryonUtils::SigmaToNucleonEye(const PropagatorField &qq_loop, const mobj &Du_spec, const PropagatorField &qd_tf, const PropagatorField &qs_ti, @@ -1029,9 +1240,9 @@ void BaryonUtils::Sigma_to_Nucleon_Eye(const PropagatorField &qq_loop, auto Ds_ti = vs_ti[ss]; sobj result=Zero(); if(op == "Q1"){ - Sigma_to_Nucleon_Q1_Eye_site(Dq_loop,Du_spec,Dd_tf,Ds_ti,Gamma_H,GammaB_sigma,GammaB_nucl,result); + SigmaToNucleonQ1EyeSite(Dq_loop,Du_spec,Dd_tf,Ds_ti,Gamma_H,GammaB_sigma,GammaB_nucl,result); } else if(op == "Q2"){ - Sigma_to_Nucleon_Q2_Eye_site(Dq_loop,Du_spec,Dd_tf,Ds_ti,Gamma_H,GammaB_sigma,GammaB_nucl,result); + SigmaToNucleonQ2EyeSite(Dq_loop,Du_spec,Dd_tf,Ds_ti,Gamma_H,GammaB_sigma,GammaB_nucl,result); } else { assert(0 && "Weak Operator not correctly specified"); } @@ -1041,7 +1252,7 @@ void BaryonUtils::Sigma_to_Nucleon_Eye(const PropagatorField &qq_loop, template template -void BaryonUtils::Sigma_to_Nucleon_NonEye(const PropagatorField &qq_ti, +void BaryonUtils::SigmaToNucleonNonEye(const PropagatorField &qq_ti, const PropagatorField &qq_tf, const mobj &Du_spec, const PropagatorField &qd_tf, @@ -1071,9 +1282,9 @@ void BaryonUtils::Sigma_to_Nucleon_NonEye(const PropagatorField &qq_ti, auto Ds_ti = vs_ti[ss]; sobj result=Zero(); if(op == "Q1"){ - Sigma_to_Nucleon_Q1_NonEye_site(Dq_ti,Dq_tf,Du_spec,Dd_tf,Ds_ti,Gamma_H,GammaB_sigma,GammaB_nucl,result); + SigmaToNucleonQ1NonEyeSite(Dq_ti,Dq_tf,Du_spec,Dd_tf,Ds_ti,Gamma_H,GammaB_sigma,GammaB_nucl,result); } else if(op == "Q2"){ - Sigma_to_Nucleon_Q2_NonEye_site(Dq_ti,Dq_tf,Du_spec,Dd_tf,Ds_ti,Gamma_H,GammaB_sigma,GammaB_nucl,result); + SigmaToNucleonQ2NonEyeSite(Dq_ti,Dq_tf,Du_spec,Dd_tf,Ds_ti,Gamma_H,GammaB_sigma,GammaB_nucl,result); } else { assert(0 && "Weak Operator not correctly specified"); } diff --git a/Grid/qcd/utils/SUn.h b/Grid/qcd/utils/SUn.h index 0cc0cc1a..69ab4ebb 100644 --- a/Grid/qcd/utils/SUn.h +++ b/Grid/qcd/utils/SUn.h @@ -449,7 +449,8 @@ public: LatticeReal alpha(grid); // std::cout< static void HotConfiguration(GridParallelRNG &pRNG, GaugeField &out) { typedef typename GaugeField::vector_type vector_type; @@ -799,6 +799,89 @@ public: } }; +template +LatticeComplexD Determinant(const Lattice > > > &Umu) +{ + GridBase *grid=Umu.Grid(); + auto lvol = grid->lSites(); + LatticeComplexD ret(grid); + + autoView(Umu_v,Umu,CpuRead); + autoView(ret_v,ret,CpuWrite); + thread_for(site,lvol,{ + Eigen::MatrixXcd EigenU = Eigen::MatrixXcd::Zero(N,N); + Coordinate lcoor; + grid->LocalIndexToLocalCoor(site, lcoor); + iScalar > > Us; + peekLocalSite(Us, Umu_v, lcoor); + for(int i=0;i +static void ProjectSUn(Lattice > > > &Umu) +{ + Umu = ProjectOnGroup(Umu); + auto det = Determinant(Umu); + + det = pow(det,-1); + + for(int i=0;i(Umu,N-1,i); + element = element * det; + PokeIndex(Umu,element,Nc-1,i); + } +} +template +static void ProjectSUn(Lattice >,Nd> > &U) +{ + GridBase *grid=U.Grid(); + // Reunitarise + for(int mu=0;mu(U,mu); + Umu = ProjectOnGroup(Umu); + ProjectSUn(Umu); + PokeIndex(U,Umu,mu); + } +} +// Explicit specialisation for SU(3). +// Explicit specialisation for SU(3). +static void +ProjectSU3 (Lattice > > > &Umu) +{ + GridBase *grid=Umu.Grid(); + const int x=0; + const int y=1; + const int z=2; + // Reunitarise + Umu = ProjectOnGroup(Umu); + autoView(Umu_v,Umu,CpuWrite); + thread_for(ss,grid->oSites(),{ + auto cm = Umu_v[ss]; + cm()()(2,x) = adj(cm()()(0,y)*cm()()(1,z)-cm()()(0,z)*cm()()(1,y)); //x= yz-zy + cm()()(2,y) = adj(cm()()(0,z)*cm()()(1,x)-cm()()(0,x)*cm()()(1,z)); //y= zx-xz + cm()()(2,z) = adj(cm()()(0,x)*cm()()(1,y)-cm()()(0,y)*cm()()(1,x)); //z= xy-yx + Umu_v[ss]=cm; + }); +} +static void ProjectSU3(Lattice >,Nd> > &U) +{ + GridBase *grid=U.Grid(); + // Reunitarise + for(int mu=0;mu(U,mu); + Umu = ProjectOnGroup(Umu); + ProjectSU3(Umu); + PokeIndex(U,Umu,mu); + } +} + typedef SU<2> SU2; typedef SU<3> SU3; typedef SU<4> SU4; diff --git a/Grid/serialisation/JSON_IO.cc b/Grid/serialisation/JSON_IO.cc index aca8bab3..f2282099 100644 --- a/Grid/serialisation/JSON_IO.cc +++ b/Grid/serialisation/JSON_IO.cc @@ -26,7 +26,7 @@ *************************************************************************************/ /* END LEGAL */ #include -#ifndef __NVCC__ +#if (!defined(GRID_CUDA)) && (!defined(GRID_HIP)) NAMESPACE_BEGIN(Grid); diff --git a/Grid/simd/Grid_vector_unops.h b/Grid/simd/Grid_vector_unops.h index d225699b..b89bb785 100644 --- a/Grid/simd/Grid_vector_unops.h +++ b/Grid/simd/Grid_vector_unops.h @@ -125,14 +125,6 @@ accelerator_inline Grid_simd sqrt(const Grid_simd &r) { return SimdApply(SqrtRealFunctor(), r); } template -accelerator_inline Grid_simd rsqrt(const Grid_simd &r) { - return SimdApply(RSqrtRealFunctor(), r); -} -template -accelerator_inline Scalar rsqrt(const Scalar &r) { - return (RSqrtRealFunctor(), r); -} -template accelerator_inline Grid_simd cos(const Grid_simd &r) { return SimdApply(CosRealFunctor(), r); } diff --git a/Grid/tensors/Tensor_Ta.h b/Grid/tensors/Tensor_Ta.h index 1ef9fc23..bbaa4a00 100644 --- a/Grid/tensors/Tensor_Ta.h +++ b/Grid/tensors/Tensor_Ta.h @@ -95,14 +95,18 @@ accelerator_inline iMatrix ProjectOnGroup(const iMatrix &arg) vtype nrm; vtype inner; for(int c1=0;c1memcpy(to,from,bytes); theGridAccelerator->wait();} inline void acceleratorCopyToDevice(void *from,void *to,size_t bytes) { theGridAccelerator->memcpy(to,from,bytes); theGridAccelerator->wait();} inline void acceleratorCopyFromDevice(void *from,void *to,size_t bytes){ theGridAccelerator->memcpy(to,from,bytes); theGridAccelerator->wait();} +inline void acceleratorMemSet(void *base,int value,size_t bytes) { theGridAccelerator->memset(base,value,bytes); theGridAccelerator->wait();} inline int acceleratorIsCommunicable(void *ptr) { #if 0 @@ -328,10 +333,12 @@ inline void *acceleratorAllocDevice(size_t bytes) return ptr; }; -inline void acceleratorFreeShared(void *ptr){ free(ptr);}; +inline void acceleratorFreeShared(void *ptr){ hipFree(ptr);}; inline void acceleratorFreeDevice(void *ptr){ hipFree(ptr);}; inline void acceleratorCopyToDevice(void *from,void *to,size_t bytes) { hipMemcpy(to,from,bytes, hipMemcpyHostToDevice);} inline void acceleratorCopyFromDevice(void *from,void *to,size_t bytes){ hipMemcpy(to,from,bytes, hipMemcpyDeviceToHost);} +inline void acceleratorCopyDeviceToDevice(void *from,void *to,size_t bytes) { hipMemcpy(to,from,bytes, hipMemcpyDeviceToDevice);} +inline void acceleratorMemSet(void *base,int value,size_t bytes) { hipMemset(base,value,bytes);} #endif @@ -369,8 +376,10 @@ inline void acceleratorCopyFromDevice(void *from,void *to,size_t bytes){ hipMemc accelerator_inline int acceleratorSIMTlane(int Nsimd) { return 0; } // CUDA specific inline void acceleratorCopyToDevice(void *from,void *to,size_t bytes) { memcpy(to,from,bytes);} inline void acceleratorCopyFromDevice(void *from,void *to,size_t bytes){ memcpy(to,from,bytes);} +inline void acceleratorCopyDeviceToDevice(void *from,void *to,size_t bytes) { memcpy(to,from,bytes);} inline int acceleratorIsCommunicable(void *ptr){ return 1; } +inline void acceleratorMemSet(void *base,int value,size_t bytes) { memset(base,value,bytes);} #ifdef HAVE_MM_MALLOC_H inline void *acceleratorAllocShared(size_t bytes){return _mm_malloc(bytes,GRID_ALLOC_ALIGN);}; inline void *acceleratorAllocDevice(size_t bytes){return _mm_malloc(bytes,GRID_ALLOC_ALIGN);}; @@ -393,6 +402,8 @@ inline void *acceleratorAllocCpu(size_t bytes){return memalign(GRID_ALLOC_ALIGN, inline void acceleratorFreeCpu (void *ptr){free(ptr);}; #endif + + /////////////////////////////////////////////////// // Synchronise across local threads for divergence resynch /////////////////////////////////////////////////// diff --git a/Grid/util/Init.cc b/Grid/util/Init.cc index 37d16176..9be39e94 100644 --- a/Grid/util/Init.cc +++ b/Grid/util/Init.cc @@ -473,11 +473,13 @@ void Grid_init(int *argc,char ***argv) LebesgueOrder::UseLebesgueOrder=1; } CartesianCommunicator::nCommThreads = 1; +#ifdef GRID_COMMS_THREADS if( GridCmdOptionExists(*argv,*argv+*argc,"--comms-threads") ){ arg= GridCmdOptionPayload(*argv,*argv+*argc,"--comms-threads"); GridCmdOptionInt(arg,CartesianCommunicator::nCommThreads); assert(CartesianCommunicator::nCommThreads > 0); } +#endif if( GridCmdOptionExists(*argv,*argv+*argc,"--cacheblocking") ){ arg= GridCmdOptionPayload(*argv,*argv+*argc,"--cacheblocking"); GridCmdOptionIntVector(arg,LebesgueOrder::Block); diff --git a/README b/README index 86506f52..0beabff3 100644 --- a/README +++ b/README @@ -111,11 +111,10 @@ Now you can execute the `configure` script to generate makefiles (here from a bu ``` bash mkdir build; cd build -../configure --enable-precision=double --enable-simd=AVX --enable-comms=mpi-auto --prefix= +../configure --enable-simd=AVX --enable-comms=mpi-auto --prefix= ``` -where `--enable-precision=` set the default precision, -`--enable-simd=` set the SIMD type, `--enable- +where `--enable-simd=` set the SIMD type, `--enable- comms=`, and `` should be replaced by the prefix path where you want to install Grid. Other options are detailed in the next section, you can also use `configure --help` to display them. Like with any other program using GNU autotool, the @@ -146,8 +145,8 @@ If you want to build all the tests at once just use `make tests`. - `--enable-numa`: enable NUMA first touch optimisation - `--enable-simd=`: setup Grid for the SIMD target `` (default: `GEN`). A list of possible SIMD targets is detailed in a section below. - `--enable-gen-simd-width=`: select the size (in bytes) of the generic SIMD vector type (default: 32 bytes). -- `--enable-precision={single|double}`: set the default precision (default: `double`). -- `--enable-precision=`: Use `` for message passing (default: `none`). A list of possible SIMD targets is detailed in a section below. +- `--enable-precision={single|double}`: set the default precision (default: `double`). **Deprecated option** +- `--enable-comms=`: Use `` for message passing (default: `none`). A list of possible SIMD targets is detailed in a section below. - `--enable-rng={sitmo|ranlux48|mt19937}`: choose the RNG (default: `sitmo `). - `--disable-timers`: disable system dependent high-resolution timers. - `--enable-chroma`: enable Chroma regression tests. @@ -201,8 +200,7 @@ Alternatively, some CPU codenames can be directly used: The following configuration is recommended for the Intel Knights Landing platform: ``` bash -../configure --enable-precision=double\ - --enable-simd=KNL \ +../configure --enable-simd=KNL \ --enable-comms=mpi-auto \ --enable-mkl \ CXX=icpc MPICXX=mpiicpc @@ -212,8 +210,7 @@ The MKL flag enables use of BLAS and FFTW from the Intel Math Kernels Library. If you are working on a Cray machine that does not use the `mpiicpc` wrapper, please use: ``` bash -../configure --enable-precision=double\ - --enable-simd=KNL \ +../configure --enable-simd=KNL \ --enable-comms=mpi \ --enable-mkl \ CXX=CC CC=cc @@ -232,8 +229,7 @@ for interior communication. This is the mpi3 communications implementation. We recommend four ranks per node for best performance, but optimum is local volume dependent. ``` bash -../configure --enable-precision=double\ - --enable-simd=KNL \ +../configure --enable-simd=KNL \ --enable-comms=mpi3-auto \ --enable-mkl \ CC=icpc MPICXX=mpiicpc @@ -244,8 +240,7 @@ We recommend four ranks per node for best performance, but optimum is local volu The following configuration is recommended for the Intel Haswell platform: ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX2 \ +../configure --enable-simd=AVX2 \ --enable-comms=mpi3-auto \ --enable-mkl \ CXX=icpc MPICXX=mpiicpc @@ -262,8 +257,7 @@ where `` is the UNIX prefix where GMP and MPFR are installed. If you are working on a Cray machine that does not use the `mpiicpc` wrapper, please use: ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX2 \ +../configure --enable-simd=AVX2 \ --enable-comms=mpi3 \ --enable-mkl \ CXX=CC CC=cc @@ -280,8 +274,7 @@ This is the default. The following configuration is recommended for the Intel Skylake platform: ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX512 \ +../configure --enable-simd=AVX512 \ --enable-comms=mpi3 \ --enable-mkl \ CXX=mpiicpc @@ -298,8 +291,7 @@ where `` is the UNIX prefix where GMP and MPFR are installed. If you are working on a Cray machine that does not use the `mpiicpc` wrapper, please use: ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX512 \ +../configure --enable-simd=AVX512 \ --enable-comms=mpi3 \ --enable-mkl \ CXX=CC CC=cc @@ -330,8 +322,7 @@ and 8 threads per rank. The following configuration is recommended for the AMD EPYC platform. ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX2 \ +../configure --enable-simd=AVX2 \ --enable-comms=mpi3 \ CXX=mpicxx ``` diff --git a/README.md b/README.md index 9f690ce0..4cbae720 100644 --- a/README.md +++ b/README.md @@ -115,11 +115,10 @@ Now you can execute the `configure` script to generate makefiles (here from a bu ``` bash mkdir build; cd build -../configure --enable-precision=double --enable-simd=AVX --enable-comms=mpi-auto --prefix= +../configure --enable-simd=AVX --enable-comms=mpi-auto --prefix= ``` -where `--enable-precision=` set the default precision, -`--enable-simd=` set the SIMD type, `--enable- +where `--enable-simd=` set the SIMD type, `--enable- comms=`, and `` should be replaced by the prefix path where you want to install Grid. Other options are detailed in the next section, you can also use `configure --help` to display them. Like with any other program using GNU autotool, the @@ -150,8 +149,8 @@ If you want to build all the tests at once just use `make tests`. - `--enable-numa`: enable NUMA first touch optimisation - `--enable-simd=`: setup Grid for the SIMD target `` (default: `GEN`). A list of possible SIMD targets is detailed in a section below. - `--enable-gen-simd-width=`: select the size (in bytes) of the generic SIMD vector type (default: 32 bytes). -- `--enable-precision={single|double}`: set the default precision (default: `double`). -- `--enable-precision=`: Use `` for message passing (default: `none`). A list of possible SIMD targets is detailed in a section below. +- `--enable-precision={single|double}`: set the default precision (default: `double`). **Deprecated option** +- `--enable-comms=`: Use `` for message passing (default: `none`). A list of possible SIMD targets is detailed in a section below. - `--enable-rng={sitmo|ranlux48|mt19937}`: choose the RNG (default: `sitmo `). - `--disable-timers`: disable system dependent high-resolution timers. - `--enable-chroma`: enable Chroma regression tests. @@ -205,8 +204,7 @@ Alternatively, some CPU codenames can be directly used: The following configuration is recommended for the Intel Knights Landing platform: ``` bash -../configure --enable-precision=double\ - --enable-simd=KNL \ +../configure --enable-simd=KNL \ --enable-comms=mpi-auto \ --enable-mkl \ CXX=icpc MPICXX=mpiicpc @@ -216,8 +214,7 @@ The MKL flag enables use of BLAS and FFTW from the Intel Math Kernels Library. If you are working on a Cray machine that does not use the `mpiicpc` wrapper, please use: ``` bash -../configure --enable-precision=double\ - --enable-simd=KNL \ +../configure --enable-simd=KNL \ --enable-comms=mpi \ --enable-mkl \ CXX=CC CC=cc @@ -236,8 +233,7 @@ for interior communication. This is the mpi3 communications implementation. We recommend four ranks per node for best performance, but optimum is local volume dependent. ``` bash -../configure --enable-precision=double\ - --enable-simd=KNL \ +../configure --enable-simd=KNL \ --enable-comms=mpi3-auto \ --enable-mkl \ CC=icpc MPICXX=mpiicpc @@ -248,8 +244,7 @@ We recommend four ranks per node for best performance, but optimum is local volu The following configuration is recommended for the Intel Haswell platform: ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX2 \ +../configure --enable-simd=AVX2 \ --enable-comms=mpi3-auto \ --enable-mkl \ CXX=icpc MPICXX=mpiicpc @@ -266,8 +261,7 @@ where `` is the UNIX prefix where GMP and MPFR are installed. If you are working on a Cray machine that does not use the `mpiicpc` wrapper, please use: ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX2 \ +../configure --enable-simd=AVX2 \ --enable-comms=mpi3 \ --enable-mkl \ CXX=CC CC=cc @@ -284,8 +278,7 @@ This is the default. The following configuration is recommended for the Intel Skylake platform: ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX512 \ +../configure --enable-simd=AVX512 \ --enable-comms=mpi3 \ --enable-mkl \ CXX=mpiicpc @@ -302,8 +295,7 @@ where `` is the UNIX prefix where GMP and MPFR are installed. If you are working on a Cray machine that does not use the `mpiicpc` wrapper, please use: ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX512 \ +../configure --enable-simd=AVX512 \ --enable-comms=mpi3 \ --enable-mkl \ CXX=CC CC=cc @@ -334,8 +326,7 @@ and 8 threads per rank. The following configuration is recommended for the AMD EPYC platform. ``` bash -../configure --enable-precision=double\ - --enable-simd=AVX2 \ +../configure --enable-simd=AVX2 \ --enable-comms=mpi3 \ CXX=mpicxx ``` diff --git a/SVE_README.txt b/SVE_README.txt index 0c167c4a..cefec4be 100644 --- a/SVE_README.txt +++ b/SVE_README.txt @@ -12,31 +12,31 @@ module load mpi/openmpi-aarch64 scl enable gcc-toolset-10 bash -../configure --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=none --enable-openmp CXX=g++ CC=gcc CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FXFIXEDSIZE -DA64FXASM -DDSLASHINTRIN" +../configure --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=none --enable-openmp CXX=g++ CC=gcc CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FXFIXEDSIZE -DA64FXASM -DDSLASHINTRIN" * gcc 10.1 prebuild w/ MPI, QPACE4 interactive login scl enable gcc-toolset-10 bash module load mpi/openmpi-aarch64 -../configure --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=mpi-auto --enable-shm=shmget --enable-openmp CXX=mpicxx CC=mpicc CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FXFIXEDSIZE -DA64FXASM -DDSLASHINTRIN" +../configure --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=mpi-auto --enable-shm=shmget --enable-openmp CXX=mpicxx CC=mpicc CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FXFIXEDSIZE -DA64FXASM -DDSLASHINTRIN" ------------------------------------------------------------------------------ * armclang 20.2 (qp4) -../configure --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=none --enable-openmp CXX=armclang++ CC=armclang CXXFLAGS="-std=c++11 -mcpu=a64fx -DA64FX -DARMCLANGCOMPAT -DA64FXASM -DDSLASHINTRIN" +../configure --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=none --enable-openmp CXX=armclang++ CC=armclang CXXFLAGS="-std=c++11 -mcpu=a64fx -DA64FX -DARMCLANGCOMPAT -DA64FXASM -DDSLASHINTRIN" ------------------------------------------------------------------------------ * gcc 10.0.1 VLA (merlin) -../configure --with-lime=/home/men04359/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=none --enable-openmp CXX=g++-10.0.1 CC=gcc-10.0.1 CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FX -DA64FXASM -DDSLASHINTRIN" LDFLAGS=-static GRID_LDFLAGS=-static MPI_CXXLDFLAGS=-static +../configure --with-lime=/home/men04359/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=none --enable-openmp CXX=g++-10.0.1 CC=gcc-10.0.1 CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FX -DA64FXASM -DDSLASHINTRIN" LDFLAGS=-static GRID_LDFLAGS=-static MPI_CXXLDFLAGS=-static * gcc 10.0.1 fixed-size ACLE (merlin) -../configure --with-lime=/home/men04359/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=none --enable-openmp CXX=g++-10.0.1 CC=gcc-10.0.1 CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FXFIXEDSIZE -DA64FXASM -DDSLASHINTRIN" +../configure --with-lime=/home/men04359/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=none --enable-openmp CXX=g++-10.0.1 CC=gcc-10.0.1 CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FXFIXEDSIZE -DA64FXASM -DDSLASHINTRIN" * gcc 10.0.1 fixed-size ACLE (fjt) w/ MPI @@ -46,34 +46,34 @@ export OMPI_CXX=g++-10.0.1 export MPICH_CC=gcc-10.0.1 export MPICH_CXX=g++-10.0.1 -$ ../configure --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=mpi3 --enable-openmp CXX=mpiFCC CC=mpifcc CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FXFIXEDSIZE -DA64FXASM -DDSLASHINTRIN -DTOFU -I/opt/FJSVxtclanga/tcsds-1.2.25/include/mpi/fujitsu -lrt" LDFLAGS="-L/opt/FJSVxtclanga/tcsds-1.2.25/lib64 -lrt" +$ ../configure --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=mpi3 --enable-openmp CXX=mpiFCC CC=mpifcc CXXFLAGS="-std=c++11 -march=armv8-a+sve -msve-vector-bits=512 -fno-gcse -DA64FXFIXEDSIZE -DA64FXASM -DDSLASHINTRIN -DTOFU -I/opt/FJSVxtclanga/tcsds-1.2.25/include/mpi/fujitsu -lrt" LDFLAGS="-L/opt/FJSVxtclanga/tcsds-1.2.25/lib64 -lrt" -------------------------------------------------------- * armclang 20.0 VLA (merlin) -../configure --with-lime=/home/men04359/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=none --enable-openmp CXX=armclang++ CC=armclang CXXFLAGS="-std=c++11 -fno-unroll-loops -mllvm -vectorizer-min-trip-count=2 -march=armv8-a+sve -DARMCLANGCOMPAT -DA64FX -DA64FXASM -DDSLASHINTRIN" LDFLAGS=-static GRID_LDFLAGS=-static MPI_CXXLDFLAGS=-static +../configure --with-lime=/home/men04359/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=none --enable-openmp CXX=armclang++ CC=armclang CXXFLAGS="-std=c++11 -fno-unroll-loops -mllvm -vectorizer-min-trip-count=2 -march=armv8-a+sve -DARMCLANGCOMPAT -DA64FX -DA64FXASM -DDSLASHINTRIN" LDFLAGS=-static GRID_LDFLAGS=-static MPI_CXXLDFLAGS=-static TODO check ARMCLANGCOMPAT * armclang 20.1 VLA (merlin) -../configure --with-lime=/home/men04359/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=none --enable-openmp CXX=armclang++ CC=armclang CXXFLAGS="-std=c++11 -mcpu=a64fx -DARMCLANGCOMPAT -DA64FX -DA64FXASM -DDSLASHINTRIN" LDFLAGS=-static GRID_LDFLAGS=-static MPI_CXXLDFLAGS=-static +../configure --with-lime=/home/men04359/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=none --enable-openmp CXX=armclang++ CC=armclang CXXFLAGS="-std=c++11 -mcpu=a64fx -DARMCLANGCOMPAT -DA64FX -DA64FXASM -DDSLASHINTRIN" LDFLAGS=-static GRID_LDFLAGS=-static MPI_CXXLDFLAGS=-static TODO check ARMCLANGCOMPAT * armclang 20.1 VLA (fjt cluster) -../configure --with-lime=$HOME/local --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=none --enable-openmp CXX=armclang++ CC=armclang CXXFLAGS="-std=c++11 -mcpu=a64fx -DARMCLANGCOMPAT -DA64FX -DA64FXASM -DDSLASHINTRIN -DTOFU" +../configure --with-lime=$HOME/local --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=none --enable-openmp CXX=armclang++ CC=armclang CXXFLAGS="-std=c++11 -mcpu=a64fx -DARMCLANGCOMPAT -DA64FX -DA64FXASM -DDSLASHINTRIN -DTOFU" TODO check ARMCLANGCOMPAT * armclang 20.1 VLA w/MPI (fjt cluster) -../configure --with-lime=$HOME/local --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=mpi3 --enable-openmp CXX=mpiFCC CC=mpifcc CXXFLAGS="-std=c++11 -mcpu=a64fx -DA64FX -DA64FXASM -DDSLASHINTRIN -DTOFU -I/opt/FJSVxtclanga/tcsds-1.2.25/include/mpi/fujitsu -lrt" LDFLAGS="-L/opt/FJSVxtclanga/tcsds-1.2.25/lib64" +../configure --with-lime=$HOME/local --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=mpi3 --enable-openmp CXX=mpiFCC CC=mpifcc CXXFLAGS="-std=c++11 -mcpu=a64fx -DA64FX -DA64FXASM -DDSLASHINTRIN -DTOFU -I/opt/FJSVxtclanga/tcsds-1.2.25/include/mpi/fujitsu -lrt" LDFLAGS="-L/opt/FJSVxtclanga/tcsds-1.2.25/lib64" No ARMCLANGCOMPAT -> still correct ? @@ -81,9 +81,9 @@ No ARMCLANGCOMPAT -> still correct ? * Fujitsu fcc -../configure --with-lime=$HOME/grid-a64fx/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=none --enable-openmp --with-mpfr=/home/users/gre/gre-1/grid-a64fx/mpfr-build/install CXX=FCC CC=fcc CXXFLAGS="-Nclang -Kfast -DA64FX -DA64FXASM -DDSLASHINTRIN" +../configure --with-lime=$HOME/grid-a64fx/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=none --enable-openmp --with-mpfr=/home/users/gre/gre-1/grid-a64fx/mpfr-build/install CXX=FCC CC=fcc CXXFLAGS="-Nclang -Kfast -DA64FX -DA64FXASM -DDSLASHINTRIN" * Fujitsu fcc w/ MPI -../configure --with-lime=$HOME/grid-a64fx/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-precision=double --enable-comms=mpi --enable-openmp --with-mpfr=/home/users/gre/gre-1/grid-a64fx/mpfr-build/install CXX=mpiFCC CC=mpifcc CXXFLAGS="-Nclang -Kfast -DA64FX -DA64FXASM -DDSLASHINTRIN -DTOFU" +../configure --with-lime=$HOME/grid-a64fx/lime/c-lime --without-hdf5 --enable-gen-simd-width=64 --enable-simd=GEN --enable-comms=mpi --enable-openmp --with-mpfr=/home/users/gre/gre-1/grid-a64fx/mpfr-build/install CXX=mpiFCC CC=mpifcc CXXFLAGS="-Nclang -Kfast -DA64FX -DA64FXASM -DDSLASHINTRIN -DTOFU" diff --git a/benchmarks/Benchmark_IO.cc b/benchmarks/Benchmark_IO.cc index c8c0937f..87e7224d 100644 --- a/benchmarks/Benchmark_IO.cc +++ b/benchmarks/Benchmark_IO.cc @@ -1,10 +1,18 @@ - #include "Benchmark_IO.hpp" -#ifndef BENCH_IO_LMAX -#define BENCH_IO_LMAX 40 +#ifndef BENCH_IO_LMIN +#define BENCH_IO_LMIN 8 #endif +#ifndef BENCH_IO_LMAX +#define BENCH_IO_LMAX 32 +#endif + +#ifndef BENCH_IO_NPASS +#define BENCH_IO_NPASS 10 +#endif + +#ifdef HAVE_LIME using namespace Grid; std::string filestem(const int l) @@ -12,37 +20,182 @@ std::string filestem(const int l) return "iobench_l" + std::to_string(l); } +int vol(const int i) +{ + return BENCH_IO_LMIN + 2*i; +} + +int volInd(const int l) +{ + return (l - BENCH_IO_LMIN)/2; +} + +template +void stats(Mat &mean, Mat &stdDev, const std::vector &data) +{ + auto nr = data[0].rows(), nc = data[0].cols(); + Eigen::MatrixXd sqSum(nr, nc); + double n = static_cast(data.size()); + + assert(n > 1.); + mean = Mat::Zero(nr, nc); + sqSum = Mat::Zero(nr, nc); + for (auto &d: data) + { + mean += d; + sqSum += d.cwiseProduct(d); + } + stdDev = ((sqSum - mean.cwiseProduct(mean)/n)/(n - 1.)).cwiseSqrt(); + mean /= n; +} + +#define grid_printf(...) \ +{\ + char _buf[1024];\ + sprintf(_buf, __VA_ARGS__);\ + MSG << _buf;\ +} + +enum {sRead = 0, sWrite = 1, gRead = 2, gWrite = 3}; + int main (int argc, char ** argv) { -#ifdef HAVE_LIME Grid_init(&argc,&argv); - int64_t threads = GridThread::GetThreads(); + int64_t threads = GridThread::GetThreads(); + auto mpi = GridDefaultMpi(); + unsigned int nVol = (BENCH_IO_LMAX - BENCH_IO_LMIN)/2 + 1; + unsigned int nRelVol = (BENCH_IO_LMAX - 24)/2 + 1; + std::vector perf(BENCH_IO_NPASS, Eigen::MatrixXd::Zero(nVol, 4)); + std::vector avPerf(BENCH_IO_NPASS, Eigen::VectorXd::Zero(4)); + std::vector latt; + MSG << "Grid is setup to use " << threads << " threads" << std::endl; - MSG << SEP << std::endl; - MSG << "Benchmark Lime write" << std::endl; - MSG << SEP << std::endl; - for (int l = 4; l <= BENCH_IO_LMAX; l += 2) + MSG << "MPI partition " << mpi << std::endl; + for (unsigned int i = 0; i < BENCH_IO_NPASS; ++i) { - auto mpi = GridDefaultMpi(); - std::vector latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]}; + MSG << BIGSEP << std::endl; + MSG << "Pass " << i + 1 << "/" << BENCH_IO_NPASS << std::endl; + MSG << BIGSEP << std::endl; + MSG << SEP << std::endl; + MSG << "Benchmark std write" << std::endl; + MSG << SEP << std::endl; + for (int l = BENCH_IO_LMIN; l <= BENCH_IO_LMAX; l += 2) + { + latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]}; - std::cout << "-- Local volume " << l << "^4" << std::endl; - writeBenchmark(latt, filestem(l), limeWrite); + MSG << "-- Local volume " << l << "^4" << std::endl; + writeBenchmark(latt, filestem(l), stdWrite); + perf[i](volInd(l), sWrite) = BinaryIO::lastPerf.mbytesPerSecond; + } + + MSG << SEP << std::endl; + MSG << "Benchmark std read" << std::endl; + MSG << SEP << std::endl; + for (int l = BENCH_IO_LMIN; l <= BENCH_IO_LMAX; l += 2) + { + latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]}; + + MSG << "-- Local volume " << l << "^4" << std::endl; + readBenchmark(latt, filestem(l), stdRead); + perf[i](volInd(l), sRead) = BinaryIO::lastPerf.mbytesPerSecond; + } + + #ifdef HAVE_LIME + MSG << SEP << std::endl; + MSG << "Benchmark Grid C-Lime write" << std::endl; + MSG << SEP << std::endl; + for (int l = BENCH_IO_LMIN; l <= BENCH_IO_LMAX; l += 2) + { + latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]}; + + MSG << "-- Local volume " << l << "^4" << std::endl; + writeBenchmark(latt, filestem(l), limeWrite); + perf[i](volInd(l), gWrite) = BinaryIO::lastPerf.mbytesPerSecond; + } + + MSG << SEP << std::endl; + MSG << "Benchmark Grid C-Lime read" << std::endl; + MSG << SEP << std::endl; + for (int l = BENCH_IO_LMIN; l <= BENCH_IO_LMAX; l += 2) + { + latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]}; + + MSG << "-- Local volume " << l << "^4" << std::endl; + readBenchmark(latt, filestem(l), limeRead); + perf[i](volInd(l), gRead) = BinaryIO::lastPerf.mbytesPerSecond; + } +#endif + avPerf[i].fill(0.); + for (int f = 0; f < 4; ++f) + for (int l = 24; l <= BENCH_IO_LMAX; l += 2) + { + avPerf[i](f) += perf[i](volInd(l), f); + } + avPerf[i] /= nRelVol; } - MSG << "Benchmark Lime read" << std::endl; - MSG << SEP << std::endl; - for (int l = 4; l <= BENCH_IO_LMAX; l += 2) - { - auto mpi = GridDefaultMpi(); - std::vector latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]}; + Eigen::MatrixXd mean(nVol, 4), stdDev(nVol, 4), rob(nVol, 4); + Eigen::VectorXd avMean(4), avStdDev(4), avRob(4); + double n = BENCH_IO_NPASS; - std::cout << "-- Local volume " << l << "^4" << std::endl; - readBenchmark(latt, filestem(l), limeRead); + stats(mean, stdDev, perf); + stats(avMean, avStdDev, avPerf); + rob.fill(100.); + rob -= 100.*stdDev.cwiseQuotient(mean.cwiseAbs()); + avRob.fill(100.); + avRob -= 100.*avStdDev.cwiseQuotient(avMean.cwiseAbs()); + + MSG << BIGSEP << std::endl; + MSG << "SUMMARY" << std::endl; + MSG << BIGSEP << std::endl; + MSG << "Summary of individual results (all results in MB/s)." << std::endl; + MSG << "Every second colum gives the standard deviation of the previous column." << std::endl; + MSG << std::endl; + grid_printf("%4s %12s %12s %12s %12s %12s %12s %12s %12s\n", + "L", "std read", "std dev", "std write", "std dev", + "Grid read", "std dev", "Grid write", "std dev"); + for (int l = BENCH_IO_LMIN; l <= BENCH_IO_LMAX; l += 2) + { + grid_printf("%4d %12.1f %12.1f %12.1f %12.1f %12.1f %12.1f %12.1f %12.1f\n", + l, mean(volInd(l), sRead), stdDev(volInd(l), sRead), + mean(volInd(l), sWrite), stdDev(volInd(l), sWrite), + mean(volInd(l), gRead), stdDev(volInd(l), gRead), + mean(volInd(l), gWrite), stdDev(volInd(l), gWrite)); } + MSG << std::endl; + MSG << "Robustness of individual results, in \%. (rob = 100\% - std dev / mean)" << std::endl; + MSG << std::endl; + grid_printf("%4s %12s %12s %12s %12s\n", + "L", "std read", "std write", "Grid read", "Grid write"); + for (int l = BENCH_IO_LMIN; l <= BENCH_IO_LMAX; l += 2) + { + grid_printf("%4d %12.1f %12.1f %12.1f %12.1f\n", + l, rob(volInd(l), sRead), rob(volInd(l), sWrite), + rob(volInd(l), gRead), rob(volInd(l), gWrite)); + } + MSG << std::endl; + MSG << "Summary of results averaged over local volumes 24^4-" << BENCH_IO_LMAX << "^4 (all results in MB/s)." << std::endl; + MSG << "Every second colum gives the standard deviation of the previous column." << std::endl; + MSG << std::endl; + grid_printf("%12s %12s %12s %12s %12s %12s %12s %12s\n", + "std read", "std dev", "std write", "std dev", + "Grid read", "std dev", "Grid write", "std dev"); + grid_printf("%12.1f %12.1f %12.1f %12.1f %12.1f %12.1f %12.1f %12.1f\n", + avMean(sRead), avStdDev(sRead), avMean(sWrite), avStdDev(sWrite), + avMean(gRead), avStdDev(gRead), avMean(gWrite), avStdDev(gWrite)); + MSG << std::endl; + MSG << "Robustness of volume-averaged results, in \%. (rob = 100\% - std dev / mean)" << std::endl; + MSG << std::endl; + grid_printf("%12s %12s %12s %12s\n", + "std read", "std write", "Grid read", "Grid write"); + grid_printf("%12.1f %12.1f %12.1f %12.1f\n", + avRob(sRead), avRob(sWrite), avRob(gRead), avRob(gWrite)); Grid_finalize(); -#endif + return EXIT_SUCCESS; } +#else +int main(int argc,char ** argv){} +#endif diff --git a/benchmarks/Benchmark_IO.hpp b/benchmarks/Benchmark_IO.hpp index d3416353..2ff42d52 100644 --- a/benchmarks/Benchmark_IO.hpp +++ b/benchmarks/Benchmark_IO.hpp @@ -2,10 +2,12 @@ #define Benchmark_IO_hpp_ #include -#ifdef HAVE_LIME #define MSG std::cout << GridLogMessage #define SEP \ +"-----------------------------------------------------------------------------" +#define BIGSEP \ "=============================================================================" +#ifdef HAVE_LIME namespace Grid { @@ -14,13 +16,152 @@ using WriterFn = std::function ; template using ReaderFn = std::function; +// AP 06/10/2020: Standard C version in case one is suspicious of the C++ API +// +// template +// void stdWrite(const std::string filestem, Field &vec) +// { +// std::string rankStr = std::to_string(vec.Grid()->ThisRank()); +// std::FILE *file = std::fopen((filestem + "." + rankStr + ".bin").c_str(), "wb"); +// size_t size; +// uint32_t crc; +// GridStopWatch ioWatch, crcWatch; + +// size = vec.Grid()->lSites()*sizeof(typename Field::scalar_object); +// autoView(vec_v, vec, CpuRead); +// crcWatch.Start(); +// crc = GridChecksum::crc32(vec_v.cpu_ptr, size); +// std::fwrite(&crc, sizeof(uint32_t), 1, file); +// crcWatch.Stop(); +// MSG << "Std I/O write: Data CRC32 " << std::hex << crc << std::dec << std::endl; +// ioWatch.Start(); +// std::fwrite(vec_v.cpu_ptr, sizeof(typename Field::scalar_object), vec.Grid()->lSites(), file); +// ioWatch.Stop(); +// std::fclose(file); +// size *= vec.Grid()->ProcessorCount(); +// auto &p = BinaryIO::lastPerf; +// p.size = size; +// p.time = ioWatch.useconds(); +// p.mbytesPerSecond = size/1024./1024./(ioWatch.useconds()/1.e6); +// MSG << "Std I/O write: Wrote " << p.size << " bytes in " << ioWatch.Elapsed() +// << ", " << p.mbytesPerSecond << " MB/s" << std::endl; +// MSG << "Std I/O write: checksum overhead " << crcWatch.Elapsed() << std::endl; +// } +// +// template +// void stdRead(Field &vec, const std::string filestem) +// { +// std::string rankStr = std::to_string(vec.Grid()->ThisRank()); +// std::FILE *file = std::fopen((filestem + "." + rankStr + ".bin").c_str(), "rb"); +// size_t size; +// uint32_t crcRead, crcData; +// GridStopWatch ioWatch, crcWatch; + +// size = vec.Grid()->lSites()*sizeof(typename Field::scalar_object); +// crcWatch.Start(); +// std::fread(&crcRead, sizeof(uint32_t), 1, file); +// crcWatch.Stop(); +// { +// autoView(vec_v, vec, CpuWrite); +// ioWatch.Start(); +// std::fread(vec_v.cpu_ptr, sizeof(typename Field::scalar_object), vec.Grid()->lSites(), file); +// ioWatch.Stop(); +// std::fclose(file); +// } +// { +// autoView(vec_v, vec, CpuRead); +// crcWatch.Start(); +// crcData = GridChecksum::crc32(vec_v.cpu_ptr, size); +// crcWatch.Stop(); +// } +// MSG << "Std I/O read: Data CRC32 " << std::hex << crcData << std::dec << std::endl; +// assert(crcData == crcRead); +// size *= vec.Grid()->ProcessorCount(); +// auto &p = BinaryIO::lastPerf; +// p.size = size; +// p.time = ioWatch.useconds(); +// p.mbytesPerSecond = size/1024./1024./(ioWatch.useconds()/1.e6); +// MSG << "Std I/O read: Read " << p.size << " bytes in " << ioWatch.Elapsed() +// << ", " << p.mbytesPerSecond << " MB/s" << std::endl; +// MSG << "Std I/O read: checksum overhead " << crcWatch.Elapsed() << std::endl; +// } + +template +void stdWrite(const std::string filestem, Field &vec) +{ + std::string rankStr = std::to_string(vec.Grid()->ThisRank()); + std::ofstream file(filestem + "." + rankStr + ".bin", std::ios::out | std::ios::binary); + size_t size, sizec; + uint32_t crc; + GridStopWatch ioWatch, crcWatch; + + size = vec.Grid()->lSites()*sizeof(typename Field::scalar_object); + sizec = size/sizeof(char); // just in case of... + autoView(vec_v, vec, CpuRead); + crcWatch.Start(); + crc = GridChecksum::crc32(vec_v.cpu_ptr, size); + file.write(reinterpret_cast(&crc), sizeof(uint32_t)/sizeof(char)); + crcWatch.Stop(); + MSG << "Std I/O write: Data CRC32 " << std::hex << crc << std::dec << std::endl; + ioWatch.Start(); + file.write(reinterpret_cast(vec_v.cpu_ptr), sizec); + file.flush(); + ioWatch.Stop(); + size *= vec.Grid()->ProcessorCount(); + auto &p = BinaryIO::lastPerf; + p.size = size; + p.time = ioWatch.useconds(); + p.mbytesPerSecond = size/1024./1024./(ioWatch.useconds()/1.e6); + MSG << "Std I/O write: Wrote " << p.size << " bytes in " << ioWatch.Elapsed() + << ", " << p.mbytesPerSecond << " MB/s" << std::endl; + MSG << "Std I/O write: checksum overhead " << crcWatch.Elapsed() << std::endl; +} + +template +void stdRead(Field &vec, const std::string filestem) +{ + std::string rankStr = std::to_string(vec.Grid()->ThisRank()); + std::ifstream file(filestem + "." + rankStr + ".bin", std::ios::in | std::ios::binary); + size_t size, sizec; + uint32_t crcRead, crcData; + GridStopWatch ioWatch, crcWatch; + + size = vec.Grid()->lSites()*sizeof(typename Field::scalar_object); + sizec = size/sizeof(char); // just in case of... + crcWatch.Start(); + file.read(reinterpret_cast(&crcRead), sizeof(uint32_t)/sizeof(char)); + crcWatch.Stop(); + { + autoView(vec_v, vec, CpuWrite); + ioWatch.Start(); + file.read(reinterpret_cast(vec_v.cpu_ptr), sizec); + ioWatch.Stop(); + } + { + autoView(vec_v, vec, CpuRead); + crcWatch.Start(); + crcData = GridChecksum::crc32(vec_v.cpu_ptr, size); + crcWatch.Stop(); + } + MSG << "Std I/O read: Data CRC32 " << std::hex << crcData << std::dec << std::endl; + assert(crcData == crcRead); + size *= vec.Grid()->ProcessorCount(); + auto &p = BinaryIO::lastPerf; + p.size = size; + p.time = ioWatch.useconds(); + p.mbytesPerSecond = size/1024./1024./(ioWatch.useconds()/1.e6); + MSG << "Std I/O read: Read " << p.size << " bytes in " << ioWatch.Elapsed() + << ", " << p.mbytesPerSecond << " MB/s" << std::endl; + MSG << "Std I/O read: checksum overhead " << crcWatch.Elapsed() << std::endl; +} + template void limeWrite(const std::string filestem, Field &vec) { emptyUserRecord record; ScidacWriter binWriter(vec.Grid()->IsBoss()); - binWriter.open(filestem + ".bin"); + binWriter.open(filestem + ".lime.bin"); binWriter.writeScidacFieldRecord(vec, record); binWriter.close(); } @@ -31,7 +172,7 @@ void limeRead(Field &vec, const std::string filestem) emptyUserRecord record; ScidacReader binReader; - binReader.open(filestem + ".bin"); + binReader.open(filestem + ".lime.bin"); binReader.readScidacFieldRecord(vec, record); binReader.close(); } @@ -73,12 +214,18 @@ void writeBenchmark(const Coordinate &latt, const std::string filename, auto simd = GridDefaultSimd(latt.size(), Field::vector_type::Nsimd()); std::shared_ptr gBasePt(SpaceTimeGrid::makeFourDimGrid(latt, simd, mpi)); std::shared_ptr gPt; + std::random_device rd; makeGrid(gPt, gBasePt, Ls, rb); - GridBase *g = gPt.get(); - GridParallelRNG rng(g); - Field vec(g); + GridBase *g = gPt.get(); + GridParallelRNG rng(g); + Field vec(g); + + rng.SeedFixedIntegers({static_cast(rd()), static_cast(rd()), + static_cast(rd()), static_cast(rd()), + static_cast(rd()), static_cast(rd()), + static_cast(rd()), static_cast(rd())}); random(rng, vec); write(filename, vec); @@ -96,8 +243,8 @@ void readBenchmark(const Coordinate &latt, const std::string filename, makeGrid(gPt, gBasePt, Ls, rb); - GridBase *g = gPt.get(); - Field vec(g); + GridBase *g = gPt.get(); + Field vec(g); read(vec, filename); } diff --git a/benchmarks/Benchmark_IO_vs_dir.cc b/benchmarks/Benchmark_IO_vs_dir.cc index 6e6c9ae0..8252547b 100644 --- a/benchmarks/Benchmark_IO_vs_dir.cc +++ b/benchmarks/Benchmark_IO_vs_dir.cc @@ -1,14 +1,9 @@ #include "Benchmark_IO.hpp" - -#define MSG std::cout << GridLogMessage -#define SEP \ -"=============================================================================" - +#ifdef HAVE_LIME using namespace Grid; int main (int argc, char ** argv) { -#ifdef HAVE_LIME std::vector dir; unsigned int Ls; bool rb; @@ -34,46 +29,74 @@ int main (int argc, char ** argv) } Grid_init(&argc,&argv); - int64_t threads = GridThread::GetThreads(); + auto mpi = GridDefaultMpi(); + MSG << "Grid is setup to use " << threads << " threads" << std::endl; - MSG << SEP << std::endl; - MSG << "Benchmark double precision Lime write" << std::endl; - MSG << SEP << std::endl; - for (auto &d: dir) - { - MSG << "-- Directory " << d << std::endl; - writeBenchmark(GridDefaultLatt(), d + "/ioBench", limeWrite, Ls, rb); - } + MSG << "MPI partition " << mpi << std::endl; MSG << SEP << std::endl; - MSG << "Benchmark double precision Lime read" << std::endl; + MSG << "Benchmark Grid std write" << std::endl; MSG << SEP << std::endl; for (auto &d: dir) { MSG << "-- Directory " << d << std::endl; - readBenchmark(GridDefaultLatt(), d + "/ioBench", limeRead, Ls, rb); + writeBenchmark(GridDefaultLatt(), d + "/ioBench", + stdWrite, Ls, rb); + } + MSG << SEP << std::endl; + MSG << "Benchmark Grid std read" << std::endl; + MSG << SEP << std::endl; + for (auto &d: dir) + { + MSG << "-- Directory " << d << std::endl; + readBenchmark(GridDefaultLatt(), d + "/ioBench", + stdRead, Ls, rb); } +#ifdef HAVE_LIME MSG << SEP << std::endl; - MSG << "Benchmark single precision Lime write" << std::endl; + MSG << "Benchmark Grid C-Lime write" << std::endl; MSG << SEP << std::endl; for (auto &d: dir) { MSG << "-- Directory " << d << std::endl; - writeBenchmark(GridDefaultLatt(), d + "/ioBench", limeWrite, Ls, rb); + writeBenchmark(GridDefaultLatt(), d + "/ioBench", + limeWrite, Ls, rb); } + MSG << SEP << std::endl; + MSG << "Benchmark Grid C-Lime read" << std::endl; + MSG << SEP << std::endl; + for (auto &d: dir) + { + MSG << "-- Directory " << d << std::endl; + readBenchmark(GridDefaultLatt(), d + "/ioBench", + limeRead, Ls, rb); + } +#endif - MSG << SEP << std::endl; - MSG << "Benchmark single precision Lime read" << std::endl; - MSG << SEP << std::endl; - for (auto &d: dir) - { - MSG << "-- Directory " << d << std::endl; - readBenchmark(GridDefaultLatt(), d + "/ioBench", limeRead, Ls, rb); - } + // MSG << SEP << std::endl; + // MSG << "Benchmark single precision Lime write" << std::endl; + // MSG << SEP << std::endl; + // for (auto &d: dir) + // { + // MSG << "-- Directory " << d << std::endl; + // writeBenchmark(GridDefaultLatt(), d + "/ioBench", limeWrite, Ls, rb); + // } + + // MSG << SEP << std::endl; + // MSG << "Benchmark single precision Lime read" << std::endl; + // MSG << SEP << std::endl; + // for (auto &d: dir) + // { + // MSG << "-- Directory " << d << std::endl; + // readBenchmark(GridDefaultLatt(), d + "/ioBench", limeRead, Ls, rb); + // } Grid_finalize(); -#endif + return EXIT_SUCCESS; } +#else +int main(int argc,char ** argv){} +#endif diff --git a/benchmarks/Benchmark_ITT.cc b/benchmarks/Benchmark_ITT.cc index dc09549c..5d602ce9 100644 --- a/benchmarks/Benchmark_ITT.cc +++ b/benchmarks/Benchmark_ITT.cc @@ -1,4 +1,4 @@ - /************************************************************************************* +/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid @@ -62,7 +62,7 @@ struct time_statistics{ void comms_header(){ std::cout <({45,12,81,9})); for(int lat=8;lat<=lmax;lat+=8){ @@ -247,11 +249,6 @@ public: double start=usecond(); for(int i=0;i > LatticeSU4; + + Coordinate simd_layout = GridDefaultSimd(Nd,vComplexF::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); + + std::cout<({45,12,81,9})); + for(int lat=8;lat<=lmax;lat+=8){ + + Coordinate latt_size ({lat*mpi_layout[0],lat*mpi_layout[1],lat*mpi_layout[2],lat*mpi_layout[3]}); + int64_t vol= latt_size[0]*latt_size[1]*latt_size[2]*latt_size[3]; + + GridCartesian Grid(latt_size,simd_layout,mpi_layout); + + NN =Grid.NodeCount(); + + + LatticeSU4 z(&Grid); z=Zero(); + LatticeSU4 x(&Grid); x=Zero(); + LatticeSU4 y(&Grid); y=Zero(); + double a=2.0; + + uint64_t Nloop=NLOOP; + + double start=usecond(); + for(int i=0;iRankCount(); @@ -291,11 +344,11 @@ public: NN_global=NN; uint64_t SHM=NP/NN; - Coordinate latt4({local[0]*mpi[0],local[1]*mpi[1],local[2]*mpi[2],local[3]*mpi[3]}); ///////// Welcome message //////////// std::cout<::HotConfiguration(RNG4,Umu); Fermion src (FGrid); random(RNG5,src); Fermion src_e (FrbGrid); Fermion src_o (FrbGrid); @@ -369,7 +422,7 @@ public: } FGrid->Barrier(); double t1=usecond(); - uint64_t ncall = 50; + uint64_t ncall = 500; FGrid->Broadcast(0,&ncall,sizeof(ncall)); @@ -387,7 +440,17 @@ public: FGrid->Barrier(); double volume=Ls; for(int mu=0;mumflops_best ) mflops_best = mflops; if ( mflopsRankCount(); @@ -447,7 +512,6 @@ public: NN_global=NN; uint64_t SHM=NP/NN; - Coordinate latt4({local[0]*mpi[0],local[1]*mpi[1],local[2]*mpi[2],local[3]*mpi[3]}); ///////// Welcome message //////////// std::cout<::HotConfiguration(RNG4,Umu); typename Action::ImplParams params; Action Ds(Umu,Umu,*FGrid,*FrbGrid,mass,c1,c2,u0,params); @@ -596,11 +660,12 @@ int main (int argc, char ** argv) #endif Benchmark::Decomposition(); + int do_su4=1; int do_memory=1; int do_comms =1; - int sel=2; - std::vector L_list({16,24,32}); + int sel=4; + std::vector L_list({8,12,16,24,32}); int selm1=sel-1; std::vector wilson; @@ -624,7 +689,6 @@ int main (int argc, char ** argv) dwf4.push_back(result); } - /* std::cout<1) ) { std::cout< > xbuf(8); - std::vector > rbuf(8); + std::vector > xbuf(8); + std::vector > rbuf(8); for(int mu=0;mu<8;mu++){ xbuf[mu].resize(lat*lat*lat*Ls); diff --git a/benchmarks/Benchmark_comms_host_device.cc b/benchmarks/Benchmark_comms_host_device.cc new file mode 100644 index 00000000..591b5597 --- /dev/null +++ b/benchmarks/Benchmark_comms_host_device.cc @@ -0,0 +1,260 @@ + /************************************************************************************* + + Grid physics library, www.github.com/paboyle/Grid + + Source file: ./benchmarks/Benchmark_comms.cc + + Copyright (C) 2015 + +Author: Peter Boyle + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + See the full license in the file "LICENSE" in the top level distribution directory + *************************************************************************************/ + /* END LEGAL */ +#include + +using namespace std; +using namespace Grid; + +struct time_statistics{ + double mean; + double err; + double min; + double max; + + void statistics(std::vector v){ + double sum = std::accumulate(v.begin(), v.end(), 0.0); + mean = sum / v.size(); + + std::vector diff(v.size()); + std::transform(v.begin(), v.end(), diff.begin(), [=](double x) { return x - mean; }); + double sq_sum = std::inner_product(diff.begin(), diff.end(), diff.begin(), 0.0); + err = std::sqrt(sq_sum / (v.size()*(v.size() - 1))); + + auto result = std::minmax_element(v.begin(), v.end()); + min = *result.first; + max = *result.second; +} +}; + +void header(){ + std::cout <1) nmu++; + + std::cout << GridLogMessage << "Number of iterations to average: "<< Nloop << std::endl; + std::vector t_time(Nloop); + time_statistics timestat; + + std::cout< > xbuf(8); + std::vector > rbuf(8); + + for(int mu=0;mu<8;mu++){ + xbuf[mu].resize(lat*lat*lat*Ls); + rbuf[mu].resize(lat*lat*lat*Ls); + } + uint64_t bytes=lat*lat*lat*Ls*sizeof(HalfSpinColourVectorD); + + int ncomm; + + for(int mu=0;mu<4;mu++){ + if (mpi_layout[mu]>1 ) { + double start=usecond(); + for(int i=0;i requests; + Grid.ShiftedRanks(mu,comm_proc,xmit_to_rank,recv_from_rank); + Grid.SendToRecvFrom((void *)&xbuf[mu][0], + xmit_to_rank, + (void *)&rbuf[mu][0], + recv_from_rank, + bytes); + } + + comm_proc = mpi_layout[mu]-1; + { + std::vector requests; + Grid.ShiftedRanks(mu,comm_proc,xmit_to_rank,recv_from_rank); + Grid.SendToRecvFrom((void *)&xbuf[mu+4][0], + xmit_to_rank, + (void *)&rbuf[mu+4][0], + recv_from_rank, + bytes); + } + } + Grid.Barrier(); + double stop=usecond(); + double mean=(stop-start)/Nloop; + double dbytes = bytes*ppn; + double xbytes = dbytes*2.0*ncomm; + double rbytes = xbytes; + double bidibytes = xbytes+rbytes; + + std::cout< xbuf(8); + std::vector rbuf(8); + + uint64_t bytes = lat*lat*lat*Ls*sizeof(HalfSpinColourVectorD); + for(int d=0;d<8;d++){ + xbuf[d] = (HalfSpinColourVectorD *)acceleratorAllocDevice(bytes); + rbuf[d] = (HalfSpinColourVectorD *)acceleratorAllocDevice(bytes); + } + + int ncomm; + + for(int mu=0;mu<4;mu++){ + if (mpi_layout[mu]>1 ) { + double start=usecond(); + for(int i=0;i requests; + Grid.ShiftedRanks(mu,comm_proc,xmit_to_rank,recv_from_rank); + Grid.SendToRecvFrom((void *)&xbuf[mu][0], + xmit_to_rank, + (void *)&rbuf[mu][0], + recv_from_rank, + bytes); + } + + comm_proc = mpi_layout[mu]-1; + { + std::vector requests; + Grid.ShiftedRanks(mu,comm_proc,xmit_to_rank,recv_from_rank); + Grid.SendToRecvFrom((void *)&xbuf[mu+4][0], + xmit_to_rank, + (void *)&rbuf[mu+4][0], + recv_from_rank, + bytes); + } + } + Grid.Barrier(); + double stop=usecond(); + double mean=(stop-start)/Nloop; + double dbytes = bytes*ppn; + double xbytes = dbytes*2.0*ncomm; + double rbytes = xbytes; + double bidibytes = xbytes+rbytes; + + std::cout<::HotConfiguration(RNG4,Umu); std::cout << GridLogMessage << "Random gauge initialised " << std::endl; #if 0 Umu=1.0; diff --git a/benchmarks/Benchmark_dwf_fp32.cc b/benchmarks/Benchmark_dwf_fp32.cc new file mode 100644 index 00000000..cb86177e --- /dev/null +++ b/benchmarks/Benchmark_dwf_fp32.cc @@ -0,0 +1,364 @@ + /************************************************************************************* + Grid physics library, www.github.com/paboyle/Grid + Source file: ./benchmarks/Benchmark_dwf.cc + Copyright (C) 2015 + + Author: Peter Boyle + Author: paboyle + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + See the full license in the file "LICENSE" in the top level distribution directory + *************************************************************************************/ + /* END LEGAL */ +#include +#ifdef GRID_CUDA +#define CUDA_PROFILE +#endif + +#ifdef CUDA_PROFILE +#include +#endif + +using namespace std; +using namespace Grid; + +template +struct scal { + d internal; +}; + + Gamma::Algebra Gmu [] = { + Gamma::Algebra::GammaX, + Gamma::Algebra::GammaY, + Gamma::Algebra::GammaZ, + Gamma::Algebra::GammaT + }; + + +int main (int argc, char ** argv) +{ + Grid_init(&argc,&argv); + + + int threads = GridThread::GetThreads(); + + Coordinate latt4 = GridDefaultLatt(); + int Ls=8; + for(int i=0;i> Ls; + } + + GridLogLayout(); + + long unsigned int single_site_flops = 8*Nc*(7+16*Nc); + + + GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplexF::Nsimd()),GridDefaultMpi()); + GridRedBlackCartesian * UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid); + GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid); + GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,UGrid); + + std::cout << GridLogMessage << "Making s innermost grids"< seeds4({1,2,3,4}); + std::vector seeds5({5,6,7,8}); + + std::cout << GridLogMessage << "Initialising 4d RNG" << std::endl; + GridParallelRNG RNG4(UGrid); RNG4.SeedUniqueString(std::string("The 4D RNG")); + std::cout << GridLogMessage << "Initialising 5d RNG" << std::endl; + GridParallelRNG RNG5(FGrid); RNG5.SeedUniqueString(std::string("The 5D RNG")); + std::cout << GridLogMessage << "Initialised RNGs" << std::endl; + + LatticeFermionF src (FGrid); random(RNG5,src); +#if 0 + src = Zero(); + { + Coordinate origin({0,0,0,latt4[2]-1,0}); + SpinColourVectorF tmp; + tmp=Zero(); + tmp()(0)(0)=Complex(-2.0,0.0); + std::cout << " source site 0 " << tmp<::HotConfiguration(RNG4,Umu); + std::cout << GridLogMessage << "Random gauge initialised " << std::endl; +#if 0 + Umu=1.0; + for(int mu=0;mu(Umu,mu); + // if (mu !=2 ) ttmp = 0; + // ttmp = ttmp* pow(10.0,mu); + PokeIndex(Umu,ttmp,mu); + } + std::cout << GridLogMessage << "Forced to diagonal " << std::endl; +#endif + + //////////////////////////////////// + // Naive wilson implementation + //////////////////////////////////// + // replicate across fifth dimension + LatticeGaugeFieldF Umu5d(FGrid); + std::vector U(4,FGrid); + { + autoView( Umu5d_v, Umu5d, CpuWrite); + autoView( Umu_v , Umu , CpuRead); + for(int ss=0;ssoSites();ss++){ + for(int s=0;s(Umu5d,mu); + } + std::cout << GridLogMessage << "Setting up Cshift based reference " << std::endl; + + if (1) + { + ref = Zero(); + for(int mu=0;mu_Nprocessors; + RealD NN = UGrid->NodeCount(); + + std::cout << GridLogMessage<< "*****************************************************************" <Barrier(); + Dw.ZeroCounters(); + Dw.Dhop(src,result,0); + std::cout<Barrier(); + + double volume=Ls; for(int mu=0;mu1.0e-4) ) { + /* + std::cout << "RESULT\n " << result<Barrier(); + exit(-1); + } + assert (norm2(err)< 1.0e-4 ); + Dw.Report(); + } + + if (1) + { // Naive wilson dag implementation + ref = Zero(); + for(int mu=0;mu1.0e-4)){ +/* + std::cout<< "DAG RESULT\n " <Barrier(); + Dw.DhopEO(src_o,r_e,DaggerNo); + double t0=usecond(); + for(int i=0;iBarrier(); + + double volume=Ls; for(int mu=0;mu1.0e-4)){ + /* + std::cout<< "Deo RESULT\n " <::HotConfiguration(RNG4,Umu); std::cout << GridLogMessage << "Random gauge initialised " << std::endl; RealD mass=0.1; diff --git a/benchmarks/Benchmark_mooee.cc b/benchmarks/Benchmark_mooee.cc index ef16c908..0aaccecc 100644 --- a/benchmarks/Benchmark_mooee.cc +++ b/benchmarks/Benchmark_mooee.cc @@ -30,7 +30,7 @@ Author: paboyle using namespace std; using namespace Grid; - ; + int main (int argc, char ** argv) @@ -53,7 +53,7 @@ int main (int argc, char ** argv) GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); std::cout << GridLogMessage << "Seeded"<::HotConfiguration(RNG4,Umu); std::cout << GridLogMessage << "made random gauge fields"< -where:: - - --enable-precision=single|double - -sets the **default precision**. Since this is largely a benchmarking convenience, it is anticipated that the default precision may be removed in future implementations, -and that explicit type selection be made at all points. Naturally, most code will be type templated in any case.:: +:: --enable-simd=GEN|SSE4|AVX|AVXFMA|AVXFMA4|AVX2|AVX512|NEONv8|QPX @@ -236,7 +231,7 @@ Detailed build configuration options --enable-mkl[=path] use Intel MKL for FFT (and LAPACK if enabled) routines. A UNIX prefix containing the library can be specified (optional). --enable-simd=code setup Grid for the SIMD target ``(default: `GEN`). A list of possible SIMD targets is detailed in a section below. --enable-gen-simd-width=size select the size (in bytes) of the generic SIMD vector type (default: 32 bytes). E.g. SSE 128 bit corresponds to 16 bytes. - --enable-precision=single|double set the default precision (default: `double`). + --enable-precision=single|double set the default precision (default: `double`). **Deprecated option** --enable-comms=mpi|none use `` for message passing (default: `none`). --enable-rng=sitmo|ranlux48|mt19937 choose the RNG (default: `sitmo`). --disable-timers disable system dependent high-resolution timers. @@ -304,8 +299,7 @@ Build setup for Intel Knights Landing platform The following configuration is recommended for the Intel Knights Landing platform:: - ../configure --enable-precision=double\ - --enable-simd=KNL \ + ../configure --enable-simd=KNL \ --enable-comms=mpi-auto \ --enable-mkl \ CXX=icpc MPICXX=mpiicpc @@ -314,8 +308,7 @@ The MKL flag enables use of BLAS and FFTW from the Intel Math Kernels Library. If you are working on a Cray machine that does not use the `mpiicpc` wrapper, please use:: - ../configure --enable-precision=double\ - --enable-simd=KNL \ + ../configure --enable-simd=KNL \ --enable-comms=mpi \ --enable-mkl \ CXX=CC CC=cc @@ -332,8 +325,7 @@ presently performs better with use of more than one rank per node, using shared for interior communication. We recommend four ranks per node for best performance, but optimum is local volume dependent. :: - ../configure --enable-precision=double\ - --enable-simd=KNL \ + ../configure --enable-simd=KNL \ --enable-comms=mpi-auto \ --enable-mkl \ CC=icpc MPICXX=mpiicpc @@ -343,8 +335,7 @@ Build setup for Intel Haswell Xeon platform The following configuration is recommended for the Intel Haswell platform:: - ../configure --enable-precision=double\ - --enable-simd=AVX2 \ + ../configure --enable-simd=AVX2 \ --enable-comms=mpi-auto \ --enable-mkl \ CXX=icpc MPICXX=mpiicpc @@ -360,8 +351,7 @@ where `` is the UNIX prefix where GMP and MPFR are installed. If you are working on a Cray machine that does not use the `mpiicpc` wrapper, please use:: - ../configure --enable-precision=double\ - --enable-simd=AVX2 \ + ../configure --enable-simd=AVX2 \ --enable-comms=mpi \ --enable-mkl \ CXX=CC CC=cc @@ -379,8 +369,7 @@ Build setup for Intel Skylake Xeon platform The following configuration is recommended for the Intel Skylake platform:: - ../configure --enable-precision=double\ - --enable-simd=AVX512 \ + ../configure --enable-simd=AVX512 \ --enable-comms=mpi \ --enable-mkl \ CXX=mpiicpc @@ -396,8 +385,7 @@ where `` is the UNIX prefix where GMP and MPFR are installed. If you are working on a Cray machine that does not use the `mpiicpc` wrapper, please use:: - ../configure --enable-precision=double\ - --enable-simd=AVX512 \ + ../configure --enable-simd=AVX512 \ --enable-comms=mpi \ --enable-mkl \ CXX=CC CC=cc @@ -422,8 +410,7 @@ and 8 threads per rank. The following configuration is recommended for the AMD EPYC platform:: - ../configure --enable-precision=double\ - --enable-simd=AVX2 \ + ../configure --enable-simd=AVX2 \ --enable-comms=mpi \ CXX=mpicxx diff --git a/scripts/filelist b/scripts/filelist index 78747315..27425a3e 100755 --- a/scripts/filelist +++ b/scripts/filelist @@ -26,11 +26,10 @@ for subdir in $dirs; do echo "tests-local: ${TESTLIST} " > Make.inc echo ${PREF}_PROGRAMS = ${TESTLIST} >> Make.inc echo >> Make.inc - HADLINK=`[ $subdir = './hadrons' ] && echo '-lHadrons '` for f in $TESTS; do BNAME=`basename $f .cc` echo ${BNAME}_SOURCES=$f >> Make.inc - echo ${BNAME}_LDADD=${HADLINK}-lGrid >> Make.inc + echo ${BNAME}_LDADD='$(top_builddir)/Grid/libGrid.a' >> Make.inc echo >> Make.inc done if [ $subdir != '.' ]; then @@ -49,7 +48,7 @@ echo >> Make.inc for f in $TESTS; do BNAME=`basename $f .cc` echo ${BNAME}_SOURCES=$f >> Make.inc - echo ${BNAME}_LDADD=-lGrid>> Make.inc + echo ${BNAME}_LDADD='$(top_builddir)/Grid/libGrid.a' >> Make.inc echo >> Make.inc done cd .. @@ -65,7 +64,7 @@ echo >> Make.inc for f in $TESTS; do BNAME=`basename $f .cc` echo ${BNAME}_SOURCES=$f >> Make.inc - echo ${BNAME}_LDADD=-lGrid>> Make.inc + echo ${BNAME}_LDADD='$(top_builddir)/Grid/libGrid.a'>> Make.inc echo >> Make.inc done cd .. diff --git a/tests/IO/Test_ildg_io.cc b/tests/IO/Test_ildg_io.cc index 369acfd1..d6e21101 100644 --- a/tests/IO/Test_ildg_io.cc +++ b/tests/IO/Test_ildg_io.cc @@ -69,7 +69,7 @@ int main (int argc, char ** argv) std::vector U(4,&Fine); - SU3::HotConfiguration(pRNGa,Umu); + SU::HotConfiguration(pRNGa,Umu); FieldMetaData header; diff --git a/tests/IO/Test_nersc_io.cc b/tests/IO/Test_nersc_io.cc index f5413e3b..c15c320e 100644 --- a/tests/IO/Test_nersc_io.cc +++ b/tests/IO/Test_nersc_io.cc @@ -84,7 +84,7 @@ int main (int argc, char ** argv) std::vector U(4,&Fine); - SU3::HotConfiguration(pRNGa,Umu); + SU::HotConfiguration(pRNGa,Umu); FieldMetaData header; std::string file("./ckpoint_lat.4000"); diff --git a/tests/Test_cayley_even_odd_vec.cc b/tests/Test_cayley_even_odd_vec.cc index 0e71d910..c345efd9 100644 --- a/tests/Test_cayley_even_odd_vec.cc +++ b/tests/Test_cayley_even_odd_vec.cc @@ -80,7 +80,7 @@ int main (int argc, char ** argv) GridParallelRNG sRNG5(sFGrid); sRNG5.SeedFixedIntegers(seeds5); LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4,Umu); + SU::HotConfiguration(RNG4,Umu); RealD mass=0.1; RealD M5 =1.8; diff --git a/tests/Test_compressed_lanczos_hot_start.cc b/tests/Test_compressed_lanczos_hot_start.cc index 8eb7a921..dc22cfca 100644 --- a/tests/Test_compressed_lanczos_hot_start.cc +++ b/tests/Test_compressed_lanczos_hot_start.cc @@ -202,7 +202,7 @@ int main (int argc, char ** argv) { std::vector seeds4({1,2,3,4}); GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4,Umu); + SU::HotConfiguration(RNG4,Umu); // FieldMetaData header; // NerscIO::readConfiguration(Umu,header,Params.config); diff --git a/tests/Test_dwf_mixedcg_prec.cc b/tests/Test_dwf_mixedcg_prec.cc index be881db9..da0b54cd 100644 --- a/tests/Test_dwf_mixedcg_prec.cc +++ b/tests/Test_dwf_mixedcg_prec.cc @@ -71,7 +71,7 @@ int main (int argc, char ** argv) LatticeGaugeFieldD Umu(UGrid); LatticeGaugeFieldF Umu_f(UGrid_f); - SU3::HotConfiguration(RNG4,Umu); + SU::HotConfiguration(RNG4,Umu); precisionChange(Umu_f,Umu); diff --git a/tests/Test_dwf_mixedcg_prec_halfcomms.cc b/tests/Test_dwf_mixedcg_prec_halfcomms.cc index 4d94632c..8b0126dc 100644 --- a/tests/Test_dwf_mixedcg_prec_halfcomms.cc +++ b/tests/Test_dwf_mixedcg_prec_halfcomms.cc @@ -69,7 +69,7 @@ int main (int argc, char ** argv) LatticeGaugeFieldD Umu(UGrid); LatticeGaugeFieldF Umu_f(UGrid_f); - SU3::HotConfiguration(RNG4,Umu); + SU::HotConfiguration(RNG4,Umu); precisionChange(Umu_f,Umu); diff --git a/tests/core/Test_cf_coarsen_support.cc b/tests/core/Test_cf_coarsen_support.cc index e787905e..ad0309b9 100644 --- a/tests/core/Test_cf_coarsen_support.cc +++ b/tests/core/Test_cf_coarsen_support.cc @@ -64,7 +64,7 @@ int main (int argc, char ** argv) LatticeFermion ref(FGrid); ref=Zero(); LatticeFermion tmp(FGrid); LatticeFermion err(FGrid); - LatticeGaugeField Umu(UGrid); SU3::HotConfiguration(RNG4,Umu); + LatticeGaugeField Umu(UGrid); SU::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); for(int mu=0;mu::HotConfiguration(RNG4,Umu); // std::vector U(4,UGrid); // for(int mu=0;mu::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); RealD mass=0.1; diff --git a/tests/core/Test_dwf_eofa_even_odd.cc b/tests/core/Test_dwf_eofa_even_odd.cc index 01fff9ea..64701069 100644 --- a/tests/core/Test_dwf_eofa_even_odd.cc +++ b/tests/core/Test_dwf_eofa_even_odd.cc @@ -73,7 +73,7 @@ int main (int argc, char ** argv) LatticeFermion ref (FGrid); ref = Zero(); LatticeFermion tmp (FGrid); tmp = Zero(); LatticeFermion err (FGrid); err = Zero(); - LatticeGaugeField Umu (UGrid); SU3::HotConfiguration(RNG4, Umu); + LatticeGaugeField Umu (UGrid); SU::HotConfiguration(RNG4, Umu); std::vector U(4,UGrid); // Only one non-zero (y) diff --git a/tests/core/Test_dwf_even_odd.cc b/tests/core/Test_dwf_even_odd.cc index 6093ee8f..4918f02a 100644 --- a/tests/core/Test_dwf_even_odd.cc +++ b/tests/core/Test_dwf_even_odd.cc @@ -72,7 +72,7 @@ int main (int argc, char ** argv) LatticeFermion ref(FGrid); ref=Zero(); LatticeFermion tmp(FGrid); tmp=Zero(); LatticeFermion err(FGrid); tmp=Zero(); - LatticeGaugeField Umu(UGrid); SU3::HotConfiguration(RNG4,Umu); + LatticeGaugeField Umu(UGrid); SU::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); // Only one non-zero (y) diff --git a/tests/core/Test_fft.cc b/tests/core/Test_fft.cc index 2ba3752b..212b1a35 100644 --- a/tests/core/Test_fft.cc +++ b/tests/core/Test_fft.cc @@ -138,7 +138,7 @@ int main (int argc, char ** argv) LatticeGaugeFieldD Umu(&GRID); - SU3::ColdConfiguration(pRNG,Umu); // Unit gauge + SU::ColdConfiguration(pRNG,Umu); // Unit gauge // Umu=Zero(); //////////////////////////////////////////////////// // Wilson test diff --git a/tests/core/Test_fft_gfix.cc b/tests/core/Test_fft_gfix.cc index 228770a8..87dbc242 100644 --- a/tests/core/Test_fft_gfix.cc +++ b/tests/core/Test_fft_gfix.cc @@ -73,11 +73,11 @@ int main (int argc, char ** argv) LatticeColourMatrix xform2(&GRID); // Gauge xform LatticeColourMatrix xform3(&GRID); // Gauge xform - SU3::ColdConfiguration(pRNG,Umu); // Unit gauge + SU::ColdConfiguration(pRNG,Umu); // Unit gauge Uorg=Umu; Urnd=Umu; - SU3::RandomGaugeTransform(pRNG,Urnd,g); // Unit gauge + SU::RandomGaugeTransform(pRNG,Urnd,g); // Unit gauge Real plaq=WilsonLoops::avgPlaquette(Umu); std::cout << " Initial plaquette "<::HotConfiguration(pRNG,Umu); // Unit gauge plaq=WilsonLoops::avgPlaquette(Umu); std::cout << " Initial plaquette "<::HotConfiguration(pRNG,Umu); // Unit gauge plaq=WilsonLoops::avgPlaquette(Umu); std::cout << " Initial plaquette "<::HotConfiguration(RNG4_2f,Umu_2f); StandardFermionField src (FGrid_2f); StandardFermionField tmpsrc(FGrid_2f); diff --git a/tests/core/Test_gpwilson_even_odd.cc b/tests/core/Test_gpwilson_even_odd.cc index bf37f4d5..69ace859 100644 --- a/tests/core/Test_gpwilson_even_odd.cc +++ b/tests/core/Test_gpwilson_even_odd.cc @@ -61,7 +61,7 @@ int main (int argc, char ** argv) FermionField ref(&Grid); ref=Zero(); FermionField tmp(&Grid); tmp=Zero(); FermionField err(&Grid); tmp=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); std::vector U(4,&Grid); double volume=1; diff --git a/tests/core/Test_lie_generators.cc b/tests/core/Test_lie_generators.cc index 471cea25..e044378c 100644 --- a/tests/core/Test_lie_generators.cc +++ b/tests/core/Test_lie_generators.cc @@ -66,7 +66,7 @@ int main(int argc, char** argv) { std::cout << GridLogMessage << "*********************************************" << std::endl; - std::cout << GridLogMessage << "* Generators for SU(3)" << std::endl; + std::cout << GridLogMessage << "* Generators for SU(Nc" << std::endl; std::cout << GridLogMessage << "*********************************************" << std::endl; SU3::printGenerators(); @@ -114,8 +114,8 @@ int main(int argc, char** argv) { LatticeGaugeField U(grid), V(grid); - SU::HotConfiguration(gridRNG, U); - SU::HotConfiguration(gridRNG, V); + SU3::HotConfiguration(gridRNG, U); + SU3::HotConfiguration(gridRNG, V); // Adjoint representation // Test group structure @@ -123,8 +123,8 @@ int main(int argc, char** argv) { LatticeGaugeField UV(grid); UV = Zero(); for (int mu = 0; mu < Nd; mu++) { - SU::LatticeMatrix Umu = peekLorentz(U,mu); - SU::LatticeMatrix Vmu = peekLorentz(V,mu); + SU3::LatticeMatrix Umu = peekLorentz(U,mu); + SU3::LatticeMatrix Vmu = peekLorentz(V,mu); pokeLorentz(UV,Umu*Vmu, mu); } @@ -151,16 +151,16 @@ int main(int argc, char** argv) { // Check correspondence of algebra and group transformations // Create a random vector - SU::LatticeAlgebraVector h_adj(grid); + SU3::LatticeAlgebraVector h_adj(grid); typename AdjointRep::LatticeMatrix Ar(grid); random(gridRNG,h_adj); h_adj = real(h_adj); SU_Adjoint::AdjointLieAlgebraMatrix(h_adj,Ar); // Re-extract h_adj - SU::LatticeAlgebraVector h_adj2(grid); + SU3::LatticeAlgebraVector h_adj2(grid); SU_Adjoint::projectOnAlgebra(h_adj2, Ar); - SU::LatticeAlgebraVector h_diff = h_adj - h_adj2; + SU3::LatticeAlgebraVector h_diff = h_adj - h_adj2; std::cout << GridLogMessage << "Projections structure check vector difference (Adjoint representation) : " << norm2(h_diff) << std::endl; // Exponentiate @@ -183,14 +183,14 @@ int main(int argc, char** argv) { // Construct the fundamental matrix in the group - SU::LatticeMatrix Af(grid); - SU::FundamentalLieAlgebraMatrix(h_adj,Af); - SU::LatticeMatrix Ufund(grid); + SU3::LatticeMatrix Af(grid); + SU3::FundamentalLieAlgebraMatrix(h_adj,Af); + SU3::LatticeMatrix Ufund(grid); Ufund = expMat(Af, 1.0, 16); // Check unitarity - SU::LatticeMatrix uno_f(grid); + SU3::LatticeMatrix uno_f(grid); uno_f = 1.0; - SU::LatticeMatrix UnitCheck(grid); + SU3::LatticeMatrix UnitCheck(grid); UnitCheck = Ufund * adj(Ufund) - uno_f; std::cout << GridLogMessage << "unitarity check 1: " << norm2(UnitCheck) << std::endl; @@ -311,14 +311,14 @@ int main(int argc, char** argv) { // Test group structure // (U_f * V_f)_r = U_r * V_r LatticeGaugeField U2(grid), V2(grid); - SU::HotConfiguration(gridRNG, U2); - SU::HotConfiguration(gridRNG, V2); + SU3::HotConfiguration(gridRNG, U2); + SU3::HotConfiguration(gridRNG, V2); LatticeGaugeField UV2(grid); UV2 = Zero(); for (int mu = 0; mu < Nd; mu++) { - SU::LatticeMatrix Umu2 = peekLorentz(U2,mu); - SU::LatticeMatrix Vmu2 = peekLorentz(V2,mu); + SU3::LatticeMatrix Umu2 = peekLorentz(U2,mu); + SU3::LatticeMatrix Vmu2 = peekLorentz(V2,mu); pokeLorentz(UV2,Umu2*Vmu2, mu); } @@ -345,16 +345,16 @@ int main(int argc, char** argv) { // Check correspondence of algebra and group transformations // Create a random vector - SU::LatticeAlgebraVector h_sym(grid); + SU3::LatticeAlgebraVector h_sym(grid); typename TwoIndexRep< Nc, Symmetric>::LatticeMatrix Ar_sym(grid); random(gridRNG,h_sym); h_sym = real(h_sym); SU_TwoIndex::TwoIndexLieAlgebraMatrix(h_sym,Ar_sym); // Re-extract h_sym - SU::LatticeAlgebraVector h_sym2(grid); + SU3::LatticeAlgebraVector h_sym2(grid); SU_TwoIndex< Nc, Symmetric>::projectOnAlgebra(h_sym2, Ar_sym); - SU::LatticeAlgebraVector h_diff_sym = h_sym - h_sym2; + SU3::LatticeAlgebraVector h_diff_sym = h_sym - h_sym2; std::cout << GridLogMessage << "Projections structure check vector difference (Two Index Symmetric): " << norm2(h_diff_sym) << std::endl; @@ -379,11 +379,11 @@ int main(int argc, char** argv) { // Construct the fundamental matrix in the group - SU::LatticeMatrix Af_sym(grid); - SU::FundamentalLieAlgebraMatrix(h_sym,Af_sym); - SU::LatticeMatrix Ufund2(grid); + SU3::LatticeMatrix Af_sym(grid); + SU3::FundamentalLieAlgebraMatrix(h_sym,Af_sym); + SU3::LatticeMatrix Ufund2(grid); Ufund2 = expMat(Af_sym, 1.0, 16); - SU::LatticeMatrix UnitCheck2(grid); + SU3::LatticeMatrix UnitCheck2(grid); UnitCheck2 = Ufund2 * adj(Ufund2) - uno_f; std::cout << GridLogMessage << "unitarity check 1: " << norm2(UnitCheck2) << std::endl; @@ -421,14 +421,14 @@ int main(int argc, char** argv) { // Test group structure // (U_f * V_f)_r = U_r * V_r LatticeGaugeField U2A(grid), V2A(grid); - SU::HotConfiguration(gridRNG, U2A); - SU::HotConfiguration(gridRNG, V2A); + SU3::HotConfiguration(gridRNG, U2A); + SU3::HotConfiguration(gridRNG, V2A); LatticeGaugeField UV2A(grid); UV2A = Zero(); for (int mu = 0; mu < Nd; mu++) { - SU::LatticeMatrix Umu2A = peekLorentz(U2,mu); - SU::LatticeMatrix Vmu2A = peekLorentz(V2,mu); + SU3::LatticeMatrix Umu2A = peekLorentz(U2,mu); + SU3::LatticeMatrix Vmu2A = peekLorentz(V2,mu); pokeLorentz(UV2A,Umu2A*Vmu2A, mu); } @@ -455,16 +455,16 @@ int main(int argc, char** argv) { // Check correspondence of algebra and group transformations // Create a random vector - SU::LatticeAlgebraVector h_Asym(grid); + SU3::LatticeAlgebraVector h_Asym(grid); typename TwoIndexRep< Nc, AntiSymmetric>::LatticeMatrix Ar_Asym(grid); random(gridRNG,h_Asym); h_Asym = real(h_Asym); SU_TwoIndex< Nc, AntiSymmetric>::TwoIndexLieAlgebraMatrix(h_Asym,Ar_Asym); // Re-extract h_sym - SU::LatticeAlgebraVector h_Asym2(grid); + SU3::LatticeAlgebraVector h_Asym2(grid); SU_TwoIndex< Nc, AntiSymmetric>::projectOnAlgebra(h_Asym2, Ar_Asym); - SU::LatticeAlgebraVector h_diff_Asym = h_Asym - h_Asym2; + SU3::LatticeAlgebraVector h_diff_Asym = h_Asym - h_Asym2; std::cout << GridLogMessage << "Projections structure check vector difference (Two Index anti-Symmetric): " << norm2(h_diff_Asym) << std::endl; @@ -489,11 +489,11 @@ int main(int argc, char** argv) { // Construct the fundamental matrix in the group - SU::LatticeMatrix Af_Asym(grid); - SU::FundamentalLieAlgebraMatrix(h_Asym,Af_Asym); - SU::LatticeMatrix Ufund2A(grid); + SU3::LatticeMatrix Af_Asym(grid); + SU3::FundamentalLieAlgebraMatrix(h_Asym,Af_Asym); + SU3::LatticeMatrix Ufund2A(grid); Ufund2A = expMat(Af_Asym, 1.0, 16); - SU::LatticeMatrix UnitCheck2A(grid); + SU3::LatticeMatrix UnitCheck2A(grid); UnitCheck2A = Ufund2A * adj(Ufund2A) - uno_f; std::cout << GridLogMessage << "unitarity check 1: " << norm2(UnitCheck2A) << std::endl; diff --git a/tests/core/Test_main.cc b/tests/core/Test_main.cc index af8b747b..d7ed04ba 100644 --- a/tests/core/Test_main.cc +++ b/tests/core/Test_main.cc @@ -444,7 +444,7 @@ int main(int argc, char **argv) { // Lattice 12x12 GEMM scFooBar = scFoo * scBar; - // Benchmark some simple operations LatticeSU3 * Lattice SU3. + // Benchmark some simple operations LatticeSU * Lattice SU. double t0, t1, flops; double bytes; int ncall = 5000; diff --git a/tests/core/Test_mobius_eofa_even_odd.cc b/tests/core/Test_mobius_eofa_even_odd.cc index 68091229..7339f156 100644 --- a/tests/core/Test_mobius_eofa_even_odd.cc +++ b/tests/core/Test_mobius_eofa_even_odd.cc @@ -73,7 +73,7 @@ int main (int argc, char ** argv) LatticeFermion ref (FGrid); ref = Zero(); LatticeFermion tmp (FGrid); tmp = Zero(); LatticeFermion err (FGrid); err = Zero(); - LatticeGaugeField Umu (UGrid); SU3::HotConfiguration(RNG4, Umu); + LatticeGaugeField Umu (UGrid); SU::HotConfiguration(RNG4, Umu); std::vector U(4,UGrid); // Only one non-zero (y) diff --git a/tests/core/Test_quenched_update.cc b/tests/core/Test_quenched_update.cc index ef428d1b..22675913 100644 --- a/tests/core/Test_quenched_update.cc +++ b/tests/core/Test_quenched_update.cc @@ -55,7 +55,7 @@ int main (int argc, char ** argv) GridParallelRNG pRNG(grid); pRNG.SeedFixedIntegers(pseeds); GridSerialRNG sRNG; sRNG.SeedFixedIntegers(sseeds); - // SU3 colour operatoions + // SU colour operatoions LatticeColourMatrix link(grid); LatticeColourMatrix staple(grid); @@ -87,10 +87,10 @@ int main (int argc, char ** argv) link = PeekIndex(Umu,mu); - for( int subgroup=0;subgroup::su2subgroups();subgroup++ ) { // update Even checkerboard - SU3::SubGroupHeatBath(sRNG,pRNG,beta,link,staple,subgroup,20,mask); + SU::SubGroupHeatBath(sRNG,pRNG,beta,link,staple,subgroup,20,mask); } diff --git a/tests/core/Test_reunitarise.cc b/tests/core/Test_reunitarise.cc new file mode 100644 index 00000000..3e78b961 --- /dev/null +++ b/tests/core/Test_reunitarise.cc @@ -0,0 +1,137 @@ + /************************************************************************************* + + Grid physics library, www.github.com/paboyle/Grid + + Source file: ./tests/Test_quenched_update.cc + + Copyright (C) 2015 + +Author: Azusa Yamaguchi +Author: Peter Boyle + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + See the full license in the file "LICENSE" in the top level distribution directory + *************************************************************************************/ + /* END LEGAL */ +#include + +using namespace std; +using namespace Grid; + ; + +int main (int argc, char ** argv) +{ + Grid_init(&argc,&argv); + + std::vector latt({8,8,8,8}); + GridCartesian * grid = SpaceTimeGrid::makeFourDimGrid(latt, + GridDefaultSimd(Nd,vComplexD::Nsimd()), + GridDefaultMpi()); + + GridCartesian * gridF = SpaceTimeGrid::makeFourDimGrid(latt, + GridDefaultSimd(Nd,vComplexF::Nsimd()), + GridDefaultMpi()); + + + /////////////////////////////// + // Configuration of known size + /////////////////////////////// + LatticeColourMatrixD ident(grid); + LatticeColourMatrixD U(grid); + LatticeColourMatrixD UU(grid); + LatticeColourMatrixD tmp(grid); + LatticeColourMatrixD org(grid); + LatticeColourMatrixF UF(gridF); + + LatticeGaugeField Umu(grid); + + ident =1.0; + + // RNG set up for test + std::vector pseeds({1,2,3,4,5}); // once I caught a fish alive + std::vector sseeds({6,7,8,9,10});// then i let it go again + GridParallelRNG pRNG(grid); pRNG.SeedFixedIntegers(pseeds); + GridSerialRNG sRNG; sRNG.SeedFixedIntegers(sseeds); + + SU::HotConfiguration(pRNG,Umu); + + U = PeekIndex(Umu,0); + org=U; + + + tmp= U*adj(U) - ident ; + RealD Def1 = norm2( tmp ); + std::cout << " Defect1 "<(U,Nc-1,i); + element = element * phase; + PokeIndex(U,element,Nc-1,i); + } + UU=U; + + detU= Determinant(U) ; + std::cout << "Determinant after screw up " <(UU); + detUU= Determinant(UU); + std::cout << "Determinant ProjectSUn " <::HotConfiguration(pRNG,Umu); std::vector U(4,&Grid); diff --git a/tests/core/Test_staggered5D.cc b/tests/core/Test_staggered5D.cc index 3d175890..6ab15873 100644 --- a/tests/core/Test_staggered5D.cc +++ b/tests/core/Test_staggered5D.cc @@ -75,7 +75,7 @@ int main (int argc, char ** argv) FermionField phi (FGrid); random(pRNG5,phi); FermionField chi (FGrid); random(pRNG5,chi); - LatticeGaugeField Umu(UGrid); SU3::ColdConfiguration(pRNG4,Umu); + LatticeGaugeField Umu(UGrid); SU::ColdConfiguration(pRNG4,Umu); LatticeGaugeField Umua(UGrid); Umua=Umu; double volume=Ls; diff --git a/tests/core/Test_staggered5Dvec.cc b/tests/core/Test_staggered5Dvec.cc index 73241276..ef8da662 100644 --- a/tests/core/Test_staggered5Dvec.cc +++ b/tests/core/Test_staggered5Dvec.cc @@ -84,7 +84,7 @@ int main (int argc, char ** argv) FermionField chi (FGrid); random(pRNG5,chi); LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(pRNG4,Umu); + SU::HotConfiguration(pRNG4,Umu); /* for(int mu=1;mu<4;mu++){ diff --git a/tests/core/Test_staggered5DvecF.cc b/tests/core/Test_staggered5DvecF.cc index 2386d054..6893551c 100644 --- a/tests/core/Test_staggered5DvecF.cc +++ b/tests/core/Test_staggered5DvecF.cc @@ -83,7 +83,7 @@ int main (int argc, char ** argv) FermionField chi (FGrid); random(pRNG5,chi); LatticeGaugeFieldF Umu(UGrid); - SU3::HotConfiguration(pRNG4,Umu); + SU::HotConfiguration(pRNG4,Umu); /* for(int mu=1;mu<4;mu++){ diff --git a/tests/core/Test_staggered_naive.cc b/tests/core/Test_staggered_naive.cc index 9fe35a54..f41d723d 100644 --- a/tests/core/Test_staggered_naive.cc +++ b/tests/core/Test_staggered_naive.cc @@ -64,7 +64,7 @@ int main (int argc, char ** argv) FermionField err(&Grid); tmp=Zero(); FermionField phi (&Grid); random(pRNG,phi); FermionField chi (&Grid); random(pRNG,chi); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); std::vector U(4,&Grid); diff --git a/tests/core/Test_unary.cc b/tests/core/Test_unary.cc new file mode 100644 index 00000000..2ad6ba7b --- /dev/null +++ b/tests/core/Test_unary.cc @@ -0,0 +1,106 @@ + /************************************************************************************* + + Grid physics library, www.github.com/paboyle/Grid + + Source file: ./tests/Test_quenched_update.cc + + Copyright (C) 2015 + +Author: Azusa Yamaguchi +Author: Peter Boyle + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + See the full license in the file "LICENSE" in the top level distribution directory + *************************************************************************************/ + /* END LEGAL */ +#include + +using namespace std; +using namespace Grid; + ; + +int main (int argc, char ** argv) +{ + Grid_init(&argc,&argv); + + std::vector latt({8,8,8,8}); + GridCartesian * grid = SpaceTimeGrid::makeFourDimGrid(latt, + GridDefaultSimd(Nd,vComplexD::Nsimd()), + GridDefaultMpi()); + + GridCartesian * gridF = SpaceTimeGrid::makeFourDimGrid(latt, + GridDefaultSimd(Nd,vComplexF::Nsimd()), + GridDefaultMpi()); + + + /////////////////////////////// + // Configuration of known size + /////////////////////////////// + LatticeColourMatrixD ident(grid); + LatticeColourMatrixD U(grid); + LatticeColourMatrixD tmp(grid); + LatticeColourMatrixD org(grid); + LatticeColourMatrixF UF(gridF); + + LatticeGaugeField Umu(grid); + + ident =1.0; + + // RNG set up for test + std::vector pseeds({1,2,3,4,5}); // once I caught a fish alive + std::vector sseeds({6,7,8,9,10});// then i let it go again + GridParallelRNG pRNG(grid); pRNG.SeedFixedIntegers(pseeds); + GridSerialRNG sRNG; sRNG.SeedFixedIntegers(sseeds); + + SU::HotConfiguration(pRNG,Umu); + + U = PeekIndex(Umu,0); + org=U; + + + tmp= U*adj(U) - ident ; + RealD Def1 = norm2( tmp ); + std::cout << " Defect1 "<::HotConfiguration(pRNG, Umu); std::vector U(4, &Grid); double volume = 1; diff --git a/tests/core/Test_wilson_even_odd.cc b/tests/core/Test_wilson_even_odd.cc index dc49cf81..e7733a79 100644 --- a/tests/core/Test_wilson_even_odd.cc +++ b/tests/core/Test_wilson_even_odd.cc @@ -70,7 +70,7 @@ int main (int argc, char ** argv) LatticeFermion tmp(&Grid); tmp=Zero(); LatticeFermion err(&Grid); tmp=Zero(); LatticeGaugeField Umu(&Grid); - SU3::HotConfiguration(pRNG,Umu); + SU::HotConfiguration(pRNG,Umu); std::vector U(4,&Grid); double volume=1; diff --git a/tests/core/Test_wilson_twisted_mass_even_odd.cc b/tests/core/Test_wilson_twisted_mass_even_odd.cc index ba80fd0e..e0f73456 100644 --- a/tests/core/Test_wilson_twisted_mass_even_odd.cc +++ b/tests/core/Test_wilson_twisted_mass_even_odd.cc @@ -71,7 +71,7 @@ int main (int argc, char ** argv) LatticeFermion ref(&Grid); ref=Zero(); LatticeFermion tmp(&Grid); tmp=Zero(); LatticeFermion err(&Grid); tmp=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); std::vector U(4,&Grid); double volume=1; diff --git a/tests/debug/Test_cayley_cg.cc b/tests/debug/Test_cayley_cg.cc index 5a9c696f..5418a8af 100644 --- a/tests/debug/Test_cayley_cg.cc +++ b/tests/debug/Test_cayley_cg.cc @@ -116,7 +116,7 @@ int main (int argc, char ** argv) LatticeGaugeField Umu(UGrid); LatticeGaugeFieldF UmuF(UGridF); - SU3::HotConfiguration(RNG4,Umu); + SU::HotConfiguration(RNG4,Umu); precisionChange(UmuF,Umu); std::vector U(4,UGrid); diff --git a/tests/debug/Test_cayley_coarsen_support.cc b/tests/debug/Test_cayley_coarsen_support.cc index e91b3070..b2f691d7 100644 --- a/tests/debug/Test_cayley_coarsen_support.cc +++ b/tests/debug/Test_cayley_coarsen_support.cc @@ -77,7 +77,7 @@ int main (int argc, char ** argv) LatticeFermion ref(FGrid); ref=Zero(); LatticeFermion tmp(FGrid); LatticeFermion err(FGrid); - LatticeGaugeField Umu(UGrid); SU3::HotConfiguration(RNG4,Umu); + LatticeGaugeField Umu(UGrid); SU::HotConfiguration(RNG4,Umu); #if 0 std::vector U(4,UGrid); diff --git a/tests/debug/Test_cayley_even_odd.cc b/tests/debug/Test_cayley_even_odd.cc index 433f0722..5e800b26 100644 --- a/tests/debug/Test_cayley_even_odd.cc +++ b/tests/debug/Test_cayley_even_odd.cc @@ -70,7 +70,7 @@ int main (int argc, char ** argv) GridParallelRNG RNG5(FGrid); RNG5.SeedFixedIntegers(seeds5); GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); - LatticeGaugeField Umu(UGrid); SU3::HotConfiguration(RNG4,Umu); + LatticeGaugeField Umu(UGrid); SU::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); RealD mass=0.1; diff --git a/tests/debug/Test_cayley_ldop_cr.cc b/tests/debug/Test_cayley_ldop_cr.cc index 82f388ab..416017e5 100644 --- a/tests/debug/Test_cayley_ldop_cr.cc +++ b/tests/debug/Test_cayley_ldop_cr.cc @@ -71,9 +71,9 @@ int main (int argc, char ** argv) std::string file("./ckpoint_lat.400"); NerscIO::readConfiguration(Umu,header,file); - // SU3::ColdConfiguration(RNG4,Umu); - // SU3::TepidConfiguration(RNG4,Umu); - // SU3::HotConfiguration(RNG4,Umu); + // SU::ColdConfiguration(RNG4,Umu); + // SU::TepidConfiguration(RNG4,Umu); + // SU::HotConfiguration(RNG4,Umu); // Umu=Zero(); RealD mass=0.1; diff --git a/tests/debug/Test_cayley_mres.cc b/tests/debug/Test_cayley_mres.cc index 2ad605b8..2e56fa81 100644 --- a/tests/debug/Test_cayley_mres.cc +++ b/tests/debug/Test_cayley_mres.cc @@ -108,8 +108,8 @@ int main (int argc, char ** argv) GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); LatticeGaugeField Umu(UGrid); - SU3::ColdConfiguration(Umu); - // SU3::HotConfiguration(RNG4,Umu); + SU::ColdConfiguration(Umu); + // SU::HotConfiguration(RNG4,Umu); RealD mass=0.3; RealD M5 =1.0; diff --git a/tests/debug/Test_heatbath_dwf_eofa.cc b/tests/debug/Test_heatbath_dwf_eofa.cc index 1e64a568..9d453a96 100644 --- a/tests/debug/Test_heatbath_dwf_eofa.cc +++ b/tests/debug/Test_heatbath_dwf_eofa.cc @@ -73,7 +73,7 @@ int main(int argc, char** argv) // Random gauge field LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); DomainWallEOFAFermionR Lop(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mf, mf, mpv, 0.0, -1, M5); DomainWallEOFAFermionR Rop(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mpv, mf, mpv, -1.0, 1, M5); diff --git a/tests/debug/Test_heatbath_dwf_eofa_gparity.cc b/tests/debug/Test_heatbath_dwf_eofa_gparity.cc index cc118d1d..22cc1e90 100644 --- a/tests/debug/Test_heatbath_dwf_eofa_gparity.cc +++ b/tests/debug/Test_heatbath_dwf_eofa_gparity.cc @@ -77,7 +77,7 @@ int main(int argc, char** argv) // Random gauge field LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); // GparityDomainWallFermionR::ImplParams params; FermionAction::ImplParams params; diff --git a/tests/debug/Test_heatbath_mobius_eofa.cc b/tests/debug/Test_heatbath_mobius_eofa.cc index 95ab935e..4cf4bf53 100644 --- a/tests/debug/Test_heatbath_mobius_eofa.cc +++ b/tests/debug/Test_heatbath_mobius_eofa.cc @@ -75,7 +75,7 @@ int main(int argc, char** argv) // Random gauge field LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); MobiusEOFAFermionR Lop(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mf, mf, mpv, 0.0, -1, M5, b, c); MobiusEOFAFermionR Rop(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mpv, mf, mpv, -1.0, 1, M5, b, c); diff --git a/tests/debug/Test_heatbath_mobius_eofa_gparity.cc b/tests/debug/Test_heatbath_mobius_eofa_gparity.cc index 7ed3a308..2fcb4b9f 100644 --- a/tests/debug/Test_heatbath_mobius_eofa_gparity.cc +++ b/tests/debug/Test_heatbath_mobius_eofa_gparity.cc @@ -79,7 +79,7 @@ int main(int argc, char** argv) // Random gauge field LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); FermionAction::ImplParams params; FermionAction Lop(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mf, mf, mpv, 0.0, -1, M5, b, c, params); diff --git a/tests/debug/Test_reweight_dwf_eofa.cc b/tests/debug/Test_reweight_dwf_eofa.cc index 728fbf78..a150b18f 100644 --- a/tests/debug/Test_reweight_dwf_eofa.cc +++ b/tests/debug/Test_reweight_dwf_eofa.cc @@ -102,7 +102,7 @@ int main(int argc, char **argv) // Random gauge field LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); // Initialize RHMC fermion operators DomainWallFermionR Ddwf_f(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mf, M5); diff --git a/tests/debug/Test_reweight_dwf_eofa_gparity.cc b/tests/debug/Test_reweight_dwf_eofa_gparity.cc index fcc01b8d..df2d95a0 100644 --- a/tests/debug/Test_reweight_dwf_eofa_gparity.cc +++ b/tests/debug/Test_reweight_dwf_eofa_gparity.cc @@ -104,7 +104,7 @@ int main(int argc, char **argv) // Random gauge field LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); // Initialize RHMC fermion operators GparityDomainWallFermionR::ImplParams params; diff --git a/tests/debug/Test_reweight_mobius_eofa.cc b/tests/debug/Test_reweight_mobius_eofa.cc index c5e46bcf..88ecab7d 100644 --- a/tests/debug/Test_reweight_mobius_eofa.cc +++ b/tests/debug/Test_reweight_mobius_eofa.cc @@ -104,7 +104,7 @@ int main(int argc, char **argv) // Random gauge field LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); // Initialize RHMC fermion operators MobiusFermionR Ddwf_f(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mf, M5, b, c); diff --git a/tests/debug/Test_reweight_mobius_eofa_gparity.cc b/tests/debug/Test_reweight_mobius_eofa_gparity.cc index bfc7543a..31708265 100644 --- a/tests/debug/Test_reweight_mobius_eofa_gparity.cc +++ b/tests/debug/Test_reweight_mobius_eofa_gparity.cc @@ -106,7 +106,7 @@ int main(int argc, char **argv) // Random gauge field LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); // Initialize RHMC fermion operators GparityDomainWallFermionR::ImplParams params; diff --git a/tests/forces/Test_contfrac_force.cc b/tests/forces/Test_contfrac_force.cc index cb30faad..dc9eedce 100644 --- a/tests/forces/Test_contfrac_force.cc +++ b/tests/forces/Test_contfrac_force.cc @@ -59,7 +59,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -93,7 +93,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom,mommu,mu); diff --git a/tests/forces/Test_dwf_force.cc b/tests/forces/Test_dwf_force.cc index 81a1b8c4..e7d17347 100644 --- a/tests/forces/Test_dwf_force.cc +++ b/tests/forces/Test_dwf_force.cc @@ -60,7 +60,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -94,7 +94,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom,mommu,mu); diff --git a/tests/forces/Test_dwf_force_eofa.cc b/tests/forces/Test_dwf_force_eofa.cc index 0b0ba346..80d36934 100644 --- a/tests/forces/Test_dwf_force_eofa.cc +++ b/tests/forces/Test_dwf_force_eofa.cc @@ -72,7 +72,7 @@ int main (int argc, char** argv) LatticeFermion MphiPrime (FGrid); LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -105,7 +105,7 @@ int main (int argc, char** argv) for(int mu=0; mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom, mommu, mu); diff --git a/tests/forces/Test_dwf_gpforce.cc b/tests/forces/Test_dwf_gpforce.cc index b39fdd14..28133cc6 100644 --- a/tests/forces/Test_dwf_gpforce.cc +++ b/tests/forces/Test_dwf_gpforce.cc @@ -63,8 +63,8 @@ int main (int argc, char ** argv) LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); - // SU3::ColdConfiguration(pRNG,U); + SU::HotConfiguration(RNG4,U); + // SU::ColdConfiguration(pRNG,U); //////////////////////////////////// // Unmodified matrix element @@ -112,7 +112,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg Hmom -= real(sum(trace(mommu*mommu))); diff --git a/tests/forces/Test_dwf_gpforce_eofa.cc b/tests/forces/Test_dwf_gpforce_eofa.cc index 58258a5e..7e480e7a 100644 --- a/tests/forces/Test_dwf_gpforce_eofa.cc +++ b/tests/forces/Test_dwf_gpforce_eofa.cc @@ -75,7 +75,7 @@ int main (int argc, char** argv) FermionField MphiPrime (FGrid); LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -109,7 +109,7 @@ int main (int argc, char** argv) for(int mu=0; mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom, mommu, mu); diff --git a/tests/forces/Test_gp_plaq_force.cc b/tests/forces/Test_gp_plaq_force.cc index 21f0b9d0..bc2b5b26 100644 --- a/tests/forces/Test_gp_plaq_force.cc +++ b/tests/forces/Test_gp_plaq_force.cc @@ -51,7 +51,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(&Grid); - SU3::HotConfiguration(pRNG,U); + SU::HotConfiguration(pRNG,U); double beta = 1.0; ConjugateWilsonGaugeActionR Action(beta); @@ -80,7 +80,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(pRNG, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom,mommu,mu); diff --git a/tests/forces/Test_gp_rect_force.cc b/tests/forces/Test_gp_rect_force.cc index bb4ea6de..98ebb2fa 100644 --- a/tests/forces/Test_gp_rect_force.cc +++ b/tests/forces/Test_gp_rect_force.cc @@ -54,7 +54,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(&Grid); - SU3::HotConfiguration(pRNG,U); + SU::HotConfiguration(pRNG,U); double beta = 1.0; double c1 = 0.331; @@ -82,7 +82,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(pRNG, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom,mommu,mu); diff --git a/tests/forces/Test_gpdwf_force.cc b/tests/forces/Test_gpdwf_force.cc index bdc332d9..d6744080 100644 --- a/tests/forces/Test_gpdwf_force.cc +++ b/tests/forces/Test_gpdwf_force.cc @@ -63,7 +63,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -100,7 +100,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom,mommu,mu); diff --git a/tests/forces/Test_gpwilson_force.cc b/tests/forces/Test_gpwilson_force.cc index 1c85a5d9..d731f27a 100644 --- a/tests/forces/Test_gpwilson_force.cc +++ b/tests/forces/Test_gpwilson_force.cc @@ -57,7 +57,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -94,7 +94,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); PokeIndex(mom,mommu,mu); diff --git a/tests/forces/Test_laplacian_force.cc b/tests/forces/Test_laplacian_force.cc index 639378dc..18508860 100644 --- a/tests/forces/Test_laplacian_force.cc +++ b/tests/forces/Test_laplacian_force.cc @@ -58,7 +58,7 @@ int main (int argc, char ** argv) PokeIndex(P, P_mu, mu); } - SU3::HotConfiguration(pRNG,U); + SU::HotConfiguration(pRNG,U); ConjugateGradient CG(1.0e-8, 10000); @@ -95,7 +95,7 @@ int main (int argc, char ** argv) std::cout << GridLogMessage << "Update the U " << std::endl; for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(pRNG, mommu); auto Umu = PeekIndex(U, mu); PokeIndex(mom,mommu,mu); Umu = expMat(mommu, dt, 12) * Umu; diff --git a/tests/forces/Test_mobius_force.cc b/tests/forces/Test_mobius_force.cc index 11e69652..ba7bc363 100644 --- a/tests/forces/Test_mobius_force.cc +++ b/tests/forces/Test_mobius_force.cc @@ -60,7 +60,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -96,7 +96,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom,mommu,mu); diff --git a/tests/forces/Test_mobius_force_eofa.cc b/tests/forces/Test_mobius_force_eofa.cc index f85501fa..28523e9c 100644 --- a/tests/forces/Test_mobius_force_eofa.cc +++ b/tests/forces/Test_mobius_force_eofa.cc @@ -72,7 +72,7 @@ int main (int argc, char** argv) LatticeFermion MphiPrime (FGrid); LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -107,7 +107,7 @@ int main (int argc, char** argv) for(int mu=0; mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom, mommu, mu); diff --git a/tests/forces/Test_mobius_gpforce_eofa.cc b/tests/forces/Test_mobius_gpforce_eofa.cc index 68163e63..9c80b2aa 100644 --- a/tests/forces/Test_mobius_gpforce_eofa.cc +++ b/tests/forces/Test_mobius_gpforce_eofa.cc @@ -76,7 +76,7 @@ int main (int argc, char** argv) FermionField MphiPrime (FGrid); LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -112,7 +112,7 @@ int main (int argc, char** argv) for(int mu=0; mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom, mommu, mu); autoView( U_v , U, CpuRead); diff --git a/tests/forces/Test_partfrac_force.cc b/tests/forces/Test_partfrac_force.cc index 17dce530..33f7b5fd 100644 --- a/tests/forces/Test_partfrac_force.cc +++ b/tests/forces/Test_partfrac_force.cc @@ -62,7 +62,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -96,7 +96,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom,mommu,mu); diff --git a/tests/forces/Test_rect_force.cc b/tests/forces/Test_rect_force.cc index ed72f2c0..c9326f8d 100644 --- a/tests/forces/Test_rect_force.cc +++ b/tests/forces/Test_rect_force.cc @@ -54,7 +54,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(&Grid); - SU3::HotConfiguration(pRNG,U); + SU::HotConfiguration(pRNG,U); double beta = 1.0; double c1 = -0.331; @@ -82,7 +82,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(pRNG, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom,mommu,mu); diff --git a/tests/forces/Test_wilson_force.cc b/tests/forces/Test_wilson_force.cc index c8b3a7f4..b7bf1268 100644 --- a/tests/forces/Test_wilson_force.cc +++ b/tests/forces/Test_wilson_force.cc @@ -61,7 +61,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(&Grid); //SU2::HotConfiguration(pRNG,U); - SU3::ColdConfiguration(pRNG,U); + SU::ColdConfiguration(pRNG,U); //////////////////////////////////// // Unmodified matrix element @@ -98,7 +98,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(pRNG, mommu); Hmom -= real(sum(trace(mommu*mommu))); diff --git a/tests/forces/Test_wilsonclover_force.cc b/tests/forces/Test_wilsonclover_force.cc index f26f0ac9..6a28e4e2 100644 --- a/tests/forces/Test_wilsonclover_force.cc +++ b/tests/forces/Test_wilsonclover_force.cc @@ -62,8 +62,8 @@ int main(int argc, char **argv) LatticeGaugeField U(&Grid); - SU3::HotConfiguration(pRNG, U); - //SU3::ColdConfiguration(pRNG, U);// Clover term Zero() + SU::HotConfiguration(pRNG, U); + //SU::ColdConfiguration(pRNG, U);// Clover term Zero() //////////////////////////////////// // Unmodified matrix element @@ -101,7 +101,7 @@ int main(int argc, char **argv) for (int mu = 0; mu < Nd; mu++) { // Traceless antihermitian momentum; gaussian in lie alg - SU3::GaussianFundamentalLieAlgebraMatrix(pRNG, mommu); + SU::GaussianFundamentalLieAlgebraMatrix(pRNG, mommu); Hmom -= real(sum(trace(mommu * mommu))); PokeIndex(mom, mommu, mu); diff --git a/tests/forces/Test_zmobius_force.cc b/tests/forces/Test_zmobius_force.cc index e24ae601..89673bc7 100644 --- a/tests/forces/Test_zmobius_force.cc +++ b/tests/forces/Test_zmobius_force.cc @@ -59,7 +59,7 @@ int main (int argc, char ** argv) LatticeGaugeField U(UGrid); - SU3::HotConfiguration(RNG4,U); + SU::HotConfiguration(RNG4,U); //////////////////////////////////// // Unmodified matrix element @@ -109,7 +109,7 @@ int main (int argc, char ** argv) for(int mu=0;mu::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom,mommu,mu); diff --git a/tests/lanczos/Test_dwf_compressed_lanczos_reorg_synthetic.cc b/tests/lanczos/Test_dwf_compressed_lanczos_reorg_synthetic.cc index d9249e0d..3766e069 100644 --- a/tests/lanczos/Test_dwf_compressed_lanczos_reorg_synthetic.cc +++ b/tests/lanczos/Test_dwf_compressed_lanczos_reorg_synthetic.cc @@ -293,7 +293,7 @@ int main (int argc, char ** argv) { { std::vector seeds4({1,2,3,4}); GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); } std::cout << GridLogMessage << "Lattice dimensions: " << GridDefaultLatt() << " Ls: " << Ls << std::endl; diff --git a/tests/lanczos/Test_dwf_lanczos.cc b/tests/lanczos/Test_dwf_lanczos.cc index 12283921..00d29ec0 100644 --- a/tests/lanczos/Test_dwf_lanczos.cc +++ b/tests/lanczos/Test_dwf_lanczos.cc @@ -54,7 +54,7 @@ int main (int argc, char ** argv) GridParallelRNG RNG5rb(FrbGrid); RNG5.SeedFixedIntegers(seeds5); LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); std::vector U(4,UGrid); for(int mu=0;mu::HotConfiguration(RNG4, Umu); /* std::vector U(4, UGrid); diff --git a/tests/qdpxx/Test_qdpxx_baryon.cc b/tests/qdpxx/Test_qdpxx_baryon.cc index a1d8f738..d8225f82 100644 --- a/tests/qdpxx/Test_qdpxx_baryon.cc +++ b/tests/qdpxx/Test_qdpxx_baryon.cc @@ -280,7 +280,7 @@ void make_gauge(GaugeField &Umu, Grid::LatticePropagator &q1,Grid::LatticePropag Grid::GridCartesian *UGrid = (Grid::GridCartesian *)Umu.Grid(); Grid::GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); - Grid::SU3::HotConfiguration(RNG4, Umu); + Grid::SU::HotConfiguration(RNG4, Umu); // Propagator Grid::gaussian(RNG4, q1); diff --git a/tests/qdpxx/Test_qdpxx_loops_staples.cc b/tests/qdpxx/Test_qdpxx_loops_staples.cc index bbb41f4e..33057eeb 100644 --- a/tests/qdpxx/Test_qdpxx_loops_staples.cc +++ b/tests/qdpxx/Test_qdpxx_loops_staples.cc @@ -277,7 +277,7 @@ double calc_grid_p(Grid::LatticeGaugeField & Umu) Grid::GridCartesian * UGrid = (Grid::GridCartesian *) Umu.Grid(); Grid::GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); - Grid::SU3::HotConfiguration(RNG4,Umu); + Grid::SU::HotConfiguration(RNG4,Umu); Grid::LatticeColourMatrix tmp(UGrid); tmp = Grid::zero; diff --git a/tests/qdpxx/Test_qdpxx_munprec.cc b/tests/qdpxx/Test_qdpxx_munprec.cc index fbc1ec82..82874546 100644 --- a/tests/qdpxx/Test_qdpxx_munprec.cc +++ b/tests/qdpxx/Test_qdpxx_munprec.cc @@ -502,7 +502,7 @@ void calc_grid(ChromaAction action,Grid::LatticeGaugeField & Umu, Grid::LatticeF Grid::gaussian(RNG5,src); Grid::gaussian(RNG5,res); - Grid::SU3::HotConfiguration(RNG4,Umu); + Grid::SU::HotConfiguration(RNG4,Umu); /* Grid::LatticeColourMatrix U(UGrid); diff --git a/tests/qdpxx/Test_qdpxx_stag.cc b/tests/qdpxx/Test_qdpxx_stag.cc index f283d5a9..8f81fa99 100644 --- a/tests/qdpxx/Test_qdpxx_stag.cc +++ b/tests/qdpxx/Test_qdpxx_stag.cc @@ -333,7 +333,7 @@ void make_gauge(GaugeField & Umu,FermionField &src) Grid::GridCartesian * UGrid = (Grid::GridCartesian *) Umu.Grid(); Grid::GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); - Grid::SU3::HotConfiguration(RNG4,Umu); + Grid::SU::HotConfiguration(RNG4,Umu); Grid::gaussian(RNG4,src); } diff --git a/tests/qdpxx/Test_qdpxx_wilson.cc b/tests/qdpxx/Test_qdpxx_wilson.cc index fdf59982..8ce28dca 100644 --- a/tests/qdpxx/Test_qdpxx_wilson.cc +++ b/tests/qdpxx/Test_qdpxx_wilson.cc @@ -348,7 +348,7 @@ void make_gauge(GaugeField &Umu, FermionField &src) Grid::GridCartesian *UGrid = (Grid::GridCartesian *)Umu._grid; Grid::GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); - Grid::SU3::HotConfiguration(RNG4, Umu); + Grid::SU::HotConfiguration(RNG4, Umu); // Fermion field Grid::gaussian(RNG4, src); diff --git a/tests/smearing/Test_smearing.cc b/tests/smearing/Test_smearing.cc index c1c7c457..adab1c6e 100644 --- a/tests/smearing/Test_smearing.cc +++ b/tests/smearing/Test_smearing.cc @@ -47,8 +47,8 @@ int main (int argc, char ** argv) RealD nrm = norm2(src); LatticeFermion result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); - // SU3::HotConfiguration(pRNG,Umu); - SU3::ColdConfiguration(Umu); + // SU::HotConfiguration(pRNG,Umu); + SU::ColdConfiguration(Umu); std::vector U(4,&Grid); for(int mu=0;mu::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); for(int mu=0;mu::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); RealD mass=0.1; diff --git a/tests/solver/Test_dwf_cg_prec.cc b/tests/solver/Test_dwf_cg_prec.cc index cb53894f..debb736a 100644 --- a/tests/solver/Test_dwf_cg_prec.cc +++ b/tests/solver/Test_dwf_cg_prec.cc @@ -67,7 +67,7 @@ int main(int argc, char** argv) { result = Zero(); LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); std::cout << GridLogMessage << "Lattice dimensions: " << GridDefaultLatt() << " Ls: " << Ls << std::endl; diff --git a/tests/solver/Test_dwf_cg_schur.cc b/tests/solver/Test_dwf_cg_schur.cc index 6216c366..6541e73d 100644 --- a/tests/solver/Test_dwf_cg_schur.cc +++ b/tests/solver/Test_dwf_cg_schur.cc @@ -61,7 +61,7 @@ int main (int argc, char ** argv) LatticeFermion src(FGrid); random(RNG5,src); LatticeFermion result(FGrid); result=Zero(); - LatticeGaugeField Umu(UGrid); SU3::HotConfiguration(RNG4,Umu); + LatticeGaugeField Umu(UGrid); SU::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); for(int mu=0;mu::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); for(int mu=0;mu::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); diff --git a/tests/solver/Test_dwf_fpgcr.cc b/tests/solver/Test_dwf_fpgcr.cc index 156f678a..42cc8de1 100644 --- a/tests/solver/Test_dwf_fpgcr.cc +++ b/tests/solver/Test_dwf_fpgcr.cc @@ -68,7 +68,7 @@ int main (int argc, char ** argv) LatticeFermion result(FGrid); result=Zero(); LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4,Umu); + SU::HotConfiguration(RNG4,Umu); ConjugateResidual CR(1.0e-6,10000); diff --git a/tests/solver/Test_dwf_mrhs_cg.cc b/tests/solver/Test_dwf_mrhs_cg.cc index 982a8247..b912ba4f 100644 --- a/tests/solver/Test_dwf_mrhs_cg.cc +++ b/tests/solver/Test_dwf_mrhs_cg.cc @@ -93,7 +93,7 @@ int main (int argc, char ** argv) for(int s=0;s::HotConfiguration(pRNG,Umu); /////////////////////////////////////////////////////////////// // Bounce these fields to disk diff --git a/tests/solver/Test_dwf_mrhs_cg_mpi.cc b/tests/solver/Test_dwf_mrhs_cg_mpi.cc index 8ace9b43..d0a32460 100644 --- a/tests/solver/Test_dwf_mrhs_cg_mpi.cc +++ b/tests/solver/Test_dwf_mrhs_cg_mpi.cc @@ -136,11 +136,11 @@ int main (int argc, char ** argv) std::cout << GridLogMessage << "Intialising 4D RNG "<::HotConfiguration(pRNG,Umu); std::cout << GridLogMessage << "Intialised the HOT Gauge Field"<::ColdConfiguration(Umu); std::cout << GridLogMessage << "Intialised the COLD Gauge Field"<::HotConfiguration(pRNG,Umu); ///////////////// // MPI only sends diff --git a/tests/solver/Test_dwf_qmr_unprec.cc b/tests/solver/Test_dwf_qmr_unprec.cc index ba44ee93..370e7409 100644 --- a/tests/solver/Test_dwf_qmr_unprec.cc +++ b/tests/solver/Test_dwf_qmr_unprec.cc @@ -51,7 +51,7 @@ int main (int argc, char ** argv) LatticeFermion src(FGrid); random(RNG5,src); LatticeFermion result(FGrid); result=Zero(); - LatticeGaugeField Umu(UGrid); SU3::HotConfiguration(RNG4,Umu); + LatticeGaugeField Umu(UGrid); SU::HotConfiguration(RNG4,Umu); std::vector U(4,UGrid); diff --git a/tests/solver/Test_mobius_bcg.cc b/tests/solver/Test_mobius_bcg.cc index 8b34a6a5..8092d61c 100644 --- a/tests/solver/Test_mobius_bcg.cc +++ b/tests/solver/Test_mobius_bcg.cc @@ -128,7 +128,7 @@ int main (int argc, char ** argv) std::cout << GridLogMessage << "Intialising 4D RNG "<::HotConfiguration(pRNG,Umu); std::cout << GridLogMessage << "Intialised the HOT Gauge Field"<::HotConfiguration(pRNG,Umu); std::cout << GridLogMessage << "Intialised the HOT Gauge Field"<::ColdConfiguration(Umu); std::cout << GridLogMessage << "Intialised the COLD Gauge Field"<::HotConfiguration(pRNG,Umu); std::cout << GridLogMessage << "Intialised the HOT Gauge Field"<::ColdConfiguration(Umu); std::cout << GridLogMessage << "Intialised the COLD Gauge Field"<::HotConfiguration(pRNG,Umu); std::cout << GridLogMessage << "Intialised the HOT Gauge Field"<::ColdConfiguration(Umu); std::cout << GridLogMessage << "Intialised the COLD Gauge Field"<::HotConfiguration(pRNG,Umu); ///////////////// // MPI only sends diff --git a/tests/solver/Test_staggered_block_cg_prec.cc b/tests/solver/Test_staggered_block_cg_prec.cc index 2499fc8a..c5306e85 100644 --- a/tests/solver/Test_staggered_block_cg_prec.cc +++ b/tests/solver/Test_staggered_block_cg_prec.cc @@ -87,7 +87,7 @@ int main (int argc, char ** argv) FermionField result_o(FrbGrid); result_o=Zero(); RealD nrm = norm2(src); - LatticeGaugeField Umu(UGrid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(UGrid); SU::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); RealD mass=0.003; RealD c1=9.0/8.0; diff --git a/tests/solver/Test_staggered_cagmres_unprec.cc b/tests/solver/Test_staggered_cagmres_unprec.cc index 8121c90d..1b7a2f56 100644 --- a/tests/solver/Test_staggered_cagmres_unprec.cc +++ b/tests/solver/Test_staggered_cagmres_unprec.cc @@ -51,7 +51,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); FermionField result(&Grid); result=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu seeds({1,2,3,4}); GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(seeds); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); FermionField src(&Grid); random(pRNG,src); FermionField result(&Grid); result=Zero(); diff --git a/tests/solver/Test_staggered_cg_unprec.cc b/tests/solver/Test_staggered_cg_unprec.cc index 9625a9c8..e023b910 100644 --- a/tests/solver/Test_staggered_cg_unprec.cc +++ b/tests/solver/Test_staggered_cg_unprec.cc @@ -65,7 +65,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); FermionField result(&Grid); result=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); std::vector U(4,&Grid); diff --git a/tests/solver/Test_wilson_cg_schur.cc b/tests/solver/Test_wilson_cg_schur.cc index 23383032..97482131 100644 --- a/tests/solver/Test_wilson_cg_schur.cc +++ b/tests/solver/Test_wilson_cg_schur.cc @@ -57,7 +57,7 @@ int main (int argc, char ** argv) std::vector seeds({1,2,3,4}); GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(seeds); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); LatticeFermion src(&Grid); random(pRNG,src); LatticeFermion result(&Grid); result=Zero(); diff --git a/tests/solver/Test_wilson_cg_unprec.cc b/tests/solver/Test_wilson_cg_unprec.cc index f3335d45..07f6ba7b 100644 --- a/tests/solver/Test_wilson_cg_unprec.cc +++ b/tests/solver/Test_wilson_cg_unprec.cc @@ -60,7 +60,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); LatticeFermion result(&Grid); result=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); std::vector U(4,&Grid); diff --git a/tests/solver/Test_wilson_fcagmres_prec.cc b/tests/solver/Test_wilson_fcagmres_prec.cc index b821a25f..d2a1acf4 100644 --- a/tests/solver/Test_wilson_fcagmres_prec.cc +++ b/tests/solver/Test_wilson_fcagmres_prec.cc @@ -47,7 +47,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); LatticeFermion result(&Grid); result=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(fPRNG, Umu); // clang-format on RealD mass = -0.25; diff --git a/tests/solver/Test_wilson_mg_mp.cc b/tests/solver/Test_wilson_mg_mp.cc index e631cd15..89bbbf74 100644 --- a/tests/solver/Test_wilson_mg_mp.cc +++ b/tests/solver/Test_wilson_mg_mp.cc @@ -52,7 +52,7 @@ int main(int argc, char **argv) { LatticeFermionD src_d(FGrid_d); gaussian(fPRNG, src_d); LatticeFermionD resultMGD_d(FGrid_d); resultMGD_d = Zero(); LatticeFermionD resultMGF_d(FGrid_d); resultMGF_d = Zero(); - LatticeGaugeFieldD Umu_d(FGrid_d); SU3::HotConfiguration(fPRNG, Umu_d); + LatticeGaugeFieldD Umu_d(FGrid_d); SU::HotConfiguration(fPRNG, Umu_d); LatticeGaugeFieldF Umu_f(FGrid_f); precisionChange(Umu_f, Umu_d); // clang-format on diff --git a/tests/solver/Test_wilson_mr_unprec.cc b/tests/solver/Test_wilson_mr_unprec.cc index 1cc1f418..fef83794 100644 --- a/tests/solver/Test_wilson_mr_unprec.cc +++ b/tests/solver/Test_wilson_mr_unprec.cc @@ -47,7 +47,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); LatticeFermion result(&Grid); result=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(RNG4,Umu); std::vector U(4,Grid); diff --git a/tests/solver/Test_wilsonclover_bicgstab_prec.cc b/tests/solver/Test_wilsonclover_bicgstab_prec.cc index c1905400..b382b1bb 100644 --- a/tests/solver/Test_wilsonclover_bicgstab_prec.cc +++ b/tests/solver/Test_wilsonclover_bicgstab_prec.cc @@ -60,7 +60,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); LatticeFermion result(&Grid); result=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); std::vector U(4,&Grid); diff --git a/tests/solver/Test_wilsonclover_cg_schur.cc b/tests/solver/Test_wilsonclover_cg_schur.cc index eaae24b3..567a8283 100644 --- a/tests/solver/Test_wilsonclover_cg_schur.cc +++ b/tests/solver/Test_wilsonclover_cg_schur.cc @@ -57,7 +57,7 @@ int main (int argc, char ** argv) std::vector seeds({1,2,3,4}); GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(seeds); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); LatticeFermion src(&Grid); random(pRNG,src); LatticeFermion result(&Grid); result=Zero(); diff --git a/tests/solver/Test_wilsonclover_cg_unprec.cc b/tests/solver/Test_wilsonclover_cg_unprec.cc index 49c52cdf..755d80e1 100644 --- a/tests/solver/Test_wilsonclover_cg_unprec.cc +++ b/tests/solver/Test_wilsonclover_cg_unprec.cc @@ -60,7 +60,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); LatticeFermion result(&Grid); result=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(fPRNG, Umu); // clang-format on RealD mass = -0.25; diff --git a/tests/solver/Test_wilsonclover_mg_lime.cc b/tests/solver/Test_wilsonclover_mg_lime.cc index bd2990d4..0a29c034 100644 --- a/tests/solver/Test_wilsonclover_mg_lime.cc +++ b/tests/solver/Test_wilsonclover_mg_lime.cc @@ -75,7 +75,7 @@ int main(int argc, char **argv) { NerscIO::readConfiguration(Umu_d,header,file); } #endif - // SU3::HotConfiguration(fPRNG, Umu_d); + // SU::HotConfiguration(fPRNG, Umu_d); LatticeGaugeFieldF Umu_f(FGrid_f); precisionChange(Umu_f, Umu_d); // clang-format on diff --git a/tests/solver/Test_wilsonclover_mg_mp.cc b/tests/solver/Test_wilsonclover_mg_mp.cc index b5178d2e..2efe5f08 100644 --- a/tests/solver/Test_wilsonclover_mg_mp.cc +++ b/tests/solver/Test_wilsonclover_mg_mp.cc @@ -52,7 +52,7 @@ int main(int argc, char **argv) { LatticeFermionD src_d(FGrid_d); gaussian(fPRNG, src_d); LatticeFermionD resultMGD_d(FGrid_d); resultMGD_d = zero; LatticeFermionD resultMGF_d(FGrid_d); resultMGF_d = zero; - LatticeGaugeFieldD Umu_d(FGrid_d); SU3::HotConfiguration(fPRNG, Umu_d); + LatticeGaugeFieldD Umu_d(FGrid_d); SU::HotConfiguration(fPRNG, Umu_d); LatticeGaugeFieldF Umu_f(FGrid_f); precisionChange(Umu_f, Umu_d); // clang-format on diff --git a/tests/solver/Test_wilsonclover_mixedbicgstab_prec.cc b/tests/solver/Test_wilsonclover_mixedbicgstab_prec.cc index 0af83f8b..d47dac2a 100644 --- a/tests/solver/Test_wilsonclover_mixedbicgstab_prec.cc +++ b/tests/solver/Test_wilsonclover_mixedbicgstab_prec.cc @@ -61,7 +61,7 @@ int main (int argc, char ** argv) // clang-format off LatticeFermionD src(FGrid_d); gaussian(fPRNG, src); LatticeFermionD result(FGrid_d); result = Zero(); - LatticeGaugeFieldD Umu_d(FGrid_d); SU3::HotConfiguration(fPRNG, Umu_d); + LatticeGaugeFieldD Umu_d(FGrid_d); SU::HotConfiguration(fPRNG, Umu_d); LatticeGaugeFieldF Umu_f(FGrid_f); precisionChange(Umu_f, Umu_d); // clang-format on diff --git a/tests/solver/Test_wilsonclover_mixedcg_prec.cc b/tests/solver/Test_wilsonclover_mixedcg_prec.cc index 8af9036f..95590004 100644 --- a/tests/solver/Test_wilsonclover_mixedcg_prec.cc +++ b/tests/solver/Test_wilsonclover_mixedcg_prec.cc @@ -61,7 +61,7 @@ int main (int argc, char ** argv) // clang-format off LatticeFermionD src(FGrid_d); gaussian(fPRNG, src); LatticeFermionD result(FGrid_d); result = Zero(); - LatticeGaugeFieldD Umu_d(FGrid_d); SU3::HotConfiguration(fPRNG, Umu_d); + LatticeGaugeFieldD Umu_d(FGrid_d); SU::HotConfiguration(fPRNG, Umu_d); LatticeGaugeFieldF Umu_f(FGrid_f); precisionChange(Umu_f, Umu_d); // clang-format on diff --git a/tests/solver/Test_wilsonclover_mr_unprec.cc b/tests/solver/Test_wilsonclover_mr_unprec.cc index c7b5ecfe..ab49ec1f 100644 --- a/tests/solver/Test_wilsonclover_mr_unprec.cc +++ b/tests/solver/Test_wilsonclover_mr_unprec.cc @@ -51,7 +51,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); FermionField result(&Grid); result=Zero(); - LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); + LatticeGaugeField Umu(&Grid); SU::HotConfiguration(pRNG,Umu); double volume=1; for(int mu=0;mu::HotConfiguration(RNG4, Umu); } std::cout << GridLogMessage << "Lattice dimensions: " << GridDefaultLatt() diff --git a/tests/solver/Test_zmobius_cg_prec.cc b/tests/solver/Test_zmobius_cg_prec.cc index fb57cff1..6b007afc 100644 --- a/tests/solver/Test_zmobius_cg_prec.cc +++ b/tests/solver/Test_zmobius_cg_prec.cc @@ -67,7 +67,7 @@ int main(int argc, char** argv) { result = Zero(); LatticeGaugeField Umu(UGrid); - SU3::HotConfiguration(RNG4, Umu); + SU::HotConfiguration(RNG4, Umu); std::cout << GridLogMessage << "Lattice dimensions: " << GridDefaultLatt() << " Ls: " << Ls << std::endl;