mirror of
https://github.com/paboyle/Grid.git
synced 2025-10-17 06:34:42 +01:00
Assertion updates to macros (mostly) with backtrace.
WIlson flow to include options for DBW2, Iwasaki, Symanzik. View logging for data assurance
This commit is contained in:
@@ -103,7 +103,7 @@ template<typename FieldType>
|
||||
void readFieldArray(std::vector<FieldType> &data, const std::string &file){
|
||||
typedef typename FieldType::vector_object vobj;
|
||||
typedef typename FieldType::scalar_object sobj;
|
||||
assert(data.size() > 0);
|
||||
GRID_ASSERT(data.size() > 0);
|
||||
GridBase* grid = data[0].Grid(); //assume all fields have the same Grid
|
||||
BinarySimpleUnmunger<sobj, sobj> munge; //straight copy
|
||||
|
||||
@@ -113,7 +113,7 @@ void readFieldArray(std::vector<FieldType> &data, const std::string &file){
|
||||
|
||||
std::cout << "Data offset read " << offset << std::endl;
|
||||
std::cout << "Data size read " << hdr_size << std::endl;
|
||||
assert(data.size() == hdr_size);
|
||||
GRID_ASSERT(data.size() == hdr_size);
|
||||
|
||||
uint64_t field_size = uint64_t(grid->gSites()) * sizeof(sobj);
|
||||
|
||||
@@ -132,7 +132,7 @@ void readFieldArray(std::vector<FieldType> &data, const std::string &file){
|
||||
std::cout << "Read checksum " << checksum << std::endl;
|
||||
|
||||
|
||||
assert( hdr_checksum == checksum );
|
||||
GRID_ASSERT( hdr_checksum == checksum );
|
||||
}
|
||||
|
||||
|
||||
|
@@ -61,7 +61,7 @@ int main(int argc, char** argv) {
|
||||
if(GridCmdOptionExists(argv, argv + argc, "--config")) {
|
||||
file = GridCmdOptionPayload(argv, argv + argc, "--config");
|
||||
std::cout << "file: " << file << std::endl;
|
||||
assert(!file.empty());
|
||||
GRID_ASSERT(!file.empty());
|
||||
}
|
||||
|
||||
OpenQcdIOChromaReference::readConfiguration(Umu_ref, header_ref, file);
|
||||
|
@@ -56,7 +56,7 @@ public:
|
||||
void checkpointFine(std::string evecs_file,std::string evals_file)
|
||||
{
|
||||
#ifdef HAVE_LIME
|
||||
assert(this->subspace.size()==nbasis);
|
||||
GRID_ASSERT(this->subspace.size()==nbasis);
|
||||
emptyUserRecord record;
|
||||
Grid::ScidacWriter WR(this->_FineGrid->IsBoss());
|
||||
WR.open(evecs_file);
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
XmlWriter WRx(evals_file);
|
||||
write(WRx,"evals",this->evals_fine);
|
||||
#else
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
XmlReader RDx(evals_file);
|
||||
read(RDx,"evals",this->evals_fine);
|
||||
|
||||
assert(this->evals_fine.size()==nbasis);
|
||||
GRID_ASSERT(this->evals_fine.size()==nbasis);
|
||||
|
||||
std::cout << GridLogIRL<< "checkpointFineRestore: Reading evecs from "<<evecs_file<<std::endl;
|
||||
emptyUserRecord record;
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
}
|
||||
RD.close();
|
||||
#else
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
XmlWriter WRx(evals_file);
|
||||
write(WRx,"evals",this->evals_coarse);
|
||||
#else
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
XmlReader RDx(evals_file);
|
||||
read(RDx,"evals",this->evals_coarse);
|
||||
|
||||
assert(this->evals_coarse.size()==nvec);
|
||||
GRID_ASSERT(this->evals_coarse.size()==nvec);
|
||||
emptyUserRecord record;
|
||||
std::cout << GridLogIRL<< "checkpointCoarseRestore: Reading evecs from "<<evecs_file<<std::endl;
|
||||
Grid::ScidacReader RD ;
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
}
|
||||
RD.close();
|
||||
#else
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
@@ -179,19 +179,19 @@ int main (int argc, char ** argv) {
|
||||
|
||||
std::vector<int> fineLatt = latt;
|
||||
int dims=fineLatt.size();
|
||||
assert(blockSize.size()==dims+1);
|
||||
GRID_ASSERT(blockSize.size()==dims+1);
|
||||
std::vector<int> coarseLatt(dims);
|
||||
std::vector<int> coarseLatt5d ;
|
||||
|
||||
for (int d=0;d<coarseLatt.size();d++){
|
||||
coarseLatt[d] = fineLatt[d]/blockSize[d]; assert(coarseLatt[d]*blockSize[d]==fineLatt[d]);
|
||||
coarseLatt[d] = fineLatt[d]/blockSize[d]; GRID_ASSERT(coarseLatt[d]*blockSize[d]==fineLatt[d]);
|
||||
}
|
||||
|
||||
std::cout << GridLogMessage<< " 5d coarse lattice is ";
|
||||
for (int i=0;i<coarseLatt.size();i++){
|
||||
std::cout << coarseLatt[i]<<"x";
|
||||
}
|
||||
int cLs = Ls/blockSize[dims]; assert(cLs*blockSize[dims]==Ls);
|
||||
int cLs = Ls/blockSize[dims]; GRID_ASSERT(cLs*blockSize[dims]==Ls);
|
||||
std::cout << cLs<<std::endl;
|
||||
|
||||
GridCartesian * CoarseGrid4 = SpaceTimeGrid::makeFourDimGrid(coarseLatt, GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi());
|
||||
@@ -222,14 +222,14 @@ int main (int argc, char ** argv) {
|
||||
|
||||
std::cout << GridLogMessage << "Keep " << fine.Nstop << " fine vectors" << std::endl;
|
||||
std::cout << GridLogMessage << "Keep " << coarse.Nstop << " coarse vectors" << std::endl;
|
||||
assert(Nm2 >= Nm1);
|
||||
GRID_ASSERT(Nm2 >= Nm1);
|
||||
|
||||
const int nbasis= 60;
|
||||
assert(nbasis==Ns1);
|
||||
GRID_ASSERT(nbasis==Ns1);
|
||||
LocalCoherenceLanczosScidac<vSpinColourVector,vTComplex,nbasis> _LocalCoherenceLanczos(FrbGrid,CoarseGrid5,HermOp,Odd);
|
||||
std::cout << GridLogMessage << "Constructed LocalCoherenceLanczos" << std::endl;
|
||||
|
||||
assert( (Params.doFine)||(Params.doFineRead));
|
||||
GRID_ASSERT( (Params.doFine)||(Params.doFineRead));
|
||||
|
||||
if ( Params.doFine ) {
|
||||
std::cout << GridLogMessage << "Performing fine grid IRL Nstop "<< Ns1 << " Nk "<<Nk1<<" Nm "<<Nm1<< std::endl;
|
||||
|
@@ -180,7 +180,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << " SinglePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
|
||||
std::cout << " SinglePrecision error count "<< FlightRecorder::ErrorCount()<<std::endl;
|
||||
|
||||
assert(FlightRecorder::ErrorCount()==0);
|
||||
GRID_ASSERT(FlightRecorder::ErrorCount()==0);
|
||||
|
||||
std::cout << " FlightRecorder is OK! "<<std::endl;
|
||||
iter ++;
|
||||
@@ -208,7 +208,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << " DoublePrecision iterations/sec "<< iters/(t2-t1)*1000.*1000.<<std::endl;
|
||||
std::cout << " DoublePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
|
||||
std::cout << " DoublePrecision error count "<< FlightRecorder::ErrorCount()<<std::endl;
|
||||
assert(FlightRecorder::ErrorCount()==0);
|
||||
GRID_ASSERT(FlightRecorder::ErrorCount()==0);
|
||||
std::cout << " FlightRecorder is OK! "<<std::endl;
|
||||
now = time(NULL); UGrid->Broadcast(0,(void *)&now,sizeof(now));
|
||||
i++;
|
||||
@@ -218,7 +218,7 @@ int main (int argc, char ** argv)
|
||||
RealD diff = axpy_norm(diff_o, -1.0, result_o, result_o_2);
|
||||
|
||||
std::cout << GridLogMessage << "::::::::::::: Diff between mixed and regular CG: " << diff << std::endl;
|
||||
assert(diff < 1e-4);
|
||||
GRID_ASSERT(diff < 1e-4);
|
||||
|
||||
Grid_finalize();
|
||||
}
|
||||
|
@@ -84,8 +84,8 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "Double: time_ref = " << sw_ref.Elapsed() << " time_res = " << sw_res.Elapsed() << std::endl;
|
||||
// clang-format on
|
||||
|
||||
assert(diff_ip_d == 0.);
|
||||
assert(diff_norm2_d == 0.);
|
||||
GRID_ASSERT(diff_ip_d == 0.);
|
||||
GRID_ASSERT(diff_norm2_d == 0.);
|
||||
|
||||
std::cout << GridLogMessage << "Double: all checks passed" << std::endl;
|
||||
}
|
||||
@@ -116,8 +116,8 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "Single: time_ref = " << sw_ref.Elapsed() << " time_res = " << sw_res.Elapsed() << std::endl;
|
||||
// clang-format on
|
||||
|
||||
assert(diff_ip_f == 0.);
|
||||
assert(diff_norm2_f == 0.);
|
||||
GRID_ASSERT(diff_ip_f == 0.);
|
||||
GRID_ASSERT(diff_norm2_f == 0.);
|
||||
|
||||
std::cout << GridLogMessage << "Single: all checks passed" << std::endl;
|
||||
}
|
||||
|
@@ -175,7 +175,7 @@ void Tester(const functor &func)
|
||||
} else {
|
||||
std::cout<<GridLogMessage << " wrong!" <<std::endl;
|
||||
}
|
||||
assert(ok==0);
|
||||
GRID_ASSERT(ok==0);
|
||||
}
|
||||
|
||||
template<class functor>
|
||||
@@ -234,7 +234,7 @@ void IntTester(const functor &func)
|
||||
} else {
|
||||
std::cout<<GridLogMessage << " wrong!" <<std::endl;
|
||||
}
|
||||
assert(ok==0);
|
||||
GRID_ASSERT(ok==0);
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ void ReductionTester(const functor &func)
|
||||
} else {
|
||||
std::cout<<GridLogMessage << " wrong!" <<std::endl;
|
||||
}
|
||||
assert(ok==0);
|
||||
GRID_ASSERT(ok==0);
|
||||
}
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ void IntReductionTester(const functor &func)
|
||||
} else {
|
||||
std::cout<<GridLogMessage << " wrong!" <<std::endl;
|
||||
}
|
||||
assert(ok==0);
|
||||
GRID_ASSERT(ok==0);
|
||||
}
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@ void PermTester(const functor &func)
|
||||
} else {
|
||||
std::cout<<GridLogMessage << " wrong!" <<std::endl;
|
||||
}
|
||||
assert(ok==0);
|
||||
GRID_ASSERT(ok==0);
|
||||
}
|
||||
|
||||
|
||||
@@ -520,8 +520,8 @@ void ExchangeTester(const functor &func)
|
||||
// std::cout << " i "<<i<<" j "<<j<<" "<<reference1[j]<<" "<<result1[i]<<std::endl;
|
||||
}
|
||||
}
|
||||
// assert(found==1);
|
||||
assert(found==1||found==0);
|
||||
// GRID_ASSERT(found==1);
|
||||
GRID_ASSERT(found==1||found==0);
|
||||
}
|
||||
for(int i=0;i<Nsimd;i++){
|
||||
int found=0;
|
||||
@@ -531,8 +531,8 @@ void ExchangeTester(const functor &func)
|
||||
// std::cout << " i "<<i<<" j "<<j<<" "<<reference2[j]<<" "<<result2[i]<<std::endl;
|
||||
}
|
||||
}
|
||||
// assert(found==1);
|
||||
assert(found==1||found==0);
|
||||
// GRID_ASSERT(found==1);
|
||||
GRID_ASSERT(found==1||found==0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -547,8 +547,8 @@ void ExchangeTester(const functor &func)
|
||||
}
|
||||
*/
|
||||
for(int i=0;i<Nsimd;i++){
|
||||
assert(test1[i]==input1[i]);
|
||||
assert(test2[i]==input2[i]);
|
||||
GRID_ASSERT(test1[i]==input1[i]);
|
||||
GRID_ASSERT(test2[i]==input2[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -789,7 +789,7 @@ int main (int argc, char ** argv)
|
||||
nrm = innerProduct(DD[i],DD[i]);
|
||||
auto tmp = Reduce(nrm);
|
||||
// std::cout << tmp << std::endl;
|
||||
assert( tmp < 1.0e-14 );
|
||||
GRID_ASSERT( tmp < 1.0e-14 );
|
||||
}
|
||||
std::cout <<" OK ! "<<std::endl;
|
||||
|
||||
@@ -805,7 +805,7 @@ int main (int argc, char ** argv)
|
||||
nrm = innerProduct(DD[i],DD[i]);
|
||||
auto tmp = Reduce(nrm);
|
||||
// std::cout << tmp << std::endl;
|
||||
assert( tmp < 1.0e-3 );
|
||||
GRID_ASSERT( tmp < 1.0e-3 );
|
||||
}
|
||||
std::cout <<" OK ! "<<std::endl;
|
||||
|
||||
@@ -820,7 +820,7 @@ int main (int argc, char ** argv)
|
||||
nrm = innerProduct(FF[i],FF[i]);
|
||||
auto tmp = Reduce(nrm);
|
||||
// std::cout << tmp << std::endl;
|
||||
assert( tmp < 1.0e-3 );
|
||||
GRID_ASSERT( tmp < 1.0e-3 );
|
||||
}
|
||||
std::cout <<" OK ! "<<std::endl;
|
||||
#endif
|
||||
|
@@ -54,7 +54,7 @@ int main (int argc, char ** argv)
|
||||
{
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
assert(argc >= 5);
|
||||
GRID_ASSERT(argc >= 5);
|
||||
|
||||
Coordinate latt(4,0);
|
||||
latt[0] = toint(argv[1]);
|
||||
|
@@ -205,7 +205,7 @@ void runBenchmark(int* argc, char*** argv) {
|
||||
double secs_res = (t5-t4)/1e6; \
|
||||
grid_printf_msg("Performance(%35s, %s): %2.4f s, %6.0f GFlop/s, %6.0f GByte/s, speedup vs ref = %.2f, fraction of hop = %.2f\n", \
|
||||
"compact_"#KERNEL, precision.c_str(), secs_res, clov_gflop_total/secs_res, clov_gbyte_total/secs_res, secs_ref/secs_res, secs_res/secs_hop); \
|
||||
assert(resultsAgree(ref, res, #KERNEL)); \
|
||||
GRID_ASSERT(resultsAgree(ref, res, #KERNEL)); \
|
||||
}
|
||||
|
||||
BENCH_CLOVER_KERNEL(Mooee);
|
||||
|
@@ -279,7 +279,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
result5 = result5 - Kinetic;
|
||||
std::cout<<"diff "<< norm2(result5)<<std::endl;
|
||||
assert(norm2(result5)<1.0e-4);
|
||||
GRID_ASSERT(norm2(result5)<1.0e-4);
|
||||
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
diff = ref - result4;
|
||||
std::cout << "result - ref "<<norm2(diff)<<std::endl;
|
||||
assert(norm2(diff)<1.0e-4);
|
||||
GRID_ASSERT(norm2(diff)<1.0e-4);
|
||||
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
diff = ref - result4;
|
||||
std::cout << "result - ref "<<norm2(diff)<<std::endl;
|
||||
assert(norm2(diff)<1.0e-4);
|
||||
GRID_ASSERT(norm2(diff)<1.0e-4);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -196,7 +196,7 @@ int main (int argc, char ** argv)
|
||||
for(int i=1;i<argc;i++){
|
||||
std::string sarg(argv[i]);
|
||||
if(sarg == "--gimpl"){
|
||||
assert(i<argc-1 && "--gimpl option requires an argument");
|
||||
GRID_ASSERT(i<argc-1 && "--gimpl option requires an argument");
|
||||
gimpl = argv[i+1];
|
||||
if(gimpl != "periodic" && gimpl != "conjugate")
|
||||
assert(0 && "Invalid gimpl");
|
||||
@@ -206,7 +206,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << "Not doing the Fourier accelerated gauge fixing tests" << std::endl;
|
||||
do_fft_gfix = false;
|
||||
}else if(sarg == "--alpha"){
|
||||
assert(i<argc-1 && "--alpha option requires an argument");
|
||||
GRID_ASSERT(i<argc-1 && "--alpha option requires an argument");
|
||||
std::istringstream ss(argv[i+1]); ss >> alpha;
|
||||
}
|
||||
}
|
||||
|
@@ -171,7 +171,7 @@ int main(int argc, char** argv) {
|
||||
Complex tr2 = TRa()()(b,c) * Complex(0,1);
|
||||
std::cout << " 2 Tr( Tc[Ta,Tb]) " << 2.0*tr1<<std::endl;
|
||||
std::cout << " - TRa_bc " << tr2<<std::endl;
|
||||
assert(abs( (2.0*tr1-tr2) ) < 1.0e-7);
|
||||
GRID_ASSERT(abs( (2.0*tr1-tr2) ) < 1.0e-7);
|
||||
std::cout << "------------------"<<std::endl;
|
||||
}}}
|
||||
#endif
|
||||
|
@@ -93,13 +93,13 @@ void MemoryTest(GridCartesian * FGrid, int N)
|
||||
if ( dev ) {
|
||||
autoView(A_v,A[v],AcceleratorRead);
|
||||
accelerator_for(ss,FGrid->oSites(),1,{
|
||||
// assert(B[v]==A_v[ss]()()().getlane(0));
|
||||
// GRID_ASSERT(B[v]==A_v[ss]()()().getlane(0));
|
||||
});
|
||||
// std::cout << "["<<v<<"] checked on GPU"<<B[v]<<std::endl;
|
||||
} else {
|
||||
autoView(A_v,A[v],CpuRead);
|
||||
thread_for(ss,FGrid->oSites(),{
|
||||
assert(B[v]==A_v[ss]()()().getlane(0));
|
||||
GRID_ASSERT(B[v]==A_v[ss]()()().getlane(0));
|
||||
});
|
||||
// std::cout << "["<<v<<"] checked on CPU"<<B[v]<<std::endl;
|
||||
}
|
||||
|
@@ -11,13 +11,13 @@ template<class vobj> inline void sliceSumCPU(const Grid::Lattice<vobj> &Data,std
|
||||
typedef typename vobj::scalar_object sobj;
|
||||
typedef typename vobj::scalar_object::scalar_type scalar_type;
|
||||
GridBase *grid = Data.Grid();
|
||||
assert(grid!=NULL);
|
||||
GRID_ASSERT(grid!=NULL);
|
||||
|
||||
const int Nd = grid->_ndimension;
|
||||
const int Nsimd = grid->Nsimd();
|
||||
|
||||
assert(orthogdim >= 0);
|
||||
assert(orthogdim < Nd);
|
||||
GRID_ASSERT(orthogdim >= 0);
|
||||
GRID_ASSERT(orthogdim < Nd);
|
||||
|
||||
int fd=grid->_fdimensions[orthogdim];
|
||||
int ld=grid->_ldimensions[orthogdim];
|
||||
@@ -134,7 +134,7 @@ int main (int argc, char ** argv) {
|
||||
for(int t=0;t<reduction_reference.size();t++) {
|
||||
|
||||
auto diff = reduction_reference[t]-reduction_result[t];
|
||||
assert(abs(TensorRemove(diff)) < 1e-8 );
|
||||
GRID_ASSERT(abs(TensorRemove(diff)) < 1e-8 );
|
||||
|
||||
}
|
||||
|
||||
@@ -184,10 +184,10 @@ int main (int argc, char ** argv) {
|
||||
for(int t=0;t<reduction_reference_cv.size();t++) {
|
||||
|
||||
auto diff = reduction_reference_cv[t]-reduction_result_cv[t];
|
||||
assert(abs(diff()(0)()) < 1e-8 );
|
||||
assert(abs(diff()(1)()) < 1e-8 );
|
||||
assert(abs(diff()(2)()) < 1e-8 );
|
||||
assert(abs(diff()(3)()) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(0)()) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(1)()) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(2)()) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(3)()) < 1e-8 );
|
||||
|
||||
}
|
||||
|
||||
@@ -238,18 +238,18 @@ int main (int argc, char ** argv) {
|
||||
|
||||
auto diff = reduction_reference_scv[t]-reduction_result_scv[t];
|
||||
// std::cout << diff <<std::endl;
|
||||
assert(abs(diff()(0)(0)) < 1e-8 );
|
||||
assert(abs(diff()(0)(1)) < 1e-8 );
|
||||
assert(abs(diff()(0)(2)) < 1e-8 );
|
||||
assert(abs(diff()(1)(0)) < 1e-8 );
|
||||
assert(abs(diff()(1)(1)) < 1e-8 );
|
||||
assert(abs(diff()(1)(2)) < 1e-8 );
|
||||
assert(abs(diff()(2)(0)) < 1e-8 );
|
||||
assert(abs(diff()(2)(1)) < 1e-8 );
|
||||
assert(abs(diff()(2)(2)) < 1e-8 );
|
||||
assert(abs(diff()(3)(0)) < 1e-8 );
|
||||
assert(abs(diff()(3)(1)) < 1e-8 );
|
||||
assert(abs(diff()(3)(2)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(0)(0)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(0)(1)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(0)(2)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(1)(0)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(1)(1)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(1)(2)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(2)(0)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(2)(1)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(2)(2)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(3)(0)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(3)(1)) < 1e-8 );
|
||||
GRID_ASSERT(abs(diff()(3)(2)) < 1e-8 );
|
||||
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ int main (int argc, char ** argv) {
|
||||
for (int js = 0; js < Ns; js++) {
|
||||
for (int ic = 0; ic < Nc; ic++) {
|
||||
for (int jc = 0; jc < Nc; jc++) {
|
||||
assert(abs(diff()(is,js)(ic,jc)) < 1e-8);
|
||||
GRID_ASSERT(abs(diff()(is,js)(ic,jc)) < 1e-8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -77,11 +77,11 @@ public:
|
||||
ComplexD ref = B[v][p*PageWords];
|
||||
std::cout << "Device compare "<<B[v][p*PageWords]<<std::endl;
|
||||
accelerator_for(ss,1,1,{
|
||||
assert(ref==A_v[p*PageWords]);
|
||||
GRID_ASSERT(ref==A_v[p*PageWords]);
|
||||
});
|
||||
} else {
|
||||
std::cout << "Host compare "<<B[v][p*PageWords]<<std::endl;
|
||||
assert(B[v][p*PageWords]==A[v][p*PageWords]);
|
||||
GRID_ASSERT(B[v][p*PageWords]==A[v][p*PageWords]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ int main (int argc, char ** argv)
|
||||
ns=ns+norm2(sl);
|
||||
}
|
||||
std::cout <<GridLogMessage <<" sliceNorm" <<mu<<" "<< nn <<" "<<ns<<" err " << nn-ns<<std::endl;
|
||||
assert(abs(nn-ns) < 1.0e-10);
|
||||
GRID_ASSERT(abs(nn-ns) < 1.0e-10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ int main (int argc, char ** argv)
|
||||
ns=ns+norm2(sl);
|
||||
}
|
||||
std::cout <<GridLogMessage <<" sliceNorm" <<mu<<" "<< nn <<" "<<ns<<" err " << nn-ns<<std::endl;
|
||||
assert(abs(nn-ns) < 1.0e-10);
|
||||
GRID_ASSERT(abs(nn-ns) < 1.0e-10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ int main (int argc, char ** argv)
|
||||
ns=ns+norm2(sl);
|
||||
}
|
||||
std::cout <<GridLogMessage <<" sliceNorm" <<mu<<" "<< nn <<" "<<ns<<" err " << nn-ns<<std::endl;
|
||||
assert(abs(nn-ns) < 1.0e-10);
|
||||
GRID_ASSERT(abs(nn-ns) < 1.0e-10);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = ref - r_eo;
|
||||
std::cout << GridLogMessage << "EO norm diff\t" << norm2(err) << " (" << norm2(ref) << " - " << norm2(r_eo) << ")" << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = ref - r_eo;
|
||||
std::cout << GridLogMessage << "EO norm diff compact\t" << norm2(err) << " (" << norm2(ref) << " - " << norm2(r_eo) << ")" << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
|
||||
std::cout << GridLogMessage << "==============================================================" << std::endl;
|
||||
@@ -204,7 +204,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
Dwc_compact.Mooee(chi_e, src_e);
|
||||
Dwc_compact.MooeeInv(src_e, phi_e);
|
||||
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "==============================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Test MeeDag MeeInvDag = 1 (if csw!=0) " << std::endl;
|
||||
@@ -237,7 +237,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
Dwc_compact.MooeeDag(chi_e, src_e);
|
||||
Dwc_compact.MooeeInvDag(src_e, phi_e);
|
||||
@@ -250,7 +250,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "==============================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Test MeeInv MeeDag = 1 (if csw!=0) " << std::endl;
|
||||
@@ -270,7 +270,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
Dwc_compact.MooeeDag(chi_e, src_e);
|
||||
Dwc_compact.MooeeInv(src_e, phi_e);
|
||||
@@ -283,7 +283,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "================================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Testing gauge covariance Clover term with EO preconditioning " << std::endl;
|
||||
@@ -339,7 +339,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - adj(Omega) * phi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
@@ -368,7 +368,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - adj(Omega) * phi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "=================================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Testing gauge covariance Clover term w/o EO preconditioning " << std::endl;
|
||||
@@ -389,10 +389,10 @@ int main(int argc, char **argv)
|
||||
|
||||
err = result - adj(Omega) * result2;
|
||||
std::cout << GridLogMessage << "norm diff Wilson " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
err = chi - adj(Omega) * phi;
|
||||
std::cout << GridLogMessage << "norm diff WilsonClover " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
@@ -402,7 +402,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - adj(Omega) * phi;
|
||||
std::cout << GridLogMessage << "norm diff CompactWilsonClover " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "==========================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Testing Mooee(csw=0) Clover to reproduce Mooee Wilson " << std::endl;
|
||||
@@ -432,7 +432,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - phi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
@@ -458,7 +458,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - phi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "==========================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Testing EO operator is equal to the unprec " << std::endl;
|
||||
@@ -493,7 +493,7 @@ int main(int argc, char **argv)
|
||||
std::cout << GridLogMessage << "ref (unpreconditioned operator) diff : " << norm2(ref) << std::endl;
|
||||
std::cout << GridLogMessage << "phi (EO decomposition) diff : " << norm2(phi) << std::endl;
|
||||
std::cout << GridLogMessage << "norm diff : " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
@@ -524,7 +524,7 @@ int main(int argc, char **argv)
|
||||
std::cout << GridLogMessage << "ref (unpreconditioned operator) diff compact : " << norm2(ref) << std::endl;
|
||||
std::cout << GridLogMessage << "phi (EO decomposition) diff compact : " << norm2(phi) << std::endl;
|
||||
std::cout << GridLogMessage << "norm diff compact : " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
Grid_finalize();
|
||||
}
|
||||
|
@@ -198,8 +198,8 @@ void TestConserved(Action & Dw,
|
||||
std::cout<<GridLogMessage<<"Vector Ward identity by timeslice (~ 0)"<<std::endl;
|
||||
for(int t=0;t<Nt;t++){
|
||||
std::cout<<GridLogMessage <<" t "<<t<<" SV "<<real(TensorRemove(sumSV[t]))<<" VV "<<real(TensorRemove(sumVV[t]))<<std::endl;
|
||||
assert(abs(real(TensorRemove(sumSV[t]))) < 1e-10);
|
||||
assert(abs(real(TensorRemove(sumVV[t]))) < 1e-2);
|
||||
GRID_ASSERT(abs(real(TensorRemove(sumSV[t]))) < 1e-10);
|
||||
GRID_ASSERT(abs(real(TensorRemove(sumVV[t]))) < 1e-2);
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
@@ -245,9 +245,9 @@ void TestConserved(Action & Dw,
|
||||
|
||||
std::cout<<GridLogMessage << "Consistency check for sequential conserved " <<std::endl;
|
||||
std::cout<<GridLogMessage << "Diff S = " << abs(check_S) << std::endl;
|
||||
assert(abs(check_S) < 1e-8);
|
||||
GRID_ASSERT(abs(check_S) < 1e-8);
|
||||
std::cout<<GridLogMessage << "Diff V = " << abs(check_V) << std::endl;
|
||||
assert(abs(check_V) < 1e-8);
|
||||
GRID_ASSERT(abs(check_V) < 1e-8);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = ref - r_eo;
|
||||
std::cout << GridLogMessage << "EO norm diff\t" << norm2(err) << " (" << norm2(ref) << " - " << norm2(r_eo) << ")" << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = ref - r_eo;
|
||||
std::cout << GridLogMessage << "EO norm diff compact\t" << norm2(err) << " (" << norm2(ref) << " - " << norm2(r_eo) << ")" << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
|
||||
std::cout << GridLogMessage << "==============================================================" << std::endl;
|
||||
@@ -204,7 +204,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
Dwc_compact.Mooee(chi_e, src_e);
|
||||
Dwc_compact.MooeeInv(src_e, phi_e);
|
||||
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "==============================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Test MeeDag MeeInvDag = 1 (if csw!=0) " << std::endl;
|
||||
@@ -237,7 +237,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
Dwc_compact.MooeeDag(chi_e, src_e);
|
||||
Dwc_compact.MooeeInvDag(src_e, phi_e);
|
||||
@@ -250,7 +250,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "==============================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Test MeeInv MeeDag = 1 (if csw!=0) " << std::endl;
|
||||
@@ -270,7 +270,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
Dwc_compact.MooeeDag(chi_e, src_e);
|
||||
Dwc_compact.MooeeInv(src_e, phi_e);
|
||||
@@ -283,7 +283,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = phi - chi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "================================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Testing gauge covariance Clover term with EO preconditioning " << std::endl;
|
||||
@@ -339,7 +339,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - adj(Omega) * phi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
@@ -368,7 +368,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - adj(Omega) * phi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "=================================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Testing gauge covariance Clover term w/o EO preconditioning " << std::endl;
|
||||
@@ -389,10 +389,10 @@ int main(int argc, char **argv)
|
||||
|
||||
err = result - adj(Omega) * result2;
|
||||
std::cout << GridLogMessage << "norm diff Wilson " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
err = chi - adj(Omega) * phi;
|
||||
std::cout << GridLogMessage << "norm diff WilsonExpClover " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
@@ -402,7 +402,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - adj(Omega) * phi;
|
||||
std::cout << GridLogMessage << "norm diff CompactWilsonExpClover " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "==========================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Testing Mooee(csw=0) Clover to reproduce Mooee Wilson " << std::endl;
|
||||
@@ -432,7 +432,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - phi;
|
||||
std::cout << GridLogMessage << "norm diff " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
@@ -458,7 +458,7 @@ int main(int argc, char **argv)
|
||||
|
||||
err = chi - phi;
|
||||
std::cout << GridLogMessage << "norm diff compact " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
std::cout << GridLogMessage << "==========================================================" << std::endl;
|
||||
std::cout << GridLogMessage << "= Testing EO operator is equal to the unprec " << std::endl;
|
||||
@@ -493,7 +493,7 @@ int main(int argc, char **argv)
|
||||
std::cout << GridLogMessage << "ref (unpreconditioned operator) diff : " << norm2(ref) << std::endl;
|
||||
std::cout << GridLogMessage << "phi (EO decomposition) diff : " << norm2(phi) << std::endl;
|
||||
std::cout << GridLogMessage << "norm diff : " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
@@ -524,7 +524,7 @@ int main(int argc, char **argv)
|
||||
std::cout << GridLogMessage << "ref (unpreconditioned operator) diff compact : " << norm2(ref) << std::endl;
|
||||
std::cout << GridLogMessage << "phi (EO decomposition) diff compact : " << norm2(phi) << std::endl;
|
||||
std::cout << GridLogMessage << "norm diff compact : " << norm2(err) << std::endl;
|
||||
assert(fabs(norm2(err)) < tolerance);
|
||||
GRID_ASSERT(fabs(norm2(err)) < tolerance);
|
||||
|
||||
Grid_finalize();
|
||||
}
|
||||
|
@@ -471,8 +471,8 @@ void TestConserved1(Action & Ddwf, Action & Ddwfrev,
|
||||
// Mobius parameters
|
||||
auto b=Ddwf.bs[s];
|
||||
auto c=Ddwf.cs[s];
|
||||
assert(Ddwfrev.bs[sr]==Ddwf.bs[s]);
|
||||
assert(Ddwfrev.cs[sr]==Ddwf.cs[s]);
|
||||
GRID_ASSERT(Ddwfrev.bs[sr]==Ddwf.bs[s]);
|
||||
GRID_ASSERT(Ddwfrev.cs[sr]==Ddwf.cs[s]);
|
||||
|
||||
LatticePropagator tmp(UGrid);
|
||||
|
||||
|
@@ -48,16 +48,16 @@ class HermOpAdaptor : public LinearOperatorBase<Field>
|
||||
LinearOperatorBase<Field> & wrapped;
|
||||
public:
|
||||
HermOpAdaptor(LinearOperatorBase<Field> &wrapme) : wrapped(wrapme) {};
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){ assert(0); };
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){ GRID_ASSERT(0); };
|
||||
void Op (const Field &in, Field &out){
|
||||
wrapped.HermOp(in,out);
|
||||
}
|
||||
void AdjOp (const Field &in, Field &out){
|
||||
wrapped.HermOp(in,out);
|
||||
}
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
void HermOp(const Field &in, Field &out){
|
||||
wrapped.HermOp(in,out);
|
||||
}
|
||||
@@ -286,7 +286,7 @@ int main (int argc, char ** argv)
|
||||
chi=chi-Aphi;
|
||||
RealD diff =norm2(chi);
|
||||
std::cout << r << " diff " << diff<<std::endl;
|
||||
assert(diff < 1.0e-10);
|
||||
GRID_ASSERT(diff < 1.0e-10);
|
||||
}
|
||||
std::cout << nrhs<< " mrhs " << t0/ncall/nrhs <<" us"<<std::endl;
|
||||
std::cout << nrhs<< " srhs " << t1/ncall/nrhs <<" us"<<std::endl;
|
||||
|
@@ -43,10 +43,10 @@ public:
|
||||
void Op (const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void HermOp(const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void AdjOp (const Field &in, Field &out){ wrapped.HermOp(in,out); }
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { assert(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { GRID_ASSERT(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
};
|
||||
|
||||
template<class Field> class CGSmoother : public LinearFunction<Field>
|
||||
|
@@ -40,7 +40,7 @@ void SaveOperator(Coarsened &Operator,std::string file)
|
||||
#ifdef HAVE_LIME
|
||||
emptyUserRecord record;
|
||||
ScidacWriter WR(Operator.Grid()->IsBoss());
|
||||
assert(Operator._A.size()==Operator.geom.npoint);
|
||||
GRID_ASSERT(Operator._A.size()==Operator.geom.npoint);
|
||||
WR.open(file);
|
||||
for(int p=0;p<Operator._A.size();p++){
|
||||
auto tmp = Operator.Cell.Extract(Operator._A[p]);
|
||||
@@ -57,7 +57,7 @@ void LoadOperator(Coarsened &Operator,std::string file)
|
||||
emptyUserRecord record;
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(file);
|
||||
assert(Operator._A.size()==Operator.geom.npoint);
|
||||
GRID_ASSERT(Operator._A.size()==Operator.geom.npoint);
|
||||
for(int p=0;p<Operator.geom.npoint;p++){
|
||||
conformable(Operator._A[p].Grid(),Operator.CoarseGrid());
|
||||
// RD.readScidacFieldRecord(Operator._A[p],record,BINARYIO_LEXICOGRAPHIC);
|
||||
@@ -74,7 +74,7 @@ void ReLoadOperator(Coarsened &Operator,std::string file)
|
||||
emptyUserRecord record;
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(file);
|
||||
assert(Operator._A.size()==Operator.geom.npoint);
|
||||
GRID_ASSERT(Operator._A.size()==Operator.geom.npoint);
|
||||
for(int p=0;p<Operator.geom.npoint;p++){
|
||||
auto tmp=Operator.Cell.Extract(Operator._A[p]);
|
||||
RD.readScidacFieldRecord(tmp,record,0);
|
||||
@@ -126,10 +126,10 @@ public:
|
||||
void Op (const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void HermOp(const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void AdjOp (const Field &in, Field &out){ wrapped.HermOp(in,out); }
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { assert(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { GRID_ASSERT(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
};
|
||||
/*
|
||||
template<class Field> class ChebyshevSmoother : public LinearFunction<Field>
|
||||
|
@@ -44,7 +44,7 @@ void SaveOperator(Coarsened &Operator,std::string file)
|
||||
#ifdef HAVE_LIME
|
||||
emptyUserRecord record;
|
||||
ScidacWriter WR(Operator.Grid()->IsBoss());
|
||||
assert(Operator._A.size()==Operator.geom.npoint);
|
||||
GRID_ASSERT(Operator._A.size()==Operator.geom.npoint);
|
||||
WR.open(file);
|
||||
for(int p=0;p<Operator._A.size();p++){
|
||||
auto tmp = Operator.Cell.Extract(Operator._A[p]);
|
||||
@@ -61,7 +61,7 @@ void LoadOperator(Coarsened &Operator,std::string file)
|
||||
emptyUserRecord record;
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(file);
|
||||
assert(Operator._A.size()==Operator.geom.npoint);
|
||||
GRID_ASSERT(Operator._A.size()==Operator.geom.npoint);
|
||||
for(int p=0;p<Operator.geom.npoint;p++){
|
||||
conformable(Operator._A[p].Grid(),Operator.CoarseGrid());
|
||||
// RD.readScidacFieldRecord(Operator._A[p],record,BINARYIO_LEXICOGRAPHIC);
|
||||
@@ -78,7 +78,7 @@ void ReLoadOperator(Coarsened &Operator,std::string file)
|
||||
emptyUserRecord record;
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(file);
|
||||
assert(Operator._A.size()==Operator.geom.npoint);
|
||||
GRID_ASSERT(Operator._A.size()==Operator.geom.npoint);
|
||||
for(int p=0;p<Operator.geom.npoint;p++){
|
||||
auto tmp=Operator.Cell.Extract(Operator._A[p]);
|
||||
RD.readScidacFieldRecord(tmp,record,0);
|
||||
@@ -147,7 +147,7 @@ void LoadEigenvectors(std::vector<RealD> &eval,
|
||||
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(evec_file);
|
||||
assert(evec.size()==eval.size());
|
||||
GRID_ASSERT(evec.size()==eval.size());
|
||||
for(int k=0;k<eval.size();k++) {
|
||||
RD.readScidacFieldRecord(evec[k],record);
|
||||
}
|
||||
@@ -165,10 +165,10 @@ public:
|
||||
void Op (const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void HermOp(const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void AdjOp (const Field &in, Field &out){ wrapped.HermOp(in,out); }
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { assert(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { GRID_ASSERT(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
};
|
||||
|
||||
template<class Field> class CGSmoother : public LinearFunction<Field>
|
||||
|
@@ -148,7 +148,7 @@ void LoadEigenvectors(std::vector<RealD> &eval,
|
||||
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(evec_file);
|
||||
assert(evec.size()==eval.size());
|
||||
GRID_ASSERT(evec.size()==eval.size());
|
||||
for(int k=0;k<eval.size();k++) {
|
||||
RD.readScidacFieldRecord(evec[k],record);
|
||||
}
|
||||
@@ -166,10 +166,10 @@ public:
|
||||
void Op (const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void HermOp(const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void AdjOp (const Field &in, Field &out){ wrapped.HermOp(in,out); }
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { assert(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { GRID_ASSERT(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
};
|
||||
|
||||
template<class Field> class FixedCGPolynomial : public LinearFunction<Field>
|
||||
|
@@ -148,7 +148,7 @@ void LoadEigenvectors(std::vector<RealD> &eval,
|
||||
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(evec_file);
|
||||
assert(evec.size()==eval.size());
|
||||
GRID_ASSERT(evec.size()==eval.size());
|
||||
for(int k=0;k<eval.size();k++) {
|
||||
RD.readScidacFieldRecord(evec[k],record);
|
||||
}
|
||||
@@ -166,10 +166,10 @@ public:
|
||||
void Op (const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void HermOp(const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void AdjOp (const Field &in, Field &out){ wrapped.HermOp(in,out); }
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { assert(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { GRID_ASSERT(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
};
|
||||
|
||||
template<class Field> class FixedCGPolynomial : public LinearFunction<Field>
|
||||
|
@@ -119,7 +119,7 @@ void LoadEigenvectors(std::vector<RealD> &eval,
|
||||
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(evec_file);
|
||||
assert(evec.size()==eval.size());
|
||||
GRID_ASSERT(evec.size()==eval.size());
|
||||
for(int k=0;k<eval.size();k++) {
|
||||
RD.readScidacFieldRecord(evec[k],record);
|
||||
}
|
||||
@@ -137,10 +137,10 @@ public:
|
||||
void Op (const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void HermOp(const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void AdjOp (const Field &in, Field &out){ wrapped.HermOp(in,out); }
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { assert(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { GRID_ASSERT(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
};
|
||||
|
||||
template<class Field> class CGSmoother : public LinearFunction<Field>
|
||||
|
@@ -92,7 +92,7 @@ void LoadEigenvectors(std::vector<RealD> &eval,
|
||||
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(evec_file);
|
||||
assert(evec.size()==eval.size());
|
||||
GRID_ASSERT(evec.size()==eval.size());
|
||||
for(int k=0;k<eval.size();k++) {
|
||||
RD.readScidacFieldRecord(evec[k],record);
|
||||
}
|
||||
@@ -110,10 +110,10 @@ public:
|
||||
void Op (const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void HermOp(const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void AdjOp (const Field &in, Field &out){ wrapped.HermOp(in,out); }
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { assert(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { GRID_ASSERT(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
};
|
||||
|
||||
template<class Field> class CGSmoother : public LinearFunction<Field>
|
||||
|
@@ -92,7 +92,7 @@ void LoadEigenvectors(std::vector<RealD> &eval,
|
||||
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(evec_file);
|
||||
assert(evec.size()==eval.size());
|
||||
GRID_ASSERT(evec.size()==eval.size());
|
||||
for(int k=0;k<eval.size();k++) {
|
||||
RD.readScidacFieldRecord(evec[k],record);
|
||||
}
|
||||
@@ -110,10 +110,10 @@ public:
|
||||
void Op (const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void HermOp(const Field &in, Field &out) { wrapped.HermOp(in,out); }
|
||||
void AdjOp (const Field &in, Field &out){ wrapped.HermOp(in,out); }
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { assert(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out) { GRID_ASSERT(0); };
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
};
|
||||
|
||||
template<class Field> class CGSmoother : public LinearFunction<Field>
|
||||
|
@@ -43,9 +43,9 @@ class PVdagMLinearOperator : public LinearOperatorBase<Field> {
|
||||
public:
|
||||
PVdagMLinearOperator(Matrix &Mat,Matrix &PV): _Mat(Mat),_PV(PV){};
|
||||
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){ assert(0); };
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){ GRID_ASSERT(0); };
|
||||
void Op (const Field &in, Field &out){
|
||||
// std::cout << "Op: PVdag M "<<std::endl;
|
||||
Field tmp(in.Grid());
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
_PV.M(in,tmp);
|
||||
_Mat.Mdag(tmp,out);
|
||||
}
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
void HermOp(const Field &in, Field &out){
|
||||
// std::cout << "HermOp: Mdag PV PVdag M"<<std::endl;
|
||||
Field tmp(in.Grid());
|
||||
@@ -79,9 +79,9 @@ class ShiftedPVdagMLinearOperator : public LinearOperatorBase<Field> {
|
||||
public:
|
||||
ShiftedPVdagMLinearOperator(RealD _shift,Matrix &Mat,Matrix &PV): shift(_shift),_Mat(Mat),_PV(PV){};
|
||||
|
||||
void OpDiag (const Field &in, Field &out) { assert(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { assert(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){ assert(0); };
|
||||
void OpDiag (const Field &in, Field &out) { GRID_ASSERT(0); }
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) { GRID_ASSERT(0); }
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){ GRID_ASSERT(0); };
|
||||
void Op (const Field &in, Field &out){
|
||||
// std::cout << "Op: PVdag M "<<std::endl;
|
||||
Field tmp(in.Grid());
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
_Mat.Mdag(in,tmp);
|
||||
out = out + shift * in;
|
||||
}
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ assert(0); }
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){ GRID_ASSERT(0); }
|
||||
void HermOp(const Field &in, Field &out){
|
||||
// std::cout << "HermOp: Mdag PV PVdag M"<<std::endl;
|
||||
Field tmp(in.Grid());
|
||||
|
@@ -177,7 +177,7 @@ int main (int argc, char ** argv)
|
||||
GaugeLorentz diff = derivOrig - derivNew;
|
||||
double n = norm2(diff);
|
||||
std::cout << GridLogMessage << "Difference " << n << " (expect 0)" << std::endl;
|
||||
assert(n<1e-10);
|
||||
GRID_ASSERT(n<1e-10);
|
||||
|
||||
std::cout << GridLogMessage << "Timings orig: " << (t1-t0)/1000 << "ms, new: " << (t2-t1)/1000 << "ms" << std::endl;
|
||||
torig += (t1-t0)/1000; tnew += (t2-t1)/1000;
|
||||
|
@@ -86,7 +86,7 @@ int main (int argc, char ** argv)
|
||||
GaugeMat diff = staple_orig - staple_opt;
|
||||
double n = norm2(diff);
|
||||
std::cout << GridLogMessage << mu << " " << n << std::endl;
|
||||
assert(n<1e-10);
|
||||
GRID_ASSERT(n<1e-10);
|
||||
}
|
||||
std::cout << GridLogMessage << "RectStaple timings orig: " << torig/1000/count << "ms, optimized: " << topt/1000/count << "ms" << std::endl;
|
||||
|
||||
|
@@ -106,7 +106,7 @@ int main (int argc, char ** argv)
|
||||
peekLocalSite(g,Ug_v,gcoor);
|
||||
peekLocalSite(l,Ul_v,lcoor);
|
||||
g=g-l;
|
||||
assert(norm2(g)==0);
|
||||
GRID_ASSERT(norm2(g)==0);
|
||||
diff = diff + norm2(g);
|
||||
n = n + norm2(l);
|
||||
}}}}
|
||||
@@ -198,6 +198,6 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << " Average plaquette via padded cell "<<result<<std::endl;
|
||||
std::cout << GridLogMessage << " Diff "<<result-plaq<<std::endl;
|
||||
|
||||
assert(fabs(result-plaq)<1.0e-8);
|
||||
GRID_ASSERT(fabs(result-plaq)<1.0e-8);
|
||||
Grid_finalize();
|
||||
}
|
||||
|
@@ -490,7 +490,7 @@ public:
|
||||
|
||||
}
|
||||
}
|
||||
assert(s==nshift);
|
||||
GRID_ASSERT(s==nshift);
|
||||
coalescedWrite(gStaple_v[ss],stencil_ss);
|
||||
}
|
||||
);
|
||||
@@ -572,7 +572,7 @@ int main (int argc, char ** argv)
|
||||
GaugeMat diff = staple_orig - staple_padded;
|
||||
double n = norm2(diff);
|
||||
std::cout << GridLogMessage << mu << " " << n << std::endl;
|
||||
assert(n<1e-10);
|
||||
GRID_ASSERT(n<1e-10);
|
||||
}
|
||||
std::cout << GridLogMessage << "RectStaple timings orig: " << torig/1000/count << "ms, padded: " << tpadded/1000/count << "ms" << std::endl;
|
||||
|
||||
|
@@ -179,7 +179,7 @@ void ForceTest(Action<LatticeGaugeField> &action,LatticeGaugeField & U,MomentumF
|
||||
std::cout<< GridLogMessage << "dSpred : "<< dSpred.real() <<std::endl;
|
||||
std::cout<< GridLogMessage << "diff : "<< diff<<std::endl;
|
||||
std::cout<< GridLogMessage << "*********************************************************"<<std::endl;
|
||||
// assert(diff<1.0);
|
||||
// GRID_ASSERT(diff<1.0);
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
std::cout << GridLogMessage << "*********************************************************"<<std::endl;
|
||||
}
|
||||
|
@@ -146,7 +146,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << " Sprime "<<Sprime<<std::endl;
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "predict dS "<< dSpred <<std::endl;
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0e-2 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0e-2 ) ;
|
||||
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -376,7 +376,7 @@ void ForceTest(Action<LatticeGaugeField> &action,LatticeGaugeField & U,MomentumF
|
||||
std::cout<< GridLogMessage << "dSpred : "<< dSpred.real() <<std::endl;
|
||||
std::cout<< GridLogMessage << "diff : "<< diff<<std::endl;
|
||||
std::cout<< GridLogMessage << "*********************************************************"<<std::endl;
|
||||
// assert(diff<1.0);
|
||||
// GRID_ASSERT(diff<1.0);
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
std::cout << GridLogMessage << "*********************************************************"<<std::endl;
|
||||
}
|
||||
|
@@ -150,7 +150,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "predict dS "<< dSpred <<std::endl;
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -166,7 +166,7 @@ int main (int argc, char** argv)
|
||||
printf("real(dS_predict) = %1.15e\n", dSpred.real());
|
||||
printf("imag(dS_predict) = %1.15e\n\n", dSpred.imag());
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
|
||||
std::cout << GridLogMessage << "Done" << std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -241,7 +241,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
std::cout << GridLogMessage << "dS - dt^2 term "<< Hmomprime - Hmom + Sprime - S - dSm2 <<std::endl;
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 5.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 5.0 ) ;
|
||||
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -170,7 +170,7 @@ int main (int argc, char** argv)
|
||||
printf("real(dS_predict) = %1.15e\n", dSpred.real());
|
||||
printf("imag(dS_predict) = %1.15e\n\n", dSpred.imag());
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
|
||||
std::cout << GridLogMessage << "Done" << std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -109,7 +109,7 @@ void ForceTest(Action<LatticeGaugeField> &action,ConfigurationBase<LatticeGaugeF
|
||||
std::cout<< GridLogMessage << "dSpred : "<< dSpred.real() <<std::endl;
|
||||
std::cout<< GridLogMessage << "diff : "<< diff<<std::endl;
|
||||
std::cout<< GridLogMessage << "*********************************************************"<<std::endl;
|
||||
// assert(diff<1.0);
|
||||
// GRID_ASSERT(diff<1.0);
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
std::cout << GridLogMessage << "*********************************************************"<<std::endl;
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << " Sprime "<<Sprime<<std::endl;
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "pred dS "<< dSpred <<std::endl;
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0e-2 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0e-2 ) ;
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
}
|
||||
|
@@ -125,7 +125,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << " Sprime "<<Sprime<<std::endl;
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "pred dS "<< dSpred <<std::endl;
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0e-1 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0e-1 ) ;
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
}
|
||||
|
@@ -202,7 +202,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << " Sprime "<<Sprime<<std::endl;
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "predict dS "<< dSpred <<std::endl;
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
#endif
|
||||
|
@@ -43,7 +43,7 @@ void copyConjGauge(LatticeGaugeFieldD &Umu_1f, const LatticeGaugeFieldD &Umu_2f,
|
||||
|
||||
int L_2f = UGrid_2f->FullDimensions()[nu];
|
||||
int L_1f = UGrid_1f->FullDimensions()[nu];
|
||||
assert(L_1f == 2 * L_2f);
|
||||
GRID_ASSERT(L_1f == 2 * L_2f);
|
||||
|
||||
//Coordinate grid for reference
|
||||
LatticeInteger xcoor_1f(UGrid_1f);
|
||||
@@ -73,7 +73,7 @@ void convertFermion1f_from_2f(FermionField1f &out_1f, const FermionField2f &in_2
|
||||
|
||||
Integer L_2f = FGrid_2f->FullDimensions()[nu+nuoff];
|
||||
Integer L_1f = FGrid_1f->FullDimensions()[nu+nuoff];
|
||||
assert(L_1f == 2 * L_2f);
|
||||
GRID_ASSERT(L_1f == 2 * L_2f);
|
||||
|
||||
auto in_f0_2fgrid = PeekIndex<GparityFlavourIndex>(in_2f,0); //flavor 0 on 2f Grid
|
||||
FermionField1f in_f0_1fgrid(FGrid_1f);
|
||||
@@ -442,7 +442,7 @@ int main (int argc, char ** argv)
|
||||
}else if(action == "DSDR"){
|
||||
runTest<GparityWilsonTMFermionD, WilsonTMFermionD>(argc,argv);
|
||||
}else{
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -152,7 +152,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "predict dS "<< dSpred <<std::endl;
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 2.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 2.0 ) ;
|
||||
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -166,7 +166,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "pred dS "<< dSpred <<std::endl;
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -230,7 +230,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
std::cout << GridLogMessage << "dS - dt^2 term "<< Hmomprime - Hmom + Sprime - S - dSm2 <<std::endl;
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
|
||||
|
||||
|
||||
|
@@ -111,8 +111,8 @@ int main (int argc, char** argv)
|
||||
|
||||
std::cout << "(phi, Mphi) - (eta,eta): " << test << " expect 0" << std::endl;
|
||||
|
||||
assert(test.real() < 1e-8);
|
||||
assert(test.imag() < 1e-8);
|
||||
GRID_ASSERT(test.real() < 1e-8);
|
||||
GRID_ASSERT(test.imag() < 1e-8);
|
||||
|
||||
//Another test is to use heatbath twice to apply M^{-1/2} to Phi then apply M
|
||||
// M Phi'
|
||||
@@ -126,7 +126,7 @@ int main (int argc, char** argv)
|
||||
test2 = test2 - eta;
|
||||
RealD test2_norm = norm2(test2);
|
||||
std::cout << "|M M^{-1/2} M^{-1/2} eta - eta|^2 = " << test2_norm << " expect 0" << std::endl;
|
||||
assert( test2_norm < 1e-8 );
|
||||
GRID_ASSERT( test2_norm < 1e-8 );
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ int main (int argc, char** argv)
|
||||
printf("real(dS_predict) = %1.15e\n", dSpred.real());
|
||||
printf("imag(dS_predict) = %1.15e\n\n", dSpred.imag());
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
|
||||
std::cout << GridLogMessage << "Done" << std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -98,7 +98,7 @@ NAMESPACE_BEGIN(Grid);
|
||||
std::cout << GridLogMessage << " Mixed precision CG wrapper operator() "<<std::endl;
|
||||
|
||||
SchurOperatorD * SchurOpU = static_cast<SchurOperatorD *>(&LinOpU);
|
||||
assert(&(SchurOpU->_Mat)==&(LinOpD._Mat));
|
||||
GRID_ASSERT(&(SchurOpU->_Mat)==&(LinOpD._Mat));
|
||||
|
||||
precisionChange(FermOpF.Umu, FermOpD.Umu);
|
||||
|
||||
@@ -210,14 +210,14 @@ int main (int argc, char** argv)
|
||||
|
||||
std::cout << GridLogMessage << "Phi(double)=" << norm2(MeofaD.getPhi()) << " Phi(mixed)=" << norm2(MeofaMx.getPhi()) << " diff=" << n << std::endl;
|
||||
|
||||
assert(n < 1e-8);
|
||||
GRID_ASSERT(n < 1e-8);
|
||||
|
||||
RealD Sd = MeofaD.S(Ud);
|
||||
RealD Smx = MeofaMx.S(Ud);
|
||||
|
||||
std::cout << GridLogMessage << "Initial action double=" << Sd << " mixed=" << Smx << " diff=" << Sd-Smx << std::endl;
|
||||
|
||||
assert(fabs(Sd-Smx) < 1e-6);
|
||||
GRID_ASSERT(fabs(Sd-Smx) < 1e-6);
|
||||
|
||||
SU<Nc>::HotConfiguration(RNG4,Ud);
|
||||
precisionChange(Uf, Ud);
|
||||
@@ -227,7 +227,7 @@ int main (int argc, char** argv)
|
||||
|
||||
std::cout << GridLogMessage << "After randomizing U, action double=" << Sd << " mixed=" << Smx << " diff=" << Sd-Smx << std::endl;
|
||||
|
||||
assert(fabs(Sd-Smx) < 1e-6);
|
||||
GRID_ASSERT(fabs(Sd-Smx) < 1e-6);
|
||||
|
||||
std::cout << GridLogMessage << "Done" << std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -167,7 +167,7 @@ int main (int argc, char** argv)
|
||||
printf("real(dS_predict) = %1.15e\n", dSpred.real());
|
||||
printf("imag(dS_predict) = %1.15e\n\n", dSpred.imag());
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
|
||||
std::cout << GridLogMessage << "Done" << std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -149,7 +149,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "predict dS "<< dSpred <<std::endl;
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0e-2 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0e-2 ) ;
|
||||
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -123,7 +123,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "pred dS "<< dSpred <<std::endl;
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0e-2 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0e-2 ) ;
|
||||
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -205,7 +205,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
std::cout << GridLogMessage << "Total dS "<< Hmomprime - Hmom + Sprime - S <<std::endl;
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 1.0 ) ;
|
||||
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -188,7 +188,7 @@ int main(int argc, char **argv)
|
||||
|
||||
std::cout << GridLogMessage << "Total dS " << Hmomprime - Hmom + Sprime - S << std::endl;
|
||||
|
||||
assert(fabs(real(Sprime - S - dSpred)) < 1.0);
|
||||
GRID_ASSERT(fabs(real(Sprime - S - dSpred)) < 1.0);
|
||||
|
||||
std::cout << GridLogMessage << "Done" << std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -163,7 +163,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "dS "<<Sprime-S<<std::endl;
|
||||
std::cout << GridLogMessage << "predict dS "<< dSpred <<std::endl;
|
||||
|
||||
assert( fabs(real(Sprime-S-dSpred)) < 3.0 ) ;
|
||||
GRID_ASSERT( fabs(real(Sprime-S-dSpred)) < 3.0 ) ;
|
||||
|
||||
std::cout<< GridLogMessage << "Done" <<std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -54,7 +54,7 @@ void copy2fTo1fFermionField(FermionField1f &out, const FermionField2f &in, int g
|
||||
std::cout << "dim_2f " << dim_2f << std::endl;
|
||||
std::cout << "dim_1f " << dim_1f << std::endl;
|
||||
|
||||
assert(dim_1f[gpdir] == 2*dim_2f[gpdir]);
|
||||
GRID_ASSERT(dim_1f[gpdir] == 2*dim_2f[gpdir]);
|
||||
|
||||
LatticeInteger xcoor_1f(out.Grid()); //5d lattice integer
|
||||
LatticeCoordinate(xcoor_1f,gpdir);
|
||||
|
@@ -139,7 +139,7 @@ int main (int argc, char ** argv)
|
||||
// for(int n=0;n<poles.size();n++){
|
||||
// a = a + residues[n]/(x+poles[n]);
|
||||
// }
|
||||
assert(Sqrt.order==degree);
|
||||
GRID_ASSERT(Sqrt.order==degree);
|
||||
|
||||
combined = Sqrt.norm*src;
|
||||
for(int i=0;i<degree;i++){
|
||||
|
@@ -110,10 +110,10 @@ int main (int argc, char ** argv)
|
||||
std::cout<<GridLogMessage << "x^(1/4) : "<<ssx<<" "<<assx<<std::endl;
|
||||
std::cout<<GridLogMessage << "x^(-1/2): "<<isx<<" "<<aisx<<std::endl;
|
||||
std::cout<<GridLogMessage << "x^(-1/4): "<<issx<<" "<<aissx<<std::endl;
|
||||
assert(fabs(sx-asx)<1.0e-6);
|
||||
assert(fabs(ssx-assx)<1.0e-6);
|
||||
assert(fabs(isx-aisx)<1.0e-6);
|
||||
assert(fabs(issx-aissx)<1.0e-6);
|
||||
GRID_ASSERT(fabs(sx-asx)<1.0e-6);
|
||||
GRID_ASSERT(fabs(ssx-assx)<1.0e-6);
|
||||
GRID_ASSERT(fabs(isx-aisx)<1.0e-6);
|
||||
GRID_ASSERT(fabs(issx-aissx)<1.0e-6);
|
||||
|
||||
Grid_finalize();
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ public:
|
||||
|
||||
void checkpointFine(std::string evecs_file,std::string evals_file)
|
||||
{
|
||||
assert(this->subspace.size()==nbasis);
|
||||
GRID_ASSERT(this->subspace.size()==nbasis);
|
||||
emptyUserRecord record;
|
||||
Grid::ScidacWriter WR(this->_FineGrid->IsBoss());
|
||||
WR.open(evecs_file);
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
XmlReader RDx(evals_file);
|
||||
read(RDx,"evals",this->evals_fine);
|
||||
|
||||
assert(this->evals_fine.size()==nbasis);
|
||||
GRID_ASSERT(this->evals_fine.size()==nbasis);
|
||||
|
||||
std::cout << GridLogIRL<< "checkpointFineRestore: Reading evecs from "<<evecs_file<<std::endl;
|
||||
emptyUserRecord record;
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
XmlReader RDx(evals_file);
|
||||
read(RDx,"evals",this->evals_coarse);
|
||||
|
||||
assert(this->evals_coarse.size()==nvec);
|
||||
GRID_ASSERT(this->evals_coarse.size()==nvec);
|
||||
emptyUserRecord record;
|
||||
std::cout << GridLogIRL<< "checkpointCoarseRestore: Reading evecs from "<<evecs_file<<std::endl;
|
||||
Grid::ScidacReader RD ;
|
||||
@@ -163,18 +163,18 @@ int main (int argc, char ** argv) {
|
||||
|
||||
auto fineLatt = GridDefaultLatt();
|
||||
int dims=fineLatt.size();
|
||||
assert(blockSize.size()==dims+1);
|
||||
GRID_ASSERT(blockSize.size()==dims+1);
|
||||
Coordinate coarseLatt(dims);
|
||||
|
||||
for (int d=0;d<coarseLatt.size();d++){
|
||||
coarseLatt[d] = fineLatt[d]/blockSize[d]; assert(coarseLatt[d]*blockSize[d]==fineLatt[d]);
|
||||
coarseLatt[d] = fineLatt[d]/blockSize[d]; GRID_ASSERT(coarseLatt[d]*blockSize[d]==fineLatt[d]);
|
||||
}
|
||||
|
||||
std::cout << GridLogMessage<< " 5d coarse lattice is ";
|
||||
for (int i=0;i<coarseLatt.size();i++){
|
||||
std::cout << coarseLatt[i]<<"x";
|
||||
}
|
||||
int cLs = Ls/blockSize[dims]; assert(cLs*blockSize[dims]==Ls);
|
||||
int cLs = Ls/blockSize[dims]; GRID_ASSERT(cLs*blockSize[dims]==Ls);
|
||||
std::cout << cLs<<std::endl;
|
||||
|
||||
GridCartesian * CoarseGrid4 = SpaceTimeGrid::makeFourDimGrid(coarseLatt, GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi());
|
||||
@@ -201,14 +201,14 @@ int main (int argc, char ** argv) {
|
||||
|
||||
std::cout << GridLogMessage << "Keep " << fine.Nstop << " fine vectors" << std::endl;
|
||||
std::cout << GridLogMessage << "Keep " << coarse.Nstop << " coarse vectors" << std::endl;
|
||||
assert(Nm2 >= Nm1);
|
||||
GRID_ASSERT(Nm2 >= Nm1);
|
||||
|
||||
const int nbasis= 60;
|
||||
assert(nbasis==Ns1);
|
||||
GRID_ASSERT(nbasis==Ns1);
|
||||
LocalCoherenceLanczosScidac<vSpinColourVector,vTComplex,nbasis> _LocalCoherenceLanczos(FrbGrid,CoarseGrid5,HermOp,Odd);
|
||||
std::cout << GridLogMessage << "Constructed LocalCoherenceLanczos" << std::endl;
|
||||
|
||||
assert( (Params.doFine)||(Params.doFineRead));
|
||||
GRID_ASSERT( (Params.doFine)||(Params.doFineRead));
|
||||
|
||||
if ( Params.doFine ) {
|
||||
std::cout << GridLogMessage << "Performing fine grid IRL Nstop "<< Ns1 << " Nk "<<Nk1<<" Nm "<<Nm1<< std::endl;
|
||||
|
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
void checkpointFine(std::string evecs_file,std::string evals_file)
|
||||
{
|
||||
assert(this->subspace.size()==nbasis);
|
||||
GRID_ASSERT(this->subspace.size()==nbasis);
|
||||
emptyUserRecord record;
|
||||
Grid::ScidacWriter WR(this->_FineGrid->IsBoss());
|
||||
WR.open(evecs_file);
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
XmlReader RDx(evals_file);
|
||||
read(RDx,"evals",this->evals_fine);
|
||||
|
||||
if(this->evals_fine.size() < nbasis) assert(0 && "Not enough fine evals to complete basis");
|
||||
if(this->evals_fine.size() < nbasis) GRID_ASSERT(0 && "Not enough fine evals to complete basis");
|
||||
if(this->evals_fine.size() > nbasis){ //allow the use of precomputed evecs with a larger #evecs
|
||||
std::cout << GridLogMessage << "Truncating " << this->evals_fine.size() << " evals to basis size " << nbasis << std::endl;
|
||||
this->evals_fine.resize(nbasis);
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
XmlReader RDx(evals_file);
|
||||
read(RDx,"evals",this->evals_coarse);
|
||||
|
||||
assert(this->evals_coarse.size()==nvec);
|
||||
GRID_ASSERT(this->evals_coarse.size()==nvec);
|
||||
emptyUserRecord record;
|
||||
std::cout << GridLogIRL<< "checkpointCoarseRestore: Reading evecs from "<<evecs_file<<std::endl;
|
||||
Grid::ScidacReader RD ;
|
||||
@@ -252,7 +252,7 @@ void runTest(const Options &opt){
|
||||
GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(opt.Ls,UGrid);
|
||||
|
||||
//Setup G-parity BCs
|
||||
assert(Nd == 4);
|
||||
GRID_ASSERT(Nd == 4);
|
||||
std::vector<int> dirs4(4);
|
||||
for(int i=0;i<3;i++) dirs4[i] = opt.GparityDirs[i];
|
||||
dirs4[3] = 0; //periodic gauge BC in time
|
||||
@@ -273,14 +273,14 @@ void runTest(const Options &opt){
|
||||
auto fineLatt = GridDefaultLatt();
|
||||
Coordinate coarseLatt(4);
|
||||
for (int d=0;d<4;d++){
|
||||
coarseLatt[d] = fineLatt[d]/opt.blockSize[d]; assert(coarseLatt[d]*opt.blockSize[d]==fineLatt[d]);
|
||||
coarseLatt[d] = fineLatt[d]/opt.blockSize[d]; GRID_ASSERT(coarseLatt[d]*opt.blockSize[d]==fineLatt[d]);
|
||||
}
|
||||
|
||||
std::cout << GridLogMessage<< " 5d coarse lattice is ";
|
||||
for (int i=0;i<4;i++){
|
||||
std::cout << coarseLatt[i]<<"x";
|
||||
}
|
||||
int cLs = opt.Ls/opt.blockSize[4]; assert(cLs*opt.blockSize[4]==opt.Ls);
|
||||
int cLs = opt.Ls/opt.blockSize[4]; GRID_ASSERT(cLs*opt.blockSize[4]==opt.Ls);
|
||||
std::cout << cLs<<std::endl;
|
||||
|
||||
GridCartesian * CoarseGrid4 = SpaceTimeGrid::makeFourDimGrid(coarseLatt, GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi());
|
||||
@@ -304,9 +304,9 @@ void runTest(const Options &opt){
|
||||
|
||||
std::cout << GridLogMessage << "Keep " << fine.N_true_get << " fine vectors" << std::endl;
|
||||
std::cout << GridLogMessage << "Keep " << coarse.N_true_get << " coarse vectors" << std::endl;
|
||||
assert(coarse.N_true_get >= fine.N_true_get);
|
||||
GRID_ASSERT(coarse.N_true_get >= fine.N_true_get);
|
||||
|
||||
assert(nbasis<=fine.N_true_get);
|
||||
GRID_ASSERT(nbasis<=fine.N_true_get);
|
||||
LocalCoherenceLanczosScidac<SiteSpinor,vTComplex,nbasis> _LocalCoherenceLanczos(FrbGrid,CoarseGrid5,SchurOp,Odd);
|
||||
std::cout << GridLogMessage << "Constructed LocalCoherenceLanczos" << std::endl;
|
||||
|
||||
@@ -411,7 +411,7 @@ int main (int argc, char ** argv)
|
||||
}
|
||||
opt.config = argv[1];
|
||||
GridCmdOptionIntVector(argv[2], opt.GparityDirs);
|
||||
assert(opt.GparityDirs.size() == 3);
|
||||
GRID_ASSERT(opt.GparityDirs.size() == 3);
|
||||
|
||||
for(int i=3;i<argc;i++){
|
||||
std::string sarg = argv[i];
|
||||
@@ -423,7 +423,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "Set quark mass to " << opt.mass << std::endl;
|
||||
}else if(sarg == "--block"){
|
||||
GridCmdOptionIntVector(argv[i+1], opt.blockSize);
|
||||
assert(opt.blockSize.size() == 5);
|
||||
GRID_ASSERT(opt.blockSize.size() == 5);
|
||||
std::cout << GridLogMessage << "Set block size to ";
|
||||
for(int q=0;q<5;q++) std::cout << opt.blockSize[q] << " ";
|
||||
std::cout << std::endl;
|
||||
@@ -480,7 +480,7 @@ int main (int argc, char ** argv)
|
||||
runTest<350>(opt); break;
|
||||
default:
|
||||
std::cout << GridLogMessage << "Unsupported basis size " << basis_size << std::endl;
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
|
||||
Grid_finalize();
|
||||
|
@@ -386,7 +386,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
FILE *fp = fopen("lego-plot.py","w"); assert(fp!=NULL);
|
||||
FILE *fp = fopen("lego-plot.py","w"); GRID_ASSERT(fp!=NULL);
|
||||
#define PYTHON_LINE(A) fprintf(fp,A"\n");
|
||||
PYTHON_LINE("import matplotlib.pyplot as plt");
|
||||
PYTHON_LINE("import numpy as np");
|
||||
|
@@ -95,13 +95,13 @@ void CmdJobParams::Parse(char **argv,int argc)
|
||||
if( GridCmdOptionExists(argv,argv+argc,"--phase") ){
|
||||
arg = GridCmdOptionPayload(argv,argv+argc,"--phase");
|
||||
pfile.open(arg);
|
||||
assert(pfile);
|
||||
GRID_ASSERT(pfile);
|
||||
expect = 0;
|
||||
while( pfile >> vstr ) {
|
||||
if ( vstr.compare("boundary_phase") == 0 ) {
|
||||
pfile >> vstr;
|
||||
GridCmdOptionInt(vstr,idx);
|
||||
assert(expect==idx);
|
||||
GRID_ASSERT(expect==idx);
|
||||
pfile >> vstr;
|
||||
GridCmdOptionFloat(vstr,re);
|
||||
pfile >> vstr;
|
||||
@@ -118,13 +118,13 @@ void CmdJobParams::Parse(char **argv,int argc)
|
||||
if( GridCmdOptionExists(argv,argv+argc,"--omega") ){
|
||||
arg = GridCmdOptionPayload(argv,argv+argc,"--omega");
|
||||
pfile.open(arg);
|
||||
assert(pfile);
|
||||
GRID_ASSERT(pfile);
|
||||
Ls = 0;
|
||||
while( pfile >> vstr ) {
|
||||
if ( vstr.compare("omega") == 0 ) {
|
||||
pfile >> vstr;
|
||||
GridCmdOptionInt(vstr,idx);
|
||||
assert(Ls==idx);
|
||||
GRID_ASSERT(Ls==idx);
|
||||
pfile >> vstr;
|
||||
GridCmdOptionFloat(vstr,re);
|
||||
pfile >> vstr;
|
||||
@@ -324,7 +324,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "mpi_layout= " << mpi_layout << std::endl;
|
||||
std::cout << GridLogMessage << "mpi_split= " << mpi_split << std::endl;
|
||||
std::cout << GridLogMessage << "mrhs= " << mrhs << std::endl;
|
||||
// assert(JP.Nu==tmp);
|
||||
// GRID_ASSERT(JP.Nu==tmp);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// Split into 1^4 mpi communicators, keeping it explicitly single
|
||||
|
@@ -57,7 +57,7 @@ public:
|
||||
|
||||
void checkpointFine(std::string evecs_file,std::string evals_file)
|
||||
{
|
||||
assert(this->subspace.size()==nbasis);
|
||||
GRID_ASSERT(this->subspace.size()==nbasis);
|
||||
emptyUserRecord record;
|
||||
Grid::ScidacWriter WR(this->_FineGrid->IsBoss());
|
||||
WR.open(evecs_file);
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
XmlReader RDx(evals_file);
|
||||
read(RDx,"evals",this->evals_fine);
|
||||
|
||||
assert(this->evals_fine.size()==nbasis);
|
||||
GRID_ASSERT(this->evals_fine.size()==nbasis);
|
||||
|
||||
std::cout << GridLogIRL<< "checkpointFineRestore: Reading evecs from "<<evecs_file<<std::endl;
|
||||
emptyUserRecord record;
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
XmlReader RDx(evals_file);
|
||||
read(RDx,"evals",this->evals_coarse);
|
||||
|
||||
assert(this->evals_coarse.size()==nvec);
|
||||
GRID_ASSERT(this->evals_coarse.size()==nvec);
|
||||
emptyUserRecord record;
|
||||
std::cout << GridLogIRL<< "checkpointCoarseRestore: Reading evecs from "<<evecs_file<<std::endl;
|
||||
Grid::ScidacReader RD ;
|
||||
@@ -162,19 +162,19 @@ int main (int argc, char ** argv) {
|
||||
|
||||
Coordinate fineLatt = GridDefaultLatt();
|
||||
int dims=fineLatt.size();
|
||||
assert(blockSize.size()==dims+1);
|
||||
GRID_ASSERT(blockSize.size()==dims+1);
|
||||
Coordinate coarseLatt(dims);
|
||||
Coordinate coarseLatt5d ;
|
||||
|
||||
for (int d=0;d<coarseLatt.size();d++){
|
||||
coarseLatt[d] = fineLatt[d]/blockSize[d]; assert(coarseLatt[d]*blockSize[d]==fineLatt[d]);
|
||||
coarseLatt[d] = fineLatt[d]/blockSize[d]; GRID_ASSERT(coarseLatt[d]*blockSize[d]==fineLatt[d]);
|
||||
}
|
||||
|
||||
std::cout << GridLogMessage<< " 5d coarse lattice is ";
|
||||
for (int i=0;i<coarseLatt.size();i++){
|
||||
std::cout << coarseLatt[i]<<"x";
|
||||
}
|
||||
int cLs = Ls/blockSize[dims]; assert(cLs*blockSize[dims]==Ls);
|
||||
int cLs = Ls/blockSize[dims]; GRID_ASSERT(cLs*blockSize[dims]==Ls);
|
||||
std::cout << cLs<<std::endl;
|
||||
|
||||
GridCartesian * CoarseGrid4 = SpaceTimeGrid::makeFourDimGrid(coarseLatt, GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi());
|
||||
@@ -201,14 +201,14 @@ int main (int argc, char ** argv) {
|
||||
|
||||
std::cout << GridLogMessage << "Keep " << fine.Nstop << " fine vectors" << std::endl;
|
||||
std::cout << GridLogMessage << "Keep " << coarse.Nstop << " coarse vectors" << std::endl;
|
||||
assert(Nm2 >= Nm1);
|
||||
GRID_ASSERT(Nm2 >= Nm1);
|
||||
|
||||
const int nbasis= 60;
|
||||
assert(nbasis==Ns1);
|
||||
GRID_ASSERT(nbasis==Ns1);
|
||||
LocalCoherenceLanczosScidac<vSpinColourVector,vTComplex,nbasis> _LocalCoherenceLanczos(FrbGrid,CoarseGrid5,HermOp,Odd);
|
||||
std::cout << GridLogMessage << "Constructed LocalCoherenceLanczos" << std::endl;
|
||||
|
||||
assert( (Params.doFine)||(Params.doFineRead));
|
||||
GRID_ASSERT( (Params.doFine)||(Params.doFineRead));
|
||||
|
||||
if ( Params.doFine ) {
|
||||
std::cout << GridLogMessage << "Performing fine grid IRL Nstop "<< Ns1 << " Nk "<<Nk1<<" Nm "<<Nm1<< std::endl;
|
||||
|
@@ -159,7 +159,7 @@ public:
|
||||
void calcFine(RealD alpha, RealD beta,int Npoly,int Nm,RealD resid,
|
||||
RealD MaxIt, RealD betastp, int MinRes)
|
||||
{
|
||||
assert(nbasis<=Nm);
|
||||
GRID_ASSERT(nbasis<=Nm);
|
||||
Chebyshev<FineField> Cheby(alpha,beta,Npoly);
|
||||
FunctionHermOp<FineField> ChebyOp(Cheby,_FineOp);
|
||||
PlainHermOp<FineField> Op(_FineOp);
|
||||
@@ -269,19 +269,19 @@ int main (int argc, char ** argv) {
|
||||
|
||||
Coordinate fineLatt = GridDefaultLatt();
|
||||
int dims=fineLatt.size();
|
||||
assert(blockSize.size()==dims+1);
|
||||
GRID_ASSERT(blockSize.size()==dims+1);
|
||||
Coordinate coarseLatt(dims);
|
||||
Coordinate coarseLatt5d ;
|
||||
|
||||
for (int d=0;d<coarseLatt.size();d++){
|
||||
coarseLatt[d] = fineLatt[d]/blockSize[d]; assert(coarseLatt[d]*blockSize[d]==fineLatt[d]);
|
||||
coarseLatt[d] = fineLatt[d]/blockSize[d]; GRID_ASSERT(coarseLatt[d]*blockSize[d]==fineLatt[d]);
|
||||
}
|
||||
|
||||
std::cout << GridLogMessage<< " 5d coarse lattice is ";
|
||||
for (int i=0;i<coarseLatt.size();i++){
|
||||
std::cout << coarseLatt[i]<<"x";
|
||||
}
|
||||
int cLs = Ls/blockSize[dims]; assert(cLs*blockSize[dims]==Ls);
|
||||
int cLs = Ls/blockSize[dims]; GRID_ASSERT(cLs*blockSize[dims]==Ls);
|
||||
std::cout << cLs<<std::endl;
|
||||
|
||||
GridCartesian * CoarseGrid4 = SpaceTimeGrid::makeFourDimGrid(coarseLatt, GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi());
|
||||
@@ -312,7 +312,7 @@ int main (int argc, char ** argv) {
|
||||
|
||||
std::cout << GridLogMessage << "Keep " << fine.Nk << " full vectors" << std::endl;
|
||||
std::cout << GridLogMessage << "Keep " << coarse.Nk << " total vectors" << std::endl;
|
||||
assert(Nm2 >= Nm1);
|
||||
GRID_ASSERT(Nm2 >= Nm1);
|
||||
|
||||
const int nbasis= 32;
|
||||
CoarseFineIRL<vSpinColourVector,vTComplex,nbasis> IRL(FrbGrid,CoarseGrid5rb,HermOp,Odd);
|
||||
|
@@ -96,7 +96,7 @@ public:
|
||||
GridBase *FineGrid,
|
||||
GridBase *CoarseGrid){
|
||||
int nevecs = evecs_in.size();
|
||||
assert(nevecs > nbasis);
|
||||
GRID_ASSERT(nevecs > nbasis);
|
||||
|
||||
//Construct the basis
|
||||
basis.resize(nbasis, FineGrid);
|
||||
@@ -273,7 +273,7 @@ struct Args{
|
||||
|
||||
GparityWilsonImplD::ImplParams setupGparityParams(const std::vector<int> &GparityDirs){
|
||||
//Setup G-parity BCs
|
||||
assert(Nd == 4);
|
||||
GRID_ASSERT(Nd == 4);
|
||||
std::vector<int> dirs4(4);
|
||||
for(int i=0;i<3;i++) dirs4[i] = GparityDirs[i];
|
||||
dirs4[3] = 0; //periodic gauge BC in time
|
||||
@@ -309,14 +309,14 @@ void run_b(ActionType &action, const std::string &config, const Args &args){
|
||||
auto fineLatt = GridDefaultLatt();
|
||||
Coordinate coarseLatt(4);
|
||||
for (int d=0;d<4;d++){
|
||||
coarseLatt[d] = fineLatt[d]/args.blockSize[d]; assert(coarseLatt[d]*args.blockSize[d]==fineLatt[d]);
|
||||
coarseLatt[d] = fineLatt[d]/args.blockSize[d]; GRID_ASSERT(coarseLatt[d]*args.blockSize[d]==fineLatt[d]);
|
||||
}
|
||||
|
||||
std::cout << GridLogMessage<< " 5d coarse lattice is ";
|
||||
for (int i=0;i<4;i++){
|
||||
std::cout << coarseLatt[i]<<"x";
|
||||
}
|
||||
int cLs = args.Ls/args.blockSize[4]; assert(cLs*args.blockSize[4]==args.Ls);
|
||||
int cLs = args.Ls/args.blockSize[4]; GRID_ASSERT(cLs*args.blockSize[4]==args.Ls);
|
||||
std::cout << cLs<<std::endl;
|
||||
|
||||
GridCartesian * CoarseGrid4 = SpaceTimeGrid::makeFourDimGrid(coarseLatt, GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi());
|
||||
@@ -350,7 +350,7 @@ void run_b(ActionType &action, const std::string &config, const Args &args){
|
||||
XmlReader RDx(evals_file);
|
||||
read(RDx,"evals",evals);
|
||||
|
||||
assert(evals.size()==fine.N_true_get);
|
||||
GRID_ASSERT(evals.size()==fine.N_true_get);
|
||||
|
||||
std::cout << GridLogIRL<< "Reading evecs from "<<evecs_file<<std::endl;
|
||||
emptyUserRecord record;
|
||||
@@ -369,7 +369,7 @@ void run_b(ActionType &action, const std::string &config, const Args &args){
|
||||
RealD resid = fine.stop_rsd;
|
||||
int MaxIt = fine.maxits;
|
||||
|
||||
assert(nbasis<=Nm);
|
||||
GRID_ASSERT(nbasis<=Nm);
|
||||
Chebyshev<FermionField> Cheby(fine.getChebyParams());
|
||||
FunctionHermOp<FermionField> ChebyOp(Cheby,SchurOp);
|
||||
PlainHermOp<FermionField> Op(SchurOp);
|
||||
@@ -386,7 +386,7 @@ void run_b(ActionType &action, const std::string &config, const Args &args){
|
||||
|
||||
int Nconv;
|
||||
IRL.calc(evals, evecs,src,Nconv,false);
|
||||
if(Nconv < Nstop) assert(0 && "Fine lanczos failed to converge the required number of evecs"); //algorithm doesn't consider this a failure
|
||||
if(Nconv < Nstop) GRID_ASSERT(0 && "Fine lanczos failed to converge the required number of evecs"); //algorithm doesn't consider this a failure
|
||||
if(Nconv > Nstop){
|
||||
//Yes this potentially throws away some evecs but it is better than having a random number of evecs between Nstop and Nm!
|
||||
evals.resize(Nstop);
|
||||
@@ -430,7 +430,7 @@ void run_b(ActionType &action, const std::string &config, const Args &args){
|
||||
Chebyshev<FermionField> smoother(fine.getChebyParams());
|
||||
|
||||
//Test the quality of the uncompressed evecs
|
||||
assert( compressor.testCompression(SchurOp, smoother, basis, compressed_evecs, evals, fine.stop_rsd, args.coarse_relax_tol) );
|
||||
GRID_ASSERT( compressor.testCompression(SchurOp, smoother, basis, compressed_evecs, evals, fine.stop_rsd, args.coarse_relax_tol) );
|
||||
}
|
||||
|
||||
template<typename ActionType>
|
||||
@@ -453,7 +453,7 @@ void run(ActionType &action, const std::string &config, const Args &args){
|
||||
case 400:
|
||||
return run_b<400>(action,config,args);
|
||||
default:
|
||||
assert(0 && "Unsupported basis size: allowed values are 50,100,200,250,300,350,400");
|
||||
GRID_ASSERT(0 && "Unsupported basis size: allowed values are 50,100,200,250,300,350,400");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ int main (int argc, char ** argv) {
|
||||
|
||||
Args args;
|
||||
GridCmdOptionIntVector(argv[2], args.GparityDirs);
|
||||
assert(args.GparityDirs.size() == 3);
|
||||
GRID_ASSERT(args.GparityDirs.size() == 3);
|
||||
|
||||
std::string action_s = "Mobius";
|
||||
|
||||
@@ -503,7 +503,7 @@ int main (int argc, char ** argv) {
|
||||
std::cout << GridLogMessage << "Set quark mass to " << args.mass << std::endl;
|
||||
}else if(sarg == "--block"){
|
||||
GridCmdOptionIntVector(argv[i+1], args.blockSize);
|
||||
assert(args.blockSize.size() == 5);
|
||||
GRID_ASSERT(args.blockSize.size() == 5);
|
||||
std::cout << GridLogMessage << "Set block size to ";
|
||||
for(int q=0;q<5;q++) std::cout << args.blockSize[q] << " ";
|
||||
std::cout << std::endl;
|
||||
@@ -567,7 +567,7 @@ int main (int argc, char ** argv) {
|
||||
run(action, config, args);
|
||||
}
|
||||
#else
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
#endif
|
||||
}else{
|
||||
WilsonImplD::ImplParams Params = setupParams();
|
||||
|
@@ -71,23 +71,23 @@ public:
|
||||
|
||||
// Support for coarsening to a multigrid
|
||||
void OpDiag (const Field &in, Field &out) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
_Mat.Mdiag(in,out);
|
||||
}
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
_Mat.Mdir(in,out,dir,disp);
|
||||
}
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
_Mat.MdirAll(in,out);
|
||||
};
|
||||
void Op (const Field &in, Field &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
_Mat.M(in,out);
|
||||
}
|
||||
void AdjOp (const Field &in, Field &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
_Mat.Mdag(in,out);
|
||||
}
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){
|
||||
|
@@ -387,7 +387,7 @@ public:
|
||||
Handle< LinearOperatorArray<T4> > M(S_f.linOp(fs));
|
||||
return M;
|
||||
}
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
|
||||
static Chroma::Handle< Chroma::SystemSolver<QDP::LatticeFermion> > GetSolver(QDP::multi1d<QDP::LatticeColorMatrix> &u, ChromaAction parms)
|
||||
@@ -745,7 +745,7 @@ void calc_grid(ChromaAction action,Grid::LatticeGaugeField & Umu, Grid::LatticeF
|
||||
return;
|
||||
}
|
||||
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -440,7 +440,7 @@ void calc_grid(ChromaAction action, Grid::LatticeGaugeField &Umu, Grid::LatticeF
|
||||
return;
|
||||
}
|
||||
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
@@ -47,7 +47,7 @@ RealD interpolate(const RealD t_int, const std::vector<std::pair<RealD,RealD> >
|
||||
}
|
||||
else if(diff < tdiff2){ tdiff2 = diff; t2_idx = i; }
|
||||
}
|
||||
assert(t1_idx != -1 && t2_idx != -1);
|
||||
GRID_ASSERT(t1_idx != -1 && t2_idx != -1);
|
||||
|
||||
RealD t2 = data[t2_idx].first, v2 = data[t2_idx].second;
|
||||
RealD t1 = data[t1_idx].first, v1 = data[t1_idx].second;
|
||||
|
@@ -169,7 +169,7 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "norm2(Munprec), norm2(Dhop + Mdiag), abs. deviation, rel. deviation: "
|
||||
<< norm2(ref) << " " << norm2(res) << " " << absDev << " " << relDev << " -> check "
|
||||
<< ((relDev < checkTolerance) ? "passed" : "failed") << std::endl;
|
||||
assert(relDev <= checkTolerance);
|
||||
GRID_ASSERT(relDev <= checkTolerance);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -200,7 +200,7 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "norm2(Dhop), norm2(Meo + Moe), abs. deviation, rel. deviation: "
|
||||
<< norm2(ref) << " " << norm2(res) << " " << absDev << " " << relDev
|
||||
<< " -> check " << ((relDev < checkTolerance) ? "passed" : "failed") << std::endl;
|
||||
assert(relDev <= checkTolerance);
|
||||
GRID_ASSERT(relDev <= checkTolerance);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -222,7 +222,7 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "Re(v^dag M^dag M v), Im(v^dag M^dag M v), rel.deviation: "
|
||||
<< real(dot) << " " << imag(dot) << " " << relDev
|
||||
<< " -> check " << ((relDev < checkTolerance) ? "passed" : "failed") << std::endl;
|
||||
assert(relDev <= checkTolerance);
|
||||
GRID_ASSERT(relDev <= checkTolerance);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -242,7 +242,7 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "Re(v^dag Mooee^dag Mooee v), Im(v^dag Mooee^dag Mooee v), rel.deviation: "
|
||||
<< real(dot) << " " << imag(dot) << " " << relDev
|
||||
<< " -> check " << ((relDev < checkTolerance) ? "passed" : "failed") << std::endl;
|
||||
assert(relDev <= checkTolerance);
|
||||
GRID_ASSERT(relDev <= checkTolerance);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -262,7 +262,7 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "norm2(src), norm2(MooeeInv Mooee src), abs. deviation, rel. deviation: "
|
||||
<< norm2(src) << " " << norm2(phi) << " " << absDev << " " << relDev
|
||||
<< " -> check " << ((relDev < checkTolerance) ? "passed" : "failed") << std::endl;
|
||||
assert(relDev <= checkTolerance);
|
||||
GRID_ASSERT(relDev <= checkTolerance);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -343,7 +343,7 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "norm2(chi), norm2(MeeInv Mee chi), abs. deviation, rel. deviation: "
|
||||
<< norm2(chi) << " " << norm2(phi) << " " << absDev << " " << relDev
|
||||
<< " -> check " << ((relDev < checkTolerance) ? "passed" : "failed") << std::endl;
|
||||
assert(relDev <= checkTolerance);
|
||||
GRID_ASSERT(relDev <= checkTolerance);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -380,7 +380,7 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "norm2(chi), norm2(MeeDag MeeInvDag chi), abs. deviation, rel. deviation: "
|
||||
<< norm2(chi) << " " << norm2(phi) << " " << absDev << " " << relDev
|
||||
<< " -> check " << ((relDev < checkTolerance) ? "passed" : "failed") << std::endl;
|
||||
assert(relDev <= checkTolerance);
|
||||
GRID_ASSERT(relDev <= checkTolerance);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -429,7 +429,7 @@ int main(int argc, char** argv) {
|
||||
std::cout << GridLogMessage << "norm2(Dunprec), norm2(Deoprec), abs. deviation, rel. deviation: "
|
||||
<< norm2(ref) << " " << norm2(phi) << " " << absDev << " " << relDev
|
||||
<< " -> check " << ((relDev < checkTolerance) ? "passed" : "failed") << std::endl;
|
||||
assert(relDev <= checkTolerance);
|
||||
GRID_ASSERT(relDev <= checkTolerance);
|
||||
}
|
||||
|
||||
{
|
||||
|
@@ -95,7 +95,7 @@ int main(int argc, char** argv) {
|
||||
GridStopWatch CGTimer;
|
||||
|
||||
SchurDiagMooeeOperator<DomainWallFermionD, LatticeFermion> HermOpEO(Ddwf);
|
||||
ConjugateGradient<LatticeFermion> CG(1.0e-5, 10000, 0);// switch off the assert
|
||||
ConjugateGradient<LatticeFermion> CG(1.0e-5, 10000, 0);// switch off the GRID_ASSERT
|
||||
|
||||
CGTimer.Start();
|
||||
CG(HermOpEO, src_o, result_o);
|
||||
|
@@ -267,7 +267,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
Subspace Aggregates(Coarse5d,FGrid,0);
|
||||
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
{
|
||||
int nb=nbasis/2;
|
||||
Aggregates.CreateSubspaceChebyshev(RNG5,HermDefOp,nb,60.0,0.02,500,100,100,0.0);
|
||||
|
@@ -281,7 +281,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
Subspace Aggregates(Coarse5d,FGrid,0);
|
||||
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
{
|
||||
int nb=nbasis/2;
|
||||
LatticeFermion A(FGrid);
|
||||
|
@@ -263,7 +263,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
Subspace Aggregates(Coarse5d,FGrid,0);
|
||||
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
{
|
||||
int nb=nbasis/2;
|
||||
LatticeFermion A(FGrid);
|
||||
|
@@ -301,7 +301,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
Subspace Aggregates(Coarse5d,FGrid,0);
|
||||
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
{
|
||||
int nb=nbasis/2;
|
||||
// Aggregates.CreateSubspaceChebyshev(RNG5,HermDefOp,nb,60.0,0.05,500,200,100,0.0);// 18s
|
||||
|
@@ -277,7 +277,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
Subspace Aggregates(Coarse5d,FGrid,0);
|
||||
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
{
|
||||
int nb=nbasis/2;
|
||||
LatticeFermion A(FGrid);
|
||||
|
@@ -261,7 +261,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
Subspace Aggregates(Coarse5d,FGrid,0);
|
||||
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
{
|
||||
int nb=nbasis/2;
|
||||
LatticeFermion A(FGrid);
|
||||
|
@@ -85,13 +85,13 @@ public:
|
||||
PVdagMLinearOperator(Matrix &Mat,Matrix &PV): _Mat(Mat),_PV(PV){};
|
||||
|
||||
void OpDiag (const Field &in, Field &out) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
};
|
||||
void Op (const Field &in, Field &out){
|
||||
Field tmp(in.Grid());
|
||||
@@ -104,10 +104,10 @@ public:
|
||||
_Mat.Mdag(in,tmp);
|
||||
}
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void HermOp(const Field &in, Field &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -411,7 +411,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
Subspace Aggregates(Coarse5d,FGrid,0);
|
||||
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
{
|
||||
int nb=nbasis/2;
|
||||
Aggregates.CreateSubspaceChebyshev(RNG5,HermDefOp,nb,60.0,0.02,500,100,100,0.0);
|
||||
|
@@ -69,7 +69,7 @@ void run_test(int argc, char ** argv, const typename SpeciesD::ImplParams ¶m
|
||||
bool cfg_loaded=false;
|
||||
for(int i=1;i<argc;i++){
|
||||
if(std::string(argv[i]) == "--load_config"){
|
||||
assert(i != argc-1);
|
||||
GRID_ASSERT(i != argc-1);
|
||||
std::string file = argv[i+1];
|
||||
NerscIO io;
|
||||
FieldMetaData metadata;
|
||||
@@ -158,9 +158,9 @@ int main (int argc, char ** argv)
|
||||
for(int i=1;i<argc;i++){
|
||||
std::string arg(argv[i]);
|
||||
if(arg == "--Gparity"){
|
||||
assert(i!=argc-1);
|
||||
GRID_ASSERT(i!=argc-1);
|
||||
gpdir = std::stoi(argv[i+1]);
|
||||
assert(gpdir >= 0 && gpdir <= 2); //spatial!
|
||||
GRID_ASSERT(gpdir >= 0 && gpdir <= 2); //spatial!
|
||||
gparity = true;
|
||||
}
|
||||
}
|
||||
|
@@ -106,7 +106,7 @@ int main (int argc, char** argv)
|
||||
LatticeFermion diff = MinvMeta - eta;
|
||||
|
||||
std::cout << GridLogMessage << "eta: " << norm2(eta) << " M*eta: " << norm2(Meta) << " M^{-1}*M*eta: " << norm2(MinvMeta) << " M^{-1}*M*eta - eta: " << norm2(diff) << " (expect 0)" << std::endl;
|
||||
assert(norm2(diff) < 1e-8);
|
||||
GRID_ASSERT(norm2(diff) < 1e-8);
|
||||
|
||||
//Check right inverse
|
||||
LatticeFermion MinvEta(FGrid);
|
||||
@@ -118,7 +118,7 @@ int main (int argc, char** argv)
|
||||
diff = MMinvEta - eta;
|
||||
|
||||
std::cout << GridLogMessage << "eta: " << norm2(eta) << " M^{-1}*eta: " << norm2(MinvEta) << " M*M^{-1}*eta: " << norm2(MMinvEta) << " M*M^{-1}*eta - eta: " << norm2(diff) << " (expect 0)" << std::endl;
|
||||
assert(norm2(diff) < 1e-8);
|
||||
GRID_ASSERT(norm2(diff) < 1e-8);
|
||||
|
||||
std::cout << GridLogMessage << "Done" << std::endl;
|
||||
Grid_finalize();
|
||||
|
@@ -82,13 +82,13 @@ public:
|
||||
PVdagMLinearOperator(Matrix &Mat,Matrix &PV): _Mat(Mat),_PV(PV){};
|
||||
|
||||
void OpDiag (const Field &in, Field &out) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
};
|
||||
void Op (const Field &in, Field &out){
|
||||
Field tmp(in.Grid());
|
||||
@@ -101,10 +101,10 @@ public:
|
||||
_Mat.Mdag(in,tmp);
|
||||
}
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void HermOp(const Field &in, Field &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -309,7 +309,7 @@ int main (int argc, char ** argv)
|
||||
Subspace Aggregates4D(Coarse4d,UGrid,0);
|
||||
Subspace Aggregates5D(Coarse5d,FGrid,0);
|
||||
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
|
||||
std::cout<<GridLogMessage << " 4D subspace build " <<std::endl;
|
||||
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
|
||||
|
@@ -109,7 +109,7 @@ public:
|
||||
///////////////////////////////////////////////////////////
|
||||
// The Cayley coeffs (unprec)
|
||||
///////////////////////////////////////////////////////////
|
||||
assert(gamma.size()==Ls);
|
||||
GRID_ASSERT(gamma.size()==Ls);
|
||||
|
||||
omega.resize(Ls);
|
||||
bs.resize(Ls);
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
for(int i=0; i < Ls; i++){
|
||||
as[i] = 1.0;
|
||||
omega[i] = _gamma[i]*_zolo_hi; //NB reciprocal relative to Chroma NEF code
|
||||
assert(omega[i]!=Coeff_t(0.0));
|
||||
GRID_ASSERT(omega[i]!=Coeff_t(0.0));
|
||||
bs[i] = 0.5*(bpc/omega[i] + bmc);
|
||||
cs[i] = 0.5*(bpc/omega[i] - bmc);
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
|
||||
for(int i=0;i<Ls;i++){
|
||||
bee[i]=as[i]*(bs[i]*(4.0-this->M5) +1.0);
|
||||
assert(bee[i]!=Coeff_t(0.0));
|
||||
GRID_ASSERT(bee[i]!=Coeff_t(0.0));
|
||||
cee[i]=as[i]*(1.0-cs[i]*(4.0-this->M5));
|
||||
beo[i]=as[i]*bs[i];
|
||||
ceo[i]=-as[i]*cs[i];
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
|
||||
leem[i]=mass*cee[Ls-1]/bee[0];
|
||||
for(int j=0;j<i;j++) {
|
||||
assert(bee[j+1]!=Coeff_t(0.0));
|
||||
GRID_ASSERT(bee[j+1]!=Coeff_t(0.0));
|
||||
leem[i]*= aee[j]/bee[j+1];
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
autoView(psi , psi_i,AcceleratorRead);
|
||||
autoView(phi , phi_i,AcceleratorRead);
|
||||
autoView(chi , chi_i,AcceleratorWrite);
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
GRID_ASSERT(phi.Checkerboard() == psi.Checkerboard());
|
||||
|
||||
auto pdiag = &diag[0];
|
||||
auto pupper = &upper[0];
|
||||
@@ -354,7 +354,7 @@ public:
|
||||
autoView(psi , psi_i,AcceleratorRead);
|
||||
autoView(phi , phi_i,AcceleratorRead);
|
||||
autoView(chi , chi_i,AcceleratorWrite);
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
GRID_ASSERT(phi.Checkerboard() == psi.Checkerboard());
|
||||
|
||||
auto pdiag = &diag[0];
|
||||
auto pupper = &upper[0];
|
||||
@@ -438,7 +438,7 @@ public:
|
||||
}
|
||||
virtual void Mdir (const CoarseVector &in, CoarseVector &out,int dir, int disp)
|
||||
{
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
virtual void MdirAll (const CoarseVector &in, std::vector<CoarseVector> &out)
|
||||
{
|
||||
@@ -679,13 +679,13 @@ public:
|
||||
virtual std::vector<int> Displacements(void){ return _Mat.Displacements();};
|
||||
|
||||
void OpDiag (const Field &in, Field &out) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
};
|
||||
void Op (const Field &in, Field &out){
|
||||
Field tmp(in.Grid());
|
||||
@@ -698,10 +698,10 @@ public:
|
||||
_Mat.Mdag(in,tmp);
|
||||
}
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void HermOp(const Field &in, Field &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1024,7 +1024,7 @@ int main (int argc, char ** argv)
|
||||
std::cout<<GridLogMessage << " 4D subspace build " <<std::endl;
|
||||
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
|
||||
Subspace Aggregates4D(Coarse4d,UGrid,0);
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
int nb=nbasis/2;
|
||||
Gamma g5(Gamma::Algebra::Gamma5);
|
||||
|
||||
|
@@ -109,7 +109,7 @@ public:
|
||||
///////////////////////////////////////////////////////////
|
||||
// The Cayley coeffs (unprec)
|
||||
///////////////////////////////////////////////////////////
|
||||
assert(gamma.size()==Ls);
|
||||
GRID_ASSERT(gamma.size()==Ls);
|
||||
|
||||
omega.resize(Ls);
|
||||
bs.resize(Ls);
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
for(int i=0; i < Ls; i++){
|
||||
as[i] = 1.0;
|
||||
omega[i] = _gamma[i]*_zolo_hi; //NB reciprocal relative to Chroma NEF code
|
||||
assert(omega[i]!=Coeff_t(0.0));
|
||||
GRID_ASSERT(omega[i]!=Coeff_t(0.0));
|
||||
bs[i] = 0.5*(bpc/omega[i] + bmc);
|
||||
cs[i] = 0.5*(bpc/omega[i] - bmc);
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
|
||||
for(int i=0;i<Ls;i++){
|
||||
bee[i]=as[i]*(bs[i]*(4.0-this->M5) +1.0);
|
||||
assert(bee[i]!=Coeff_t(0.0));
|
||||
GRID_ASSERT(bee[i]!=Coeff_t(0.0));
|
||||
cee[i]=as[i]*(1.0-cs[i]*(4.0-this->M5));
|
||||
beo[i]=as[i]*bs[i];
|
||||
ceo[i]=-as[i]*cs[i];
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
|
||||
leem[i]=mass*cee[Ls-1]/bee[0];
|
||||
for(int j=0;j<i;j++) {
|
||||
assert(bee[j+1]!=Coeff_t(0.0));
|
||||
GRID_ASSERT(bee[j+1]!=Coeff_t(0.0));
|
||||
leem[i]*= aee[j]/bee[j+1];
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
autoView(psi , psi_i,AcceleratorRead);
|
||||
autoView(phi , phi_i,AcceleratorRead);
|
||||
autoView(chi , chi_i,AcceleratorWrite);
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
GRID_ASSERT(phi.Checkerboard() == psi.Checkerboard());
|
||||
|
||||
auto pdiag = &diag[0];
|
||||
auto pupper = &upper[0];
|
||||
@@ -354,7 +354,7 @@ public:
|
||||
autoView(psi , psi_i,AcceleratorRead);
|
||||
autoView(phi , phi_i,AcceleratorRead);
|
||||
autoView(chi , chi_i,AcceleratorWrite);
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
GRID_ASSERT(phi.Checkerboard() == psi.Checkerboard());
|
||||
|
||||
auto pdiag = &diag[0];
|
||||
auto pupper = &upper[0];
|
||||
@@ -438,7 +438,7 @@ public:
|
||||
}
|
||||
virtual void Mdir (const CoarseVector &in, CoarseVector &out,int dir, int disp)
|
||||
{
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
virtual void MdirAll (const CoarseVector &in, std::vector<CoarseVector> &out)
|
||||
{
|
||||
@@ -699,13 +699,13 @@ public:
|
||||
virtual std::vector<int> Displacements(void){ return _Mat.Displacements();};
|
||||
|
||||
void OpDiag (const Field &in, Field &out) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void OpDirAll (const Field &in, std::vector<Field> &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
};
|
||||
void Op (const Field &in, Field &out){
|
||||
Field tmp(in.Grid());
|
||||
@@ -718,10 +718,10 @@ public:
|
||||
_Mat.Mdag(in,tmp);
|
||||
}
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
void HermOp(const Field &in, Field &out){
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1048,7 +1048,7 @@ int main (int argc, char ** argv)
|
||||
std::cout<<GridLogMessage << " 4D subspace build " <<std::endl;
|
||||
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
|
||||
Subspace Aggregates4D(Coarse4d,UGrid,0);
|
||||
assert ( (nbasis & 0x1)==0);
|
||||
GRID_ASSERT ( (nbasis & 0x1)==0);
|
||||
int nb=nbasis/2;
|
||||
Gamma g5(Gamma::Algebra::Gamma5);
|
||||
|
||||
|
@@ -86,13 +86,13 @@ void checkParameterValidity(MultiGridParams const ¶ms) {
|
||||
|
||||
auto correctSize = params.nLevels - 1;
|
||||
|
||||
assert(correctSize == params.blockSizes.size());
|
||||
assert(correctSize == params.smootherTol.size());
|
||||
assert(correctSize == params.smootherMaxOuterIter.size());
|
||||
assert(correctSize == params.smootherMaxInnerIter.size());
|
||||
assert(correctSize == params.kCycleTol.size());
|
||||
assert(correctSize == params.kCycleMaxOuterIter.size());
|
||||
assert(correctSize == params.kCycleMaxInnerIter.size());
|
||||
GRID_ASSERT(correctSize == params.blockSizes.size());
|
||||
GRID_ASSERT(correctSize == params.smootherTol.size());
|
||||
GRID_ASSERT(correctSize == params.smootherMaxOuterIter.size());
|
||||
GRID_ASSERT(correctSize == params.smootherMaxInnerIter.size());
|
||||
GRID_ASSERT(correctSize == params.kCycleTol.size());
|
||||
GRID_ASSERT(correctSize == params.kCycleMaxOuterIter.size());
|
||||
GRID_ASSERT(correctSize == params.kCycleMaxInnerIter.size());
|
||||
}
|
||||
|
||||
struct LevelInfo {
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
auto nCoarseLevels = mgParams.blockSizes.size();
|
||||
|
||||
assert(nCoarseLevels == mgParams.nLevels - 1);
|
||||
GRID_ASSERT(nCoarseLevels == mgParams.nLevels - 1);
|
||||
|
||||
// set up values for finest grid
|
||||
Grids.push_back(FineGrid);
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
for(int level = 1; level < mgParams.nLevels; ++level) {
|
||||
auto Nd = Grids[level - 1]->_ndimension;
|
||||
auto tmp = Grids[level - 1]->_fdimensions;
|
||||
assert(tmp.size() == Nd);
|
||||
GRID_ASSERT(tmp.size() == Nd);
|
||||
|
||||
Seeds.push_back(std::vector<int>(Nd));
|
||||
|
||||
|
@@ -56,7 +56,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
if(GridCmdOptionExists(argv, argv + argc, "--inputxml")) {
|
||||
inputXml = GridCmdOptionPayload(argv, argv + argc, "--inputxml");
|
||||
assert(inputXml.length() != 0);
|
||||
GRID_ASSERT(inputXml.length() != 0);
|
||||
}
|
||||
|
||||
{
|
||||
|
@@ -63,7 +63,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
if(GridCmdOptionExists(argv, argv + argc, "--inputxml")) {
|
||||
inputXml = GridCmdOptionPayload(argv, argv + argc, "--inputxml");
|
||||
assert(inputXml.length() != 0);
|
||||
GRID_ASSERT(inputXml.length() != 0);
|
||||
}
|
||||
|
||||
{
|
||||
|
@@ -59,7 +59,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
if(GridCmdOptionExists(argv, argv + argc, "--inputxml")) {
|
||||
inputXml = GridCmdOptionPayload(argv, argv + argc, "--inputxml");
|
||||
assert(inputXml.length() != 0);
|
||||
GRID_ASSERT(inputXml.length() != 0);
|
||||
}
|
||||
|
||||
{
|
||||
|
@@ -89,7 +89,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
if(GridCmdOptionExists(argv, argv + argc, "--inputxml")) {
|
||||
inputXml = GridCmdOptionPayload(argv, argv + argc, "--inputxml");
|
||||
assert(inputXml.length() != 0);
|
||||
GRID_ASSERT(inputXml.length() != 0);
|
||||
}
|
||||
|
||||
{
|
||||
|
@@ -65,7 +65,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
if(GridCmdOptionExists(argv, argv + argc, "--inputxml")) {
|
||||
inputXml = GridCmdOptionPayload(argv, argv + argc, "--inputxml");
|
||||
assert(inputXml.length() != 0);
|
||||
GRID_ASSERT(inputXml.length() != 0);
|
||||
}
|
||||
|
||||
{
|
||||
|
@@ -176,7 +176,7 @@ void run(const TestParams ¶ms){
|
||||
NerscIO::readConfiguration(Umu, header, params.config_file);
|
||||
|
||||
for(int i=0;i<Nd;i++){
|
||||
assert(header.dimension[i] == GridDefaultLatt()[i]);
|
||||
GRID_ASSERT(header.dimension[i] == GridDefaultLatt()[i]);
|
||||
}
|
||||
}else{
|
||||
SU<Nc>::HotConfiguration(RNG4, Umu);
|
||||
@@ -297,7 +297,7 @@ int main(int argc, char** argv) {
|
||||
run<RunParamsPrecStd, RunParamsPrecDiagTwo>(params);
|
||||
}else if(params.outer_precon == "DiagTwo" && params.inner_precon == "DiagTwo"){
|
||||
run<RunParamsPrecDiagTwo, RunParamsPrecDiagTwo>(params);
|
||||
}else assert(0);
|
||||
}else GRID_ASSERT(0);
|
||||
|
||||
Grid_finalize();
|
||||
}
|
||||
|
@@ -111,7 +111,7 @@ int main(int argc, char** argv) {
|
||||
GridStopWatch CGTimer;
|
||||
|
||||
SchurDiagMooeeOperator<ZMobiusFermionD, LatticeFermion> HermOpEO(Ddwf);
|
||||
ConjugateGradient<LatticeFermion> CG(1.0e-8, 10000, 0);// switch off the assert
|
||||
ConjugateGradient<LatticeFermion> CG(1.0e-8, 10000, 0);// switch off the GRID_ASSERT
|
||||
|
||||
CGTimer.Start();
|
||||
CG(HermOpEO, src_o, result_o);
|
||||
|
@@ -16,7 +16,7 @@ static void check_dimensions() {
|
||||
std::cout << GridLogMessage << "Nc = " << this_n << " algebra dimension is " << this_algebra_dim << std::endl;
|
||||
realA = Sp_TwoIndex<this_nc, AntiSymmetric>::Dimension + Sp_TwoIndex<this_nc, Symmetric>::Dimension;
|
||||
std::cout << GridLogMessage << "Checking dim(2AS) + dim(AS) + 1 = Nc * Nc " << this_algebra_dim << std::endl;
|
||||
assert ( realA == this_nc * this_nc - 1); // Nc x Nc = dim(2indxS) + dim(2indxAS) + dim(singlet)
|
||||
GRID_ASSERT ( realA == this_nc * this_nc - 1); // Nc x Nc = dim(2indxS) + dim(2indxAS) + dim(singlet)
|
||||
}
|
||||
|
||||
template<int this_nc, TwoIndexSymmetry S>
|
||||
@@ -35,7 +35,7 @@ static void run_symmetry_checks() {
|
||||
Sp_TwoIndex<this_nc, S>::base(a, eij_c);
|
||||
e_sum = eij_c - realS * transpose(eij_c);
|
||||
std::cout << GridLogMessage << "e_ab - (" << S << " * e_ab^T ) = " << norm2(e_sum) << std::endl;
|
||||
assert(norm2(e_sum) < 1e-8);
|
||||
GRID_ASSERT(norm2(e_sum) < 1e-8);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ static void run_traces_checks() {
|
||||
realA = norm2(trace(Omega*eij_a));
|
||||
std::cout << GridLogMessage << "Checkig Omega-trace for e_{ab=" << a << "} " << std::endl;
|
||||
//std::cout << GridLogMessage << "Tr ( Omega e_{ab=" << a << "} ) = " << realA << std::endl;
|
||||
assert(realA < 1e-8);
|
||||
GRID_ASSERT(realA < 1e-8);
|
||||
for (int b=0; b < Sp_TwoIndex<this_nc, S>::Dimension; b++) {
|
||||
Sp_TwoIndex<this_nc, S>::base(b, eij_b);
|
||||
auto d_ab = TensorRemove(trace(eij_a * eij_b));
|
||||
@@ -68,12 +68,12 @@ static void run_traces_checks() {
|
||||
#endif
|
||||
std::cout << GridLogMessage << "Checking orthonormality for e_{ab = " << a << "} " << std::endl;
|
||||
if (a==b) {
|
||||
assert(real(d_ab) - realS < 1e-8);
|
||||
GRID_ASSERT(real(d_ab) - realS < 1e-8);
|
||||
} else {
|
||||
assert(real(d_ab) < 1e-8);
|
||||
GRID_ASSERT(real(d_ab) < 1e-8);
|
||||
}
|
||||
assert(imag(d_ab) < 1e-8);
|
||||
assert(imag(d_ab) < 1e-8);
|
||||
GRID_ASSERT(imag(d_ab) < 1e-8);
|
||||
GRID_ASSERT(imag(d_ab) < 1e-8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,8 +118,8 @@ static void run_generators_checks() {
|
||||
sum_im += imag(TensorRemove(trace(tmp_l+tmp_r)));
|
||||
}
|
||||
std::cout << GridLogMessage << "re-evaluated trace of the generator " << gen_id << " is " << sum << " " << sum_im << std::endl;
|
||||
assert ( sum < 1e-8) ;
|
||||
assert ( sum_im < 1e-8) ;
|
||||
GRID_ASSERT ( sum < 1e-8) ;
|
||||
GRID_ASSERT ( sum_im < 1e-8) ;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -19,9 +19,9 @@ bool has_correct_group_block_structure(const T& U) {
|
||||
auto Ww = conjugate(Wstar);
|
||||
auto amizero = sum(W - Ww);
|
||||
auto amizeroo = TensorRemove(amizero);
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
amizeroo *= i;
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ bool has_correct_group_block_structure(const T& U) {
|
||||
auto minusXx = conjugate(minusXstar);
|
||||
auto amizero = sum(X + minusXx);
|
||||
auto amizeroo = TensorRemove(amizero);
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
amizeroo *= i;
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -49,22 +49,22 @@ bool is_element_of_sp2n_group(const T& U) {
|
||||
Sp<Nc>::Omega(Omega);
|
||||
|
||||
std::cout << GridLogMessage << "Check matrix is non-zero " << std::endl;
|
||||
assert(norm2(U) > 1e-8);
|
||||
GRID_ASSERT(norm2(U) > 1e-8);
|
||||
|
||||
std::cout << GridLogMessage << "Unitary check" << std::endl;
|
||||
aux = U * adj(U) - identity;
|
||||
std::cout << GridLogMessage << "U adjU - 1 = " << norm2(aux) << std::endl;
|
||||
assert(norm2(aux) < 1e-8);
|
||||
GRID_ASSERT(norm2(aux) < 1e-8);
|
||||
|
||||
aux = Omega - (U * Omega * transpose(U));
|
||||
std::cout << GridLogMessage << "Omega - U Omega transpose(U) = " << norm2(aux)
|
||||
<< std::endl;
|
||||
assert(norm2(aux) < 1e-8);
|
||||
GRID_ASSERT(norm2(aux) < 1e-8);
|
||||
|
||||
std::cout << GridLogMessage
|
||||
<< "|Det| = " << norm2(Determinant(U)) / U.Grid()->gSites()
|
||||
<< std::endl;
|
||||
assert(norm2(Determinant(U)) / U.Grid()->gSites() - 1 < 1e-8);
|
||||
GRID_ASSERT(norm2(Determinant(U)) / U.Grid()->gSites() - 1 < 1e-8);
|
||||
|
||||
return has_correct_group_block_structure(U);
|
||||
}
|
||||
@@ -91,17 +91,17 @@ int main (int argc, char **argv)
|
||||
std::cout << GridLogMessage << "Checking Cold Configuration " << std::endl;
|
||||
Sp<Nc>::ColdConfiguration(pRNG,Umu);
|
||||
U = PeekIndex<LorentzIndex>(Umu,1);
|
||||
assert(is_element_of_sp2n_group(U));
|
||||
GRID_ASSERT(is_element_of_sp2n_group(U));
|
||||
|
||||
std::cout << GridLogMessage << "Checking Hot Configuration" << std::endl;
|
||||
Sp<Nc>::HotConfiguration(pRNG,Umu);
|
||||
U = PeekIndex<LorentzIndex>(Umu,1);
|
||||
assert(is_element_of_sp2n_group(U));
|
||||
GRID_ASSERT(is_element_of_sp2n_group(U));
|
||||
|
||||
std::cout << GridLogMessage << "Checking Tepid Configuration" << std::endl;
|
||||
Sp<Nc>::TepidConfiguration(pRNG,Umu);
|
||||
U = PeekIndex<LorentzIndex>(Umu,1);
|
||||
assert(is_element_of_sp2n_group(U));
|
||||
GRID_ASSERT(is_element_of_sp2n_group(U));
|
||||
|
||||
Grid_finalize();
|
||||
|
||||
|
@@ -19,9 +19,9 @@ bool has_correct_group_block_structure(const T& U) {
|
||||
auto Ww = conjugate(Wstar);
|
||||
auto amizero = sum(W - Ww);
|
||||
auto amizeroo = TensorRemove(amizero);
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
amizeroo *= i;
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ bool has_correct_group_block_structure(const T& U) {
|
||||
auto minusXx = conjugate(minusXstar);
|
||||
auto amizero = sum(X + minusXx);
|
||||
auto amizeroo = TensorRemove(amizero);
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
amizeroo *= i;
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -49,22 +49,22 @@ bool is_element_of_sp2n_group(const T& U) {
|
||||
Sp<Nc>::Omega(Omega);
|
||||
|
||||
std::cout << GridLogMessage << "Check matrix is non-zero " << std::endl;
|
||||
assert(norm2(U) > 1e-8);
|
||||
GRID_ASSERT(norm2(U) > 1e-8);
|
||||
|
||||
std::cout << GridLogMessage << "Unitary check" << std::endl;
|
||||
aux = U * adj(U) - identity;
|
||||
std::cout << GridLogMessage << "U adjU - 1 = " << norm2(aux) << std::endl;
|
||||
assert(norm2(aux) < 1e-8);
|
||||
GRID_ASSERT(norm2(aux) < 1e-8);
|
||||
|
||||
aux = Omega - (U * Omega * transpose(U));
|
||||
std::cout << GridLogMessage << "Omega - U Omega transpose(U) = " << norm2(aux)
|
||||
<< std::endl;
|
||||
assert(norm2(aux) < 1e-8);
|
||||
GRID_ASSERT(norm2(aux) < 1e-8);
|
||||
|
||||
std::cout << GridLogMessage
|
||||
<< "|Det| = " << norm2(Determinant(U)) / U.Grid()->gSites()
|
||||
<< std::endl;
|
||||
assert(norm2(Determinant(U)) / U.Grid()->gSites() - 1 < 1e-8);
|
||||
GRID_ASSERT(norm2(Determinant(U)) / U.Grid()->gSites() - 1 < 1e-8);
|
||||
|
||||
return has_correct_group_block_structure(U);
|
||||
}
|
||||
@@ -86,7 +86,7 @@ void test_group_projections(T U) {
|
||||
|
||||
U = U + Delta * identity;
|
||||
U = ProjectOnSpGroup(U);
|
||||
assert(is_element_of_sp2n_group(U));
|
||||
GRID_ASSERT(is_element_of_sp2n_group(U));
|
||||
|
||||
name = "ProjectOnGeneralGroup";
|
||||
std::cout << GridLogMessage << "Testing " << name << std::endl;
|
||||
@@ -94,7 +94,7 @@ void test_group_projections(T U) {
|
||||
|
||||
U = U + Delta * identity;
|
||||
U = Sp<Nc>::ProjectOnGeneralGroup(U);
|
||||
assert(is_element_of_sp2n_group(U));
|
||||
GRID_ASSERT(is_element_of_sp2n_group(U));
|
||||
|
||||
name = "ProjectOnSpecialGroup";
|
||||
std::cout << GridLogMessage << "Testing " << name << std::endl;
|
||||
@@ -102,7 +102,7 @@ void test_group_projections(T U) {
|
||||
|
||||
U = U + Delta * identity;
|
||||
Sp<Nc>::ProjectOnSpecialGroup(U);
|
||||
assert(is_element_of_sp2n_group(U));
|
||||
GRID_ASSERT(is_element_of_sp2n_group(U));
|
||||
|
||||
name = "ProjectSpn";
|
||||
std::cout << GridLogMessage << "Testing " << name << std::endl;
|
||||
@@ -110,7 +110,7 @@ void test_group_projections(T U) {
|
||||
|
||||
U = U + Delta * identity;
|
||||
ProjectSpn(U);
|
||||
assert(is_element_of_sp2n_group(U));
|
||||
GRID_ASSERT(is_element_of_sp2n_group(U));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@@ -129,9 +129,9 @@ bool has_correct_algebra_block_structure(const T& U) {
|
||||
auto Ww = conjugate(Wstar);
|
||||
auto amizero = sum(W - Ww);
|
||||
auto amizeroo = TensorRemove(amizero);
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
amizeroo *= i;
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
}
|
||||
}
|
||||
for (int c1 = 0; c1 < nsp; c1++) {
|
||||
@@ -141,9 +141,9 @@ bool has_correct_algebra_block_structure(const T& U) {
|
||||
auto minusXx = conjugate(minusXstar);
|
||||
auto amizero = sum(X + minusXx);
|
||||
auto amizeroo = TensorRemove(amizero);
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
amizeroo *= i;
|
||||
assert(amizeroo.real() < 10e-6);
|
||||
GRID_ASSERT(amizeroo.real() < 10e-6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ bool is_element_of_sp2n_algebra(const T& U) {
|
||||
Sp<Nc>::Omega(Omega);
|
||||
|
||||
std::cout << GridLogMessage << "Check matrix is non-zero " << std::endl;
|
||||
assert(norm2(U) > 1e-8);
|
||||
GRID_ASSERT(norm2(U) > 1e-8);
|
||||
|
||||
aux = U - adj(U);
|
||||
std::cout << GridLogMessage << "T - Tda = " << norm2(aux)
|
||||
@@ -168,12 +168,12 @@ bool is_element_of_sp2n_algebra(const T& U) {
|
||||
aux = U + adj(U);
|
||||
std::cout << GridLogMessage << "T + Tda = " << norm2(aux)
|
||||
<< " (supposed to vanish)" << std::endl;
|
||||
assert(norm2(aux) - 1 < 1e-8);
|
||||
GRID_ASSERT(norm2(aux) - 1 < 1e-8);
|
||||
|
||||
std::cout << GridLogMessage << "Check that Omega T Omega + conj(T) = 0 "
|
||||
<< std::endl;
|
||||
aux = Omega * U * Omega + conjugate(U);
|
||||
assert(norm2(aux) < 1e-8);
|
||||
GRID_ASSERT(norm2(aux) < 1e-8);
|
||||
|
||||
return has_correct_algebra_block_structure(U);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void test_algebra_projections(T U) {
|
||||
|
||||
U = U + Delta * identity;
|
||||
U = SpTa(U);
|
||||
assert(is_element_of_sp2n_algebra(U));
|
||||
GRID_ASSERT(is_element_of_sp2n_algebra(U));
|
||||
|
||||
name = "TaProj";
|
||||
std::cout << GridLogMessage << "Testing " << name << std::endl;
|
||||
@@ -205,7 +205,7 @@ void test_algebra_projections(T U) {
|
||||
U = U + Delta * identity;
|
||||
Sp<Nc>::taProj(U, tmp);
|
||||
U = tmp;
|
||||
assert(is_element_of_sp2n_algebra(U));
|
||||
GRID_ASSERT(is_element_of_sp2n_algebra(U));
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
Reference in New Issue
Block a user