mirror of
https://github.com/paboyle/Grid.git
synced 2025-11-22 15:39:32 +00:00
Compare commits
6 Commits
hotfix/unw
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a0aaf0786 | |||
| 9c3835524c | |||
| 549351bb8a | |||
|
|
74e6b19f83 | ||
|
|
2e684028de | ||
| c54d87a472 |
@@ -27,6 +27,8 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
/* END LEGAL */
|
||||
#include <Grid/GridCore.h>
|
||||
|
||||
void GridAbort(void) { abort(); }
|
||||
|
||||
NAMESPACE_BEGIN(Grid);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -34,7 +36,6 @@ NAMESPACE_BEGIN(Grid);
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
Grid_MPI_Comm CartesianCommunicator::communicator_world;
|
||||
|
||||
void GridAbort(void) { abort(); }
|
||||
|
||||
void CartesianCommunicator::Init(int *argc, char *** arv)
|
||||
{
|
||||
|
||||
@@ -124,7 +124,7 @@ template<class vobj> void Cshift_simple(Lattice<vobj>& ret,const Lattice<vobj> &
|
||||
void *hsend_buf = (void *)&hrhs[0];
|
||||
void *hrecv_buf = (void *)&hret[0];
|
||||
|
||||
acceleratorCopyFromDevice(&send_buf[0],&hsend_buf[0],bytes);
|
||||
acceleratorCopyFromDevice(send_buf,hsend_buf,bytes);
|
||||
|
||||
grid->SendToRecvFrom(hsend_buf,
|
||||
xmit_to_rank,
|
||||
@@ -132,7 +132,7 @@ template<class vobj> void Cshift_simple(Lattice<vobj>& ret,const Lattice<vobj> &
|
||||
recv_from_rank,
|
||||
bytes);
|
||||
|
||||
acceleratorCopyToDevice(&hrecv_buf[0],&recv_buf[0],bytes);
|
||||
acceleratorCopyToDevice(hrecv_buf,recv_buf,bytes);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ void WilsonKernels<Impl>::DhopDirKernel( StencilImpl &st, DoubledGaugeField &U,S
|
||||
#undef LoopBody
|
||||
}
|
||||
|
||||
#ifdef GRID_SYCL
|
||||
#if 0
|
||||
extern "C" {
|
||||
ulong SYCL_EXTERNAL __attribute__((overloadable)) intel_get_cycle_counter( void );
|
||||
uint SYCL_EXTERNAL __attribute__((overloadable)) intel_get_active_channel_mask( void );
|
||||
|
||||
@@ -138,10 +138,13 @@ public:
|
||||
//auto start = std::chrono::high_resolution_clock::now();
|
||||
autoView(U_v,U,AcceleratorWrite);
|
||||
autoView(P_v,P,AcceleratorRead);
|
||||
accelerator_for(ss, P.Grid()->oSites(),1,{
|
||||
typedef typename Field::vector_object vobj;
|
||||
const int Nsimd = vobj::Nsimd();
|
||||
accelerator_for(ss, P.Grid()->oSites(),Nsimd,{
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
U_v[ss](mu) = Exponentiate(P_v[ss](mu), ep, Nexp) * U_v[ss](mu);
|
||||
U_v[ss](mu) = Group::ProjectOnGeneralGroup(U_v[ss](mu));
|
||||
auto tmp = Exponentiate(P_v(ss)(mu), ep, Nexp) * U_v(ss)(mu);
|
||||
tmp = Group::ProjectOnGeneralGroup(tmp);
|
||||
coalescedWrite(U_v[ss](mu),tmp);
|
||||
}
|
||||
});
|
||||
//auto end = std::chrono::high_resolution_clock::now();
|
||||
|
||||
@@ -291,8 +291,8 @@ public:
|
||||
int idx=0;
|
||||
for(int mu=0;mu<4;mu++){
|
||||
for(int nu=0;nu<4;nu++){
|
||||
if ( mu!=nu) GRID_ASSERT(this->StoutSmearing->SmearRho[idx]==rho);
|
||||
else GRID_ASSERT(this->StoutSmearing->SmearRho[idx]==0.0);
|
||||
if ( mu!=nu) assert(this->StoutSmearing->SmearRho[idx]==rho);
|
||||
else assert(this->StoutSmearing->SmearRho[idx]==0.0);
|
||||
idx++;
|
||||
}}
|
||||
//////////////////////////////////////////////////////////////////
|
||||
@@ -825,6 +825,7 @@ public:
|
||||
virtual void fill_smearedSet(GaugeField &U)
|
||||
{
|
||||
this->ThinLinks = &U; // attach the smearing routine to the field U
|
||||
std::cout << GridLogMessage << " fill_smearedSet " << WilsonLoops<PeriodicGimplR>::avgPlaquette(U) << std::endl;
|
||||
|
||||
// check the pointer is not null
|
||||
if (this->ThinLinks == NULL)
|
||||
@@ -846,6 +847,8 @@ public:
|
||||
ApplyMask(smeared_A,smearLvl);
|
||||
smeared_B = previous_u;
|
||||
ApplyMask(smeared_B,smearLvl);
|
||||
std::cout << GridLogMessage << " smeared_A " << norm2(smeared_A) << std::endl;
|
||||
std::cout << GridLogMessage << " smeared_B " << norm2(smeared_B) << std::endl;
|
||||
// Replace only the masked portion
|
||||
this->SmearedSet[smearLvl] = previous_u-smeared_B + smeared_A;
|
||||
previous_u = this->SmearedSet[smearLvl];
|
||||
@@ -934,10 +937,10 @@ public:
|
||||
SmearedConfigurationMasked(GridCartesian* _UGrid, unsigned int Nsmear, Smear_Stout<Gimpl>& Stout)
|
||||
: SmearedConfiguration<Gimpl>(_UGrid, Nsmear,Stout)
|
||||
{
|
||||
GRID_ASSERT(Nsmear%(2*Nd)==0); // Or multiply by 8??
|
||||
assert(Nsmear%(2*Nd)==0); // Or multiply by 8??
|
||||
|
||||
// was resized in base class
|
||||
GRID_ASSERT(this->SmearedSet.size()==Nsmear);
|
||||
assert(this->SmearedSet.size()==Nsmear);
|
||||
|
||||
GridRedBlackCartesian * UrbGrid;
|
||||
UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(_UGrid);
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
// Usual cases are not used
|
||||
//////////////////////////////////
|
||||
virtual void refresh(const GaugeField &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG){ GRID_ASSERT(0);};
|
||||
virtual RealD S(const GaugeField &U) { GRID_ASSERT(0); }
|
||||
virtual RealD S(const GaugeField &U) { GRID_ASSERT(0); return 0; }
|
||||
virtual void deriv(const GaugeField &U, GaugeField &dSdU) { GRID_ASSERT(0); }
|
||||
|
||||
//////////////////////////////////
|
||||
|
||||
@@ -751,7 +751,7 @@ public:
|
||||
obj.xbytes = xbytes;
|
||||
obj.rbytes = rbytes;
|
||||
obj.cb = cb;
|
||||
|
||||
|
||||
for(int i=0;i<CachedTransfers.size();i++){
|
||||
if ( (CachedTransfers[i].direction ==direction)
|
||||
&&(CachedTransfers[i].OrthogPlane==OrthogPlane)
|
||||
@@ -763,11 +763,13 @@ public:
|
||||
){
|
||||
// FIXME worry about duplicate with partial compression
|
||||
// Wont happen as DWF has no duplicates, but...
|
||||
AddCopy(CachedTransfers[i].recv_buf,recv_buf,rbytes);
|
||||
return 1;
|
||||
// AddCopy(CachedTransfers[i].recv_buf,recv_buf,rbytes);
|
||||
// std::cout << "Duplicate dir " <<direction<<" "<<" OrthogPlane "<<OrthogPlane<<" Dest"<<DestProc <<" xbytes " <<xbytes<<" lane "<< lane<<" cb "<<cb<<std::endl;
|
||||
return 0;
|
||||
|
||||
// return 1;
|
||||
}
|
||||
}
|
||||
|
||||
CachedTransfers.push_back(obj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export HDF5=/opt/cray/pe/hdf5/1.12.2.3/gnu/9.1
|
||||
--disable-gparity \
|
||||
--disable-fermion-reps \
|
||||
--enable-shm=nvlink \
|
||||
--enable-checksum-comms=yes \
|
||||
--enable-checksum-comms=no \
|
||||
--enable-log-views=yes \
|
||||
--enable-accelerator=sycl \
|
||||
--enable-accelerator-aware-mpi=no \
|
||||
|
||||
@@ -62,6 +62,7 @@ void ForceTest(Action<LatticeGaugeField> &action,ConfigurationBase<LatticeGaugeF
|
||||
|
||||
Gimpl::generate_momenta(P,sRNG,RNG4);
|
||||
// Filter.applyFilter(P);
|
||||
std::cout << GridLogMessage << "Initial momenta " << norm2(P) << std::endl;
|
||||
|
||||
action.refresh(smU,sRNG,RNG4);
|
||||
|
||||
@@ -70,6 +71,8 @@ void ForceTest(Action<LatticeGaugeField> &action,ConfigurationBase<LatticeGaugeF
|
||||
std::cout << GridLogMessage << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<std::endl;
|
||||
|
||||
RealD S1 = action.S(smU);
|
||||
std::cout << GridLogMessage << "Initial action " << S1 << std::endl;
|
||||
|
||||
|
||||
Gimpl::update_field(P,U,eps);
|
||||
smU.set_Field(U);
|
||||
@@ -80,6 +83,7 @@ void ForceTest(Action<LatticeGaugeField> &action,ConfigurationBase<LatticeGaugeF
|
||||
action.deriv(smU,UdSdU);
|
||||
UdSdU = Ta(UdSdU);
|
||||
// Filter.applyFilter(UdSdU);
|
||||
std::cout << GridLogMessage << "Derivative " << norm2(UdSdU) << std::endl;
|
||||
|
||||
DumpSliceNorm("Force",UdSdU,Nd-1);
|
||||
|
||||
@@ -91,6 +95,7 @@ void ForceTest(Action<LatticeGaugeField> &action,ConfigurationBase<LatticeGaugeF
|
||||
std::cout << GridLogMessage << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<std::endl;
|
||||
|
||||
RealD S2 = action.S(smU);
|
||||
std::cout << GridLogMessage << "Final action " << S1 << std::endl;
|
||||
|
||||
// Use the derivative
|
||||
LatticeComplex dS(UGrid); dS = Zero();
|
||||
@@ -145,6 +150,8 @@ int main (int argc, char ** argv)
|
||||
GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds);
|
||||
SU<Nc>::HotConfiguration(RNG4,U);
|
||||
#endif
|
||||
std::cout << GridLogMessage << "Initial plaquette: " << WilsonLoops<PeriodicGimplR>::avgPlaquette(U) << std::endl;
|
||||
|
||||
|
||||
|
||||
WilsonGaugeActionR PlaqAction(6.0);
|
||||
|
||||
Reference in New Issue
Block a user