From 1cc0d7b8119aaec58ffee55a910ce572e0a51c7b Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 7 Nov 2015 00:04:40 -0800 Subject: [PATCH 01/27] Bigger ncall as timing loops got small on cori --- benchmarks/Benchmark_dwf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/Benchmark_dwf.cc b/benchmarks/Benchmark_dwf.cc index f94a3e38..f86fd072 100644 --- a/benchmarks/Benchmark_dwf.cc +++ b/benchmarks/Benchmark_dwf.cc @@ -82,7 +82,7 @@ int main (int argc, char ** argv) DomainWallFermionR Dw(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); std::cout< Date: Sat, 7 Nov 2015 00:05:10 -0800 Subject: [PATCH 02/27] Stencil interface change fix no compile --- tests/Test_stencil.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Test_stencil.cc b/tests/Test_stencil.cc index 5949fa63..ccbac7d2 100644 --- a/tests/Test_stencil.cc +++ b/tests/Test_stencil.cc @@ -61,7 +61,7 @@ int main (int argc, char ** argv) std::vector directions(npoint,dir); std::vector displacements(npoint,disp); - CartesianStencil myStencil(&Fine,npoint,0,directions,displacements); + CartesianStencil > myStencil(&Fine,npoint,0,directions,displacements); std::vector ocoor(4); for(int o=0;o directions(npoint,dir); std::vector displacements(npoint,disp); - CartesianStencil EStencil(&rbFine,npoint,Even,directions,displacements); - CartesianStencil OStencil(&rbFine,npoint,Odd,directions,displacements); + CartesianStencil > EStencil(&rbFine,npoint,Even,directions,displacements); + CartesianStencil > OStencil(&rbFine,npoint,Odd,directions,displacements); std::vector ocoor(4); for(int o=0;o Date: Sat, 7 Nov 2015 00:05:57 -0800 Subject: [PATCH 03/27] EXECINFO change --- lib/Config.h.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Config.h.in b/lib/Config.h.in index ecbacf3a..2cc9106a 100644 --- a/lib/Config.h.in +++ b/lib/Config.h.in @@ -47,6 +47,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ENDIAN_H +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + /* Support FMA3 (Fused Multiply-Add) instructions */ #undef HAVE_FMA @@ -134,9 +137,6 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME -/* Define to the home page for this package. */ -#undef PACKAGE_URL - /* Define to the version of this package. */ #undef PACKAGE_VERSION From 05a70296002260c7151aade92427d5d987e38d04 Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 7 Nov 2015 00:06:31 -0800 Subject: [PATCH 04/27] Stencil change --- lib/qcd/action/fermion/WilsonKernels.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/qcd/action/fermion/WilsonKernels.h b/lib/qcd/action/fermion/WilsonKernels.h index a4b63085..988bc6f8 100644 --- a/lib/qcd/action/fermion/WilsonKernels.h +++ b/lib/qcd/action/fermion/WilsonKernels.h @@ -29,11 +29,11 @@ namespace Grid { std::vector > &buf, int sF,int sU,const FermionField &in, FermionField &out,int dirdisp,int gamma); #if defined(AVX512) || defined(IMCI) - void DiracOptAsmDhopSite(CartesianStencil &st,DoubledGaugeField &U, + void DiracOptAsmDhopSite(StencilImpl &st,DoubledGaugeField &U, std::vector > &buf, int sF,int sU,const FermionField &in, FermionField &out,uint64_t *); #else - void DiracOptAsmDhopSite(CartesianStencil &st,DoubledGaugeField &U, + void DiracOptAsmDhopSite(StencilImpl &st,DoubledGaugeField &U, std::vector > &buf, int sF,int sU,const FermionField &in, FermionField &out,uint64_t *p){ DiracOptDhopSite(st,U,buf,sF,sU,in,out); // will template override for Wilson Nc=3 From e9ff25b06b47a109dabe585a0062311aba96271e Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 7 Nov 2015 00:07:05 -0800 Subject: [PATCH 05/27] Small threading change makes a difference on Cori. --- lib/qcd/action/fermion/WilsonFermion5D.cc | 29 ++++++++--------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/lib/qcd/action/fermion/WilsonFermion5D.cc b/lib/qcd/action/fermion/WilsonFermion5D.cc index 9b336374..dc6913ce 100644 --- a/lib/qcd/action/fermion/WilsonFermion5D.cc +++ b/lib/qcd/action/fermion/WilsonFermion5D.cc @@ -324,45 +324,36 @@ PARALLEL_FOR_LOOP // } } else if( this->HandOptDslash ) { -#pragma omp parallel for +#pragma omp parallel for schedule(static) for(int t=0;toSites();ss++){ + int sU=ss; for(int s=0;soSites();ss++){ From f8290bfd583591e34059f257f5c4d2e027ca0d05 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 29 Nov 2015 00:24:04 +0000 Subject: [PATCH 06/27] Compile fixes --- lib/Config.h.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Config.h.in b/lib/Config.h.in index ecbacf3a..4704273d 100644 --- a/lib/Config.h.in +++ b/lib/Config.h.in @@ -47,6 +47,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ENDIAN_H +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + /* Support FMA3 (Fused Multiply-Add) instructions */ #undef HAVE_FMA From 825875fd486cf0666a8e74ef00b33fa44e95a877 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 29 Nov 2015 00:24:25 +0000 Subject: [PATCH 07/27] compile fixes --- lib/Init.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Init.cc b/lib/Init.cc index e427fe18..ab3b5571 100644 --- a/lib/Init.cc +++ b/lib/Init.cc @@ -17,7 +17,6 @@ #define __X86_64 - #ifdef HAVE_EXECINFO_H #include #endif From 54f04ee5c9187d6ebb00a6da01d6231d2af88676 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 29 Nov 2015 00:24:48 +0000 Subject: [PATCH 08/27] Perf event interface was linux specfic and use ifdef to protect --- lib/PerfCount.h | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/lib/PerfCount.h b/lib/PerfCount.h index 264d571e..c379639d 100644 --- a/lib/PerfCount.h +++ b/lib/PerfCount.h @@ -5,22 +5,27 @@ #include #include #include + #include + +#ifdef __linux__ #include #include - +#endif namespace Grid { +#ifdef __linux__ static long perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu, int group_fd, unsigned long flags) { - int ret; + int ret=0; ret = syscall(__NR_perf_event_open, hw_event, pid, cpu, group_fd, flags); return ret; } +#endif class PerformanceCounter { @@ -63,7 +68,6 @@ public: int PCT; - struct perf_event_attr pe; long long count; int fd; uint64_t elapsed; @@ -74,15 +78,19 @@ public: } PerformanceCounter(int _pct) { +#ifdef __linux__ assert(_pct>=0); assert(_pct Date: Sun, 29 Nov 2015 00:29:58 +0000 Subject: [PATCH 09/27] No compile fix --- lib/qcd/action/fermion/WilsonKernels.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/qcd/action/fermion/WilsonKernels.h b/lib/qcd/action/fermion/WilsonKernels.h index a4b63085..988bc6f8 100644 --- a/lib/qcd/action/fermion/WilsonKernels.h +++ b/lib/qcd/action/fermion/WilsonKernels.h @@ -29,11 +29,11 @@ namespace Grid { std::vector > &buf, int sF,int sU,const FermionField &in, FermionField &out,int dirdisp,int gamma); #if defined(AVX512) || defined(IMCI) - void DiracOptAsmDhopSite(CartesianStencil &st,DoubledGaugeField &U, + void DiracOptAsmDhopSite(StencilImpl &st,DoubledGaugeField &U, std::vector > &buf, int sF,int sU,const FermionField &in, FermionField &out,uint64_t *); #else - void DiracOptAsmDhopSite(CartesianStencil &st,DoubledGaugeField &U, + void DiracOptAsmDhopSite(StencilImpl &st,DoubledGaugeField &U, std::vector > &buf, int sF,int sU,const FermionField &in, FermionField &out,uint64_t *p){ DiracOptDhopSite(st,U,buf,sF,sU,in,out); // will template override for Wilson Nc=3 From 41e8038c56d8817aa2b5addee70629c824200998 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 29 Nov 2015 00:30:19 +0000 Subject: [PATCH 10/27] Makefile update --- tests/Make.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Make.inc b/tests/Make.inc index c6c163a0..288f650d 100644 --- a/tests/Make.inc +++ b/tests/Make.inc @@ -1,5 +1,5 @@ -bin_PROGRAMS = Test_GaugeAction Test_cayley_cg Test_cayley_coarsen_support Test_cayley_even_odd Test_cayley_ldop_cr Test_cf_coarsen_support Test_cf_cr_unprec Test_cheby Test_contfrac_cg Test_contfrac_even_odd Test_contfrac_force Test_cshift Test_cshift_red_black Test_dwf_cg_prec Test_dwf_cg_schur Test_dwf_cg_unprec Test_dwf_cr_unprec Test_dwf_even_odd Test_dwf_force Test_dwf_fpgcr Test_dwf_hdcr Test_gamma Test_hmc_EODWFRatio Test_hmc_EOWilsonFermionGauge Test_hmc_EOWilsonRatio Test_hmc_WilsonFermionGauge Test_hmc_WilsonGauge Test_hmc_WilsonRatio Test_lie_generators Test_main Test_multishift_sqrt Test_nersc_io Test_partfrac_force Test_quenched_update Test_remez Test_rhmc_EOWilson1p1 Test_rhmc_EOWilsonRatio Test_rhmc_Wilson1p1 Test_rhmc_WilsonRatio Test_rng Test_rng_fixed Test_serialisation Test_simd Test_stencil Test_wilson_cg_prec Test_wilson_cg_schur Test_wilson_cg_unprec Test_wilson_cr_unprec Test_wilson_even_odd Test_wilson_force Test_wilson_force_phiMdagMphi Test_wilson_force_phiMphi +bin_PROGRAMS = Test_GaugeAction Test_cayley_cg Test_cayley_coarsen_support Test_cayley_even_odd Test_cayley_ldop_cr Test_cf_coarsen_support Test_cf_cr_unprec Test_cheby Test_contfrac_cg Test_contfrac_even_odd Test_contfrac_force Test_cshift Test_cshift_red_black Test_dwf_cg_prec Test_dwf_cg_schur Test_dwf_cg_unprec Test_dwf_cr_unprec Test_dwf_even_odd Test_dwf_force Test_dwf_fpgcr Test_dwf_hdcr Test_gamma Test_hmc_EODWFRatio Test_hmc_EOWilsonFermionGauge Test_hmc_EOWilsonRatio Test_hmc_WilsonFermionGauge Test_hmc_WilsonGauge Test_hmc_WilsonRatio Test_lie_generators Test_main Test_multishift_sqrt Test_nersc_io Test_partfrac_force Test_quenched_update Test_remez Test_rhmc_EOWilson1p1 Test_rhmc_EOWilsonRatio Test_rhmc_Wilson1p1 Test_rhmc_WilsonRatio Test_rng Test_rng_fixed Test_serialisation Test_simd Test_stencil Test_wilson_cg_prec Test_wilson_cg_schur Test_wilson_cg_unprec Test_wilson_cr_unprec Test_wilson_even_odd Test_wilson_force Test_wilson_force_phiMdagMphi Test_wilson_force_phiMphi Test_synthetic_lanczos Test_GaugeAction_SOURCES=Test_GaugeAction.cc From ef84d5403300092ad2ed0ee5c5bd966123ef6301 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 29 Nov 2015 00:30:44 +0000 Subject: [PATCH 11/27] precision set --- scripts/configure-commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/configure-commands b/scripts/configure-commands index 07506d27..a3599d1f 100755 --- a/scripts/configure-commands +++ b/scripts/configure-commands @@ -59,7 +59,7 @@ clang-avx2) CXX=clang++ ../../configure --enable-simd=AVX2 CXXFLAGS="-mavx2 -mfma -O3 -std=c++11" LIBS="-lgmp -lmpfr" --enable-comms=none ;; clang-avx-openmp) -CXX=clang-omp++ ../../configure --enable-simd=AVX CXXFLAGS="-mavx -fopenmp -O3 -std=c++11" LDFLAGS="-fopenmp" LIBS="-lgmp -lmpfr" --enable-comms=none +CXX=clang-omp++ ../../configure --enable-precision=double --enable-simd=AVX CXXFLAGS="-mavx -fopenmp -O3 -std=c++11" LDFLAGS="-fopenmp" LIBS="-lgmp -lmpfr" --enable-comms=none ;; clang-xc30) CXX=$HOME/Clang/install/bin/clang++ ../../configure --enable-simd=AVX CXXFLAGS="-mavx -O3 -std=c++11 -I/opt/gcc/4.9.2/snos/include/g++/x86_64-suse-linux/ -I/opt/gcc/4.9.2/snos/include/g++/ " LDFLAGS="" LIBS="-lgmp -lmpfr" --enable-comms=none From 01231ce82467fb9a23a816c643e5318aadec56dd Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 29 Nov 2015 00:31:02 +0000 Subject: [PATCH 12/27] Stencil fix --- tests/Test_stencil.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/Test_stencil.cc b/tests/Test_stencil.cc index 5949fa63..26e52a41 100644 --- a/tests/Test_stencil.cc +++ b/tests/Test_stencil.cc @@ -52,6 +52,7 @@ int main (int argc, char ** argv) } */ + typedef CartesianStencil > Stencil; for(int dir=0;dir<4;dir++){ for(int disp=0;disp directions(npoint,dir); std::vector displacements(npoint,disp); - CartesianStencil myStencil(&Fine,npoint,0,directions,displacements); + Stencil myStencil(&Fine,npoint,0,directions,displacements); std::vector ocoor(4); for(int o=0;o directions(npoint,dir); std::vector displacements(npoint,disp); - CartesianStencil EStencil(&rbFine,npoint,Even,directions,displacements); - CartesianStencil OStencil(&rbFine,npoint,Odd,directions,displacements); + Stencil EStencil(&rbFine,npoint,Even,directions,displacements); + Stencil OStencil(&rbFine,npoint,Odd,directions,displacements); std::vector ocoor(4); for(int o=0;o Date: Sun, 29 Nov 2015 00:31:19 +0000 Subject: [PATCH 13/27] Try 1/x for hermitian indef approx --- tests/Test_cheby.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/Test_cheby.cc b/tests/Test_cheby.cc index 08897c90..81b08816 100644 --- a/tests/Test_cheby.cc +++ b/tests/Test_cheby.cc @@ -57,5 +57,21 @@ int main (int argc, char ** argv) ChebyStep.csv(of); } + lo=-8; + hi=8; + Chebyshev ChebyIndefInv(lo,hi,40,InverseApproximation); + { + std::ofstream of("chebyindefinv"); + ChebyIndefInv.csv(of); + } + + lo=0; + hi=64; + Chebyshev ChebyNE(lo,hi,40,InverseApproximation); + { + std::ofstream of("chebyNE"); + ChebyNE.csv(of); + } + Grid_finalize(); } From fff0f00552c97beb6dd53827f2524cf3158d1777 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 29 Nov 2015 00:31:57 +0000 Subject: [PATCH 14/27] Modest changes --- tests/Test_synthetic_lanczos.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/Test_synthetic_lanczos.cc b/tests/Test_synthetic_lanczos.cc index c15ca3a7..a9bbfd07 100644 --- a/tests/Test_synthetic_lanczos.cc +++ b/tests/Test_synthetic_lanczos.cc @@ -35,7 +35,7 @@ public: random(pRNG,scale); - scale = exp(-real(scale)*6.0); + scale = exp(-real(scale)*3.0); std::cout << " True matrix \n"<< scale < Cheby(alpha,beta,mu,order); - - std::ofstream file("pooh.dat"); + std::ofstream file("cheby.dat"); Cheby.csv(file); HermOpOperatorFunction X; @@ -114,9 +113,9 @@ int main (int argc, char ** argv) } { - std::vector eval(Nm); - std::vector evec(Nm,grid); - ChebyIRL.calc(eval,evec,src, Nconv); + // std::vector eval(Nm); + // std::vector evec(Nm,grid); + // ChebyIRL.calc(eval,evec,src, Nconv); } Grid_finalize(); From 11cf0f08f342138290e6c6893e7be5aa7683bb9a Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 29 Nov 2015 00:32:45 +0000 Subject: [PATCH 15/27] This file is not yet debugged. --- .../iterative/ImplicitlyRestartedLanczos.h | 68 +++++++------------ 1 file changed, 25 insertions(+), 43 deletions(-) diff --git a/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h b/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h index 97c10b30..f99949cc 100644 --- a/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h +++ b/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h @@ -1,4 +1,3 @@ -#if 0 #ifndef GRID_IRL_H #define GRID_IRL_H @@ -18,8 +17,9 @@ template const RealD small = 1.0e-16; public: int lock; - int converged; + int get; int Niter; + int converged; int Nk; // Number of converged sought int Np; // Np -- Number of spare vecs in kryloc space @@ -59,6 +59,7 @@ public: // Sanity checked this routine (step) against Saad. ///////////////////////// void RitzMatrix(DenseVector& evec,int k){ + if(1) return; GridBase *grid = evec[0]._grid; @@ -451,8 +452,9 @@ until convergence std::cout << " -- Nconv = "<< Nconv << "\n"; } - + ///////////////////////////////////////////////// // Adapted from Rudy's lanczos factor routine + ///////////////////////////////////////////////// int Lanczos_Factor(int start, int end, int cont, DenseVector & bq, Field &bf, @@ -546,10 +548,16 @@ until convergence std::cout << "alpha = " << alpha << " fnorm = " << fnorm << '\n'; ///Iterative refinement of orthogonality V = [ bq[0] bq[1] ... bq[M] ] -#if 0 int re = 0; + // FIXME undefined params; how set in Rudy's code + int ref =0; + Real rho = 1.0e-8; + while( re == ref || (sqbt < rho * bck && re < 5) ){ + Field tmp2(grid); + Field tmp1(grid); + //bex = V^dag bf DenseVector bex(j+1); for(int k=0;k 1) std::cout << "orthagonality refined " << re << " times" <(ck, 0, 2, v, beta); - Householder_mult(H,v,beta,0,lock_num+0,lock_num+2,0); Householder_mult(H,v,beta,0,lock_num+0,lock_num+2,1); ///Accumulate eigenvector @@ -787,51 +794,26 @@ until convergence } std::cout << "Got " << converged << " so far " < goodval(get); + ///Check + void Check(DenseVector &evals, + DenseVector > &evecs) { + + DenseVector goodval(this->get); + EigenSort(evals,evecs); int NM = Nm; - int Nget = this->get; - S **V; - V = new S* [NM]; - RealD *QZ; - QZ = new RealD [NM*NM]; + DenseVector< DenseVector > V; Size(V,NM); + DenseVector QZ(NM*NM); + for(int i = 0; i < NM; i++){ for(int j = 0; j < NM; j++){ - - QZ[i*NM+j] = this->evecs[i][j]; - - int f_size_cb = 24*dop.cbLs*dop.node_cbvol; - - for(int cb = this->prec; cb < 2; cb++){ - for(int i = 0; i < NM; i++){ - V[i] = (S*)(this->bq[i][cb]); - - const int m0 = 4 * 4; // this is new code - assert(m0 % 16 == 0); // see the reason in VtimesQ.C - - const int row_per_thread = f_size_cb / (bfmarg::threads); - { - - { - DenseVector vrow_tmp0(m0*NM); - DenseVector vrow_tmp1(m0*NM); - RealD *row_tmp0 = vrow_tmp0.data(); - RealD *row_tmp1 = vrow_tmp1.data(); - VtimesQ(QZ, NM, V, row_tmp0, row_tmp1, id * row_per_thread, m0, (id + 1) * row_per_thread); - } - } - } - } + // evecs[i][j]; } } } -#endif /** @@ -1020,4 +1002,4 @@ static void Lock(DenseMatrix &H, ///Hess mtx } #endif -#endif + From 66847394528d32fd54d4f7abc580b58cda180040 Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 28 Nov 2015 16:52:44 -0800 Subject: [PATCH 16/27] Better to drop KMP_AFFINITY override --- lib/Threads.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Threads.h b/lib/Threads.h index 519a2a5b..64dcf893 100644 --- a/lib/Threads.h +++ b/lib/Threads.h @@ -44,7 +44,7 @@ class GridThread { }; static void SetMaxThreads(void) { #ifdef GRID_OMP - setenv("KMP_AFFINITY","balanced",1); + // setenv("KMP_AFFINITY","balanced",1); _threads = omp_get_max_threads(); omp_set_num_threads(_threads); #else From cc32ba615a0d1f8516917f8325e4bd1d653f147a Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 28 Nov 2015 16:53:54 -0800 Subject: [PATCH 17/27] Verbose changes --- lib/algorithms/CoarsenedMatrix.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/algorithms/CoarsenedMatrix.h b/lib/algorithms/CoarsenedMatrix.h index 31ff43a9..0eac0e3e 100644 --- a/lib/algorithms/CoarsenedMatrix.h +++ b/lib/algorithms/CoarsenedMatrix.h @@ -264,6 +264,9 @@ PARALLEL_FOR_LOOP for(int i=0;i Date: Sat, 28 Nov 2015 16:54:19 -0800 Subject: [PATCH 18/27] More verbose useful --- lib/algorithms/approx/Chebyshev.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/algorithms/approx/Chebyshev.h b/lib/algorithms/approx/Chebyshev.h index f00170cf..1952799e 100644 --- a/lib/algorithms/approx/Chebyshev.h +++ b/lib/algorithms/approx/Chebyshev.h @@ -166,7 +166,6 @@ namespace Grid { Field *Tn = &T1; Field *Tnp = &T2; - std::cout< Date: Sat, 28 Nov 2015 16:54:43 -0800 Subject: [PATCH 19/27] Divide function --- lib/lattice/Lattice_unary.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/lattice/Lattice_unary.h b/lib/lattice/Lattice_unary.h index 6d72ef31..c5698751 100644 --- a/lib/lattice/Lattice_unary.h +++ b/lib/lattice/Lattice_unary.h @@ -24,6 +24,17 @@ PARALLEL_FOR_LOOP return ret; } + template Lattice div(const Lattice &rhs,Integer y){ + Lattice ret(rhs._grid); + ret.checkerboard = rhs.checkerboard; + conformable(ret,rhs); +PARALLEL_FOR_LOOP + for(int ss=0;ssoSites();ss++){ + ret._odata[ss]=div(rhs._odata[ss],y); + } + return ret; + } + template Lattice expMat(const Lattice &rhs, ComplexD alpha, Integer Nexp = DEFAULT_MAT_EXP){ Lattice ret(rhs._grid); ret.checkerboard = rhs.checkerboard; From b2c02a6106fce1d89c3a289ba7f0d838a0c4517a Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 28 Nov 2015 16:58:16 -0800 Subject: [PATCH 20/27] Runs fastst on cori --- lib/qcd/action/fermion/WilsonFermion5D.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/qcd/action/fermion/WilsonFermion5D.cc b/lib/qcd/action/fermion/WilsonFermion5D.cc index dc6913ce..410aa629 100644 --- a/lib/qcd/action/fermion/WilsonFermion5D.cc +++ b/lib/qcd/action/fermion/WilsonFermion5D.cc @@ -266,11 +266,8 @@ void WilsonFermion5D::DhopInternal(StencilImpl & st, LebesgueOrder &lo, if( this->HandOptDslash ) { #pragma omp parallel for schedule(static) for(int ss=0;ssoSites();ss++){ + int sU=ss; for(int s=0;sHandOptDslash ) { + /* #pragma omp parallel for schedule(static) for(int t=0;toSites();ss++){ @@ -353,13 +351,11 @@ PARALLEL_FOR_LOOP Kernels::DiracOptHandDhopSite(st,U,comm_buf,sF,sU,in,out); } } - */ } else { PARALLEL_FOR_LOOP for(int ss=0;ssoSites();ss++){ + int sU=ss; for(int s=0;s Date: Sat, 28 Nov 2015 16:59:59 -0800 Subject: [PATCH 21/27] THis failed for some reason. Suspect Antonin has made more progress. --- lib/serialisation/XmlIO.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/serialisation/XmlIO.h b/lib/serialisation/XmlIO.h index 6f36dd0c..ebc1eba5 100644 --- a/lib/serialisation/XmlIO.h +++ b/lib/serialisation/XmlIO.h @@ -137,7 +137,7 @@ private: } catch(std::istringstream::failure e) { std::cerr << "XML read failure on "<<" "< Date: Sat, 28 Nov 2015 17:00:34 -0800 Subject: [PATCH 22/27] integer divide --- lib/simd/Grid_vector_unops.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/simd/Grid_vector_unops.h b/lib/simd/Grid_vector_unops.h index e4942937..540a54f5 100644 --- a/lib/simd/Grid_vector_unops.h +++ b/lib/simd/Grid_vector_unops.h @@ -67,6 +67,14 @@ namespace Grid { } }; + template struct DivIntFunctor { + Integer y; + DivIntFunctor(Integer _y) : y(_y) {}; + scalar operator()(const scalar &a) const { + return Integer(a)/y; + } + }; + template struct RealFunctor { scalar operator()(const scalar &a) const { return real(a); @@ -131,6 +139,10 @@ namespace Grid { inline Grid_simd mod(const Grid_simd &r,Integer y) { return SimdApply(ModIntFunctor(y),r); } + template < class S, class V > + inline Grid_simd div(const Grid_simd &r,Integer y) { + return SimdApply(DivIntFunctor(y),r); + } //////////////////////////////////////////////////////////////////////////// // Allows us to assign into **conformable** real vectors from complex //////////////////////////////////////////////////////////////////////////// From 6b97b271ae2a21ffc5258f77910441c2affdd86c Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 28 Nov 2015 17:01:20 -0800 Subject: [PATCH 23/27] Integer divide useful --- lib/tensors/Tensor_unary.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tensors/Tensor_unary.h b/lib/tensors/Tensor_unary.h index 045097a3..d2c3fae4 100644 --- a/lib/tensors/Tensor_unary.h +++ b/lib/tensors/Tensor_unary.h @@ -111,7 +111,7 @@ template inline auto toComplex(const iMatrix &z) -> type return ret; } - +BINARY_RSCALAR(div,Integer); BINARY_RSCALAR(mod,Integer); BINARY_RSCALAR(pow,RealD); From b8a38f292d8f533dedb69cac33cb313f4c31c475 Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 28 Nov 2015 17:01:51 -0800 Subject: [PATCH 24/27] Domain decomposition SAP precon implemented and working but not as fast as I hoped. --- tests/Test_dwf_hdcr.cc | 317 ++++++++++++++++++++++++++++++----------- 1 file changed, 231 insertions(+), 86 deletions(-) diff --git a/tests/Test_dwf_hdcr.cc b/tests/Test_dwf_hdcr.cc index 94b8481a..eb247331 100644 --- a/tests/Test_dwf_hdcr.cc +++ b/tests/Test_dwf_hdcr.cc @@ -6,6 +6,22 @@ using namespace std; using namespace Grid; using namespace Grid::QCD; +class myclass { +public: + + GRID_DECL_CLASS_MEMBERS(myclass, + int, domaindecompose, + int, domainsize, + int, order, + double, lo, + double, hi, + int, steps); + + myclass(){}; + +}; +myclass params; + RealD InverseApproximation(RealD x){ return 1.0/x; } @@ -26,15 +42,21 @@ public: Aggregates & _Aggregates; CoarseOperator & _CoarseOperator; - Matrix & _Matrix; + Matrix & _FineMatrix; FineOperator & _FineOperator; + Matrix & _SmootherMatrix; + FineOperator & _SmootherOperator; // Constructor - MultiGridPreconditioner(Aggregates &Agg, CoarseOperator &Coarse, FineOperator &Fine,Matrix &FineMatrix) + MultiGridPreconditioner(Aggregates &Agg, CoarseOperator &Coarse, + FineOperator &Fine,Matrix &FineMatrix, + FineOperator &Smooth,Matrix &SmootherMatrix) : _Aggregates(Agg), _CoarseOperator(Coarse), _FineOperator(Fine), - _Matrix(FineMatrix) + _FineMatrix(FineMatrix), + _SmootherOperator(Smooth), + _SmootherMatrix(SmootherMatrix) { } @@ -43,7 +65,7 @@ public: FineField p1(in._grid); FineField p2(in._grid); - MdagMLinearOperator fMdagMOp(_Matrix); + MdagMLinearOperator fMdagMOp(_FineMatrix); p1=in; RealD absp2; @@ -58,74 +80,20 @@ public: } } -#if 0 void operator()(const FineField &in, FineField & out) { - - FineField Min(in._grid); - FineField tmp(in._grid); - - CoarseVector Csrc(_CoarseOperator.Grid()); - CoarseVector Ctmp(_CoarseOperator.Grid()); - CoarseVector Csol(_CoarseOperator.Grid()); - - // Monitor completeness of low mode space - _Aggregates.ProjectToSubspace (Csrc,in); - _Aggregates.PromoteFromSubspace(Csrc,out); - std::cout< fCG(1.0e-3,1000); - ConjugateGradient CG(1.0e-8,100000); - - //////////////////////////////////////////////////////////////////////// - // ADEF2: [PTM+Q] in = [1 - Q A] M in + Q in = Min + Q [ in -A Min] - //////////////////////////////////////////////////////////////////////// - - // Smoothing step, followed by coarse grid correction - MdagMLinearOperator MdagMOp(_Matrix); - - Min=in; - std::cout< MdagMOp(_CoarseOperator); - HermitianLinearOperator HermOp(_CoarseOperator); - Csol=zero; - _Aggregates.ProjectToSubspace (Csrc,out); - HermOp.AdjOp(Csrc,Ctmp);// Normal equations - CG(MdagMOp ,Ctmp,Csol); - _Aggregates.PromoteFromSubspace(Csol,out); - - out = Min + out;; - */ - + if ( params.domaindecompose ) { + operatorSAP(in,out); + } else { + operatorCheby(in,out); + } } -#endif //////////////////////////////////////////////////////////////////////// // ADEF2: [PTM+Q] in = [1 - Q A] M in + Q in = Min + Q [ in -A Min] // ADEF1: [MP+Q ] in =M [1 - A Q] in + Q in //////////////////////////////////////////////////////////////////////// -#if 0 - void operator()(const FineField &in, FineField & out) { +#if 1 + void operatorADEF2(const FineField &in, FineField & out) { CoarseVector Csrc(_CoarseOperator.Grid()); CoarseVector Ctmp(_CoarseOperator.Grid()); @@ -136,7 +104,7 @@ public: HermitianLinearOperator HermOp(_CoarseOperator); MdagMLinearOperator MdagMOp(_CoarseOperator); - MdagMLinearOperator fMdagMOp(_Matrix); + MdagMLinearOperator fMdagMOp(_FineMatrix); FineField tmp(in._grid); FineField res(in._grid); @@ -189,8 +157,8 @@ public: } #endif // ADEF1: [MP+Q ] in =M [1 - A Q] in + Q in -#if 0 - void operator()(const FineField &in, FineField & out) { +#if 1 + void operatorADEF1(const FineField &in, FineField & out) { CoarseVector Csrc(_CoarseOperator.Grid()); CoarseVector Ctmp(_CoarseOperator.Grid()); @@ -201,7 +169,7 @@ public: HermitianLinearOperator HermOp(_CoarseOperator); MdagMLinearOperator MdagMOp(_CoarseOperator); - ShiftedMdagMLinearOperator fMdagMOp(_Matrix,0.1); + ShiftedMdagMLinearOperator fMdagMOp(_FineMatrix,0.1); FineField tmp(in._grid); FineField res(in._grid); @@ -234,14 +202,79 @@ public: } #endif + void SAP (const FineField & src,FineField & psi){ + + Lattice > coor(src._grid); + Lattice > subset(src._grid); + + FineField r(src._grid); + FineField zz(src._grid); zz=zero; + FineField vec1(src._grid); + FineField vec2(src._grid); + + const Integer block=params.domainsize; + + subset=zero; + for(int mu=0;mu fMdagMOp(_SmootherMatrix,0.0); + Chebyshev Cheby (params.lo,params.hi,params.order,InverseApproximation); + + RealD resid; + for(int i=0;i 20*71 = 1400 matmuls. +// 2*71 = 140 comms. + + // Even domain solve + r= where(subset==(Integer)0,r,zz); + _SmootherOperator.AdjOp(r,vec1); + Cheby(fMdagMOp,vec1,vec2); // solves MdagM = g5 M g5M + psi = psi + vec2; + + // Odd domain residual + _FineOperator.Op(psi,vec1);// this is the G5 herm bit + r= src - vec1 ; + r= where(subset==(Integer)1,r,zz); + + resid = norm2(r) /norm2(src); + std::cout << "SAP "< fMdagMOp(_Matrix); - ShiftedMdagMLinearOperator fMdagMOp(_Matrix,0.5); + // MdagMLinearOperator fMdagMOp(_FineMatrix); + ShiftedMdagMLinearOperator fMdagMOp(_SmootherMatrix,0.0); RealD Ni,r; @@ -250,7 +283,7 @@ public: for(int ilo=0;ilo<3;ilo++){ for(int ord=5;ord<50;ord*=2){ - _FineOperator.AdjOp(in,vec1); + _SmootherOperator.AdjOp(in,vec1); Chebyshev Cheby (lo[ilo],70.0,ord,InverseApproximation); Cheby(fMdagMOp,vec1,vec2); // solves MdagM = g5 M g5M @@ -264,7 +297,7 @@ public: } } - void operator()(const FineField &in, FineField & out) { + void operatorCheby(const FineField &in, FineField & out) { CoarseVector Csrc(_CoarseOperator.Grid()); CoarseVector Ctmp(_CoarseOperator.Grid()); @@ -275,18 +308,18 @@ public: HermitianLinearOperator HermOp(_CoarseOperator); MdagMLinearOperator MdagMOp(_CoarseOperator); - // MdagMLinearOperator fMdagMOp(_Matrix); - ShiftedMdagMLinearOperator fMdagMOp(_Matrix,0.0); + // MdagMLinearOperator fMdagMOp(_FineMatrix); + ShiftedMdagMLinearOperator fMdagMOp(_SmootherMatrix,0.0); FineField vec1(in._grid); FineField vec2(in._grid); // Chebyshev Cheby (0.5,70.0,30,InverseApproximation); // Chebyshev ChebyAccu(0.5,70.0,30,InverseApproximation); - Chebyshev Cheby (2.0,70.0,10,InverseApproximation); - Chebyshev ChebyAccu(2.0,70.0,10,InverseApproximation); - Cheby.JacksonSmooth(); - ChebyAccu.JacksonSmooth(); + Chebyshev Cheby (2.0,70.0,15,InverseApproximation); + Chebyshev ChebyAccu(2.0,70.0,15,InverseApproximation); + // Cheby.JacksonSmooth(); + // ChebyAccu.JacksonSmooth(); _Aggregates.ProjectToSubspace (Csrc,in); _Aggregates.PromoteFromSubspace(Csrc,out); @@ -305,7 +338,7 @@ public: RealD Ni = norm2(in); - _FineOperator.AdjOp(in,vec1);// this is the G5 herm bit + _SmootherOperator.AdjOp(in,vec1);// this is the G5 herm bit ChebyAccu(fMdagMOp,vec1,out); // solves MdagM = g5 M g5M std::cout< CG(1.0e-3,100000); + + HermitianLinearOperator HermOp(_CoarseOperator); + MdagMLinearOperator MdagMOp(_CoarseOperator); + + FineField vec1(in._grid); + FineField vec2(in._grid); + + _Aggregates.ProjectToSubspace (Csrc,in); + _Aggregates.PromoteFromSubspace(Csrc,out); + std::cout< > coor(UGrid); + zz=zero; + for(int mu=0;mu(Umu,mu); + U = where(mod(coor,params.domainsize)==(Integer)0,zz,U); + PokeIndex(UmuDD,U,mu); + } + } else { + UmuDD = Umu; + } // SU3::ColdConfiguration(RNG4,Umu); // SU3::TepidConfiguration(RNG4,Umu); // SU3::HotConfiguration(RNG4,Umu); @@ -402,6 +517,7 @@ int main (int argc, char ** argv) std::cout< HermIndefOp(Ddwf); + Gamma5R5HermitianLinearOperator HermIndefOpDD(DdwfDD); CoarsenedMatrix LDOp(*Coarse5d); LDOp.CoarsenOperator(FGrid,HermIndefOp,Aggregates); @@ -467,7 +584,13 @@ int main (int argc, char ** argv) std::cout< Precon(Aggregates, LDOp,HermIndefOp,Ddwf); + MultiGridPreconditioner Precon (Aggregates, LDOp, + HermIndefOp,Ddwf, + HermIndefOp,Ddwf); + + MultiGridPreconditioner PreconDD(Aggregates, LDOp, + HermIndefOp,Ddwf, + HermIndefOpDD,DdwfDD); TrivialPrecon simple; std::cout< simple; // ConjugateGradient fCG(1.0e-8,100000); // fCG(HermDefOp,src,result); @@ -496,12 +630,22 @@ int main (int argc, char ** argv) std::cout< PGCRDD(1.0e-8,100000,PreconDD,8,128); + result=zero; + std::cout< PGCR(1.0e-8,100000,Precon,8,128); - std::cout< PGCR(1.0e-8,100000,Precon,8,128); + // std::cout< Date: Sun, 29 Nov 2015 10:59:11 +0000 Subject: [PATCH 25/27] No compile fixes --- tests/Test_dwf_hdcr.cc | 4 ++-- tests/Test_stencil.cc | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/Test_dwf_hdcr.cc b/tests/Test_dwf_hdcr.cc index eb247331..006d0e5e 100644 --- a/tests/Test_dwf_hdcr.cc +++ b/tests/Test_dwf_hdcr.cc @@ -6,7 +6,7 @@ using namespace std; using namespace Grid; using namespace Grid::QCD; -class myclass { +class myclass: Serializable { public: GRID_DECL_CLASS_MEMBERS(myclass, @@ -446,7 +446,7 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - XMLReader RD("params.xml"); + XmlReader RD("params.xml"); read(RD,"params",params); std::cout<<"Params: Order "< directions(npoint,dir); std::vector displacements(npoint,disp); -<<<<<<< HEAD - CartesianStencil > myStencil(&Fine,npoint,0,directions,displacements); -======= Stencil myStencil(&Fine,npoint,0,directions,displacements); ->>>>>>> bc4b2528835e646fab1b186506b4740d97b02243 std::vector ocoor(4); for(int o=0;o Date: Sun, 29 Nov 2015 03:14:44 -0800 Subject: [PATCH 26/27] No compile fixes on gcc/Cray --- lib/algorithms/iterative/DenseMatrix.h | 3 +++ .../iterative/ImplicitlyRestartedLanczos.h | 7 +++--- lib/serialisation/BinaryIO.cc | 16 ++++++------ lib/serialisation/TextIO.cc | 25 +++++++++---------- lib/serialisation/XmlIO.cc | 21 ++++++++-------- tests/Test_synthetic_lanczos.cc | 4 ++- 6 files changed, 40 insertions(+), 36 deletions(-) diff --git a/lib/algorithms/iterative/DenseMatrix.h b/lib/algorithms/iterative/DenseMatrix.h index 2423677d..e8d1f9ab 100644 --- a/lib/algorithms/iterative/DenseMatrix.h +++ b/lib/algorithms/iterative/DenseMatrix.h @@ -25,6 +25,9 @@ template void SizeSquare(DenseMatrix & mat, int &N) assert(N==M); } +template void Resize(DenseVector & mat, int N) { + mat.resize(N); +} template void Resize(DenseMatrix & mat, int N, int M) { mat.resize(N); for(int i=0;i H; Resize(H,Nm,Nm); - Resize(evals,Nm,Nm); + Resize(evals,Nm); Resize(evecs,Nm); int ff = Lanczos_Factor(0, M, cont, bq,bf,H); // 0--M to begin with @@ -765,11 +765,11 @@ until convergence RealD resid_nrm= norm2(bf); if(!lock) converged = 0; - +#if 0 for(int i = SS - lock_num - 1; i >= SS - Nk && i >= 0; --i){ RealD diff = 0; - diff = abs(tevecs[i][Nm - 1 - lock_num]) * resid_nrm; + diff = abs( tevecs[i][Nm - 1 - lock_num] ) * resid_nrm; std::cout << "residual estimate " << SS-1-i << " " << diff << " of (" << tevals[i] << ")" << std::endl; @@ -792,6 +792,7 @@ until convergence break; } } +#endif std::cout << "Got " << converged << " so far " < -using namespace Grid; -using namespace std; +namespace Grid { // Writer implementation /////////////////////////////////////////////////////// -BinaryWriter::BinaryWriter(const string &fileName) -: file_(fileName, ios::binary|ios::out) +BinaryWriter::BinaryWriter(const std::string &fileName) +: file_(fileName, std::ios::binary|std::ios::out) {} template <> -void BinaryWriter::writeDefault(const string &s, const string &output) +void BinaryWriter::writeDefault(const std::string &s, const std::string &output) { uint64_t sz = output.size(); @@ -21,12 +20,12 @@ void BinaryWriter::writeDefault(const string &s, const string &output) } // Reader implementation /////////////////////////////////////////////////////// -BinaryReader::BinaryReader(const string &fileName) -: file_(fileName, ios::binary|ios::in) +BinaryReader::BinaryReader(const std::string &fileName) +: file_(fileName, std::ios::binary|std::ios::in) {} template <> -void BinaryReader::readDefault(const string &s, string &output) +void BinaryReader::readDefault(const std::string &s, std::string &output) { uint64_t sz; @@ -34,3 +33,4 @@ void BinaryReader::readDefault(const string &s, string &output) output.reserve(sz); file_.read((char *)output.data(), sz); } +} diff --git a/lib/serialisation/TextIO.cc b/lib/serialisation/TextIO.cc index 9d88b26a..8b9c4f01 100644 --- a/lib/serialisation/TextIO.cc +++ b/lib/serialisation/TextIO.cc @@ -1,14 +1,12 @@ #include -using namespace Grid; -using namespace std; - +namespace Grid { // Writer implementation /////////////////////////////////////////////////////// -TextWriter::TextWriter(const string &fileName) -: file_(fileName, ios::out) +TextWriter::TextWriter(const std::string &fileName) +: file_(fileName, std::ios::out) {} -void TextWriter::push(const string &s) +void TextWriter::push(const std::string &s) { level_++; }; @@ -27,11 +25,11 @@ void TextWriter::indent(void) }; // Reader implementation /////////////////////////////////////////////////////// -TextReader::TextReader(const string &fileName) -: file_(fileName, ios::in) +TextReader::TextReader(const std::string &fileName) +: file_(fileName, std::ios::in) {} -void TextReader::push(const string &s) +void TextReader::push(const std::string &s) { level_++; }; @@ -50,17 +48,18 @@ void TextReader::checkIndent(void) file_.get(c); if (c != '\t') { - cerr << "mismatch on tab " << c << " level " << level_; - cerr << " i "<< i < -void TextReader::readDefault(const string &s, string &output) +void TextReader::readDefault(const std::string &s, std::string &output) { checkIndent(); output.clear(); getline(file_, output); } +} diff --git a/lib/serialisation/XmlIO.cc b/lib/serialisation/XmlIO.cc index 8dd93de7..b5c6e5bd 100644 --- a/lib/serialisation/XmlIO.cc +++ b/lib/serialisation/XmlIO.cc @@ -1,10 +1,8 @@ #include -using namespace Grid; -using namespace std; - +namespace Grid { // Writer implementation /////////////////////////////////////////////////////// -XmlWriter::XmlWriter(const string &fileName) +XmlWriter::XmlWriter(const std::string &fileName) : fileName_(fileName) { node_ = doc_.append_child(); @@ -16,7 +14,7 @@ XmlWriter::~XmlWriter(void) doc_.save_file(fileName_.c_str(), " "); } -void XmlWriter::push(const string &s) +void XmlWriter::push(const std::string &s) { node_ = node_.append_child(s.c_str()); } @@ -27,22 +25,22 @@ void XmlWriter::pop(void) } // Reader implementation /////////////////////////////////////////////////////// -XmlReader::XmlReader(const string &fileName) +XmlReader::XmlReader(const std::string &fileName) : fileName_(fileName) { pugi::xml_parse_result result = doc_.load_file(fileName_.c_str()); if ( !result ) { - cerr << "XML error description: " << result.description() << "\n"; - cerr << "XML error offset : " << result.offset << "\n"; - abort(); + std::cerr << "XML error description: " << result.description() << "\n"; + std::cerr << "XML error offset : " << result.offset << "\n"; + std::abort(); } node_ = doc_.child("grid"); } -void XmlReader::push(const string &s) +void XmlReader::push(const std::string &s) { node_ = node_.child(s.c_str()); } @@ -53,7 +51,8 @@ void XmlReader::pop(void) } template <> -void XmlReader::readDefault(const string &s, string &output) +void XmlReader::readDefault(const std::string &s, std::string &output) { output = node_.child(s.c_str()).first_child().value(); } +} diff --git a/tests/Test_synthetic_lanczos.cc b/tests/Test_synthetic_lanczos.cc index a9bbfd07..8067b4a0 100644 --- a/tests/Test_synthetic_lanczos.cc +++ b/tests/Test_synthetic_lanczos.cc @@ -8,6 +8,7 @@ using namespace Grid::QCD; static int FEenableexcept (unsigned int excepts) { +#if 0 static fenv_t fenv; unsigned int new_excepts = excepts & FE_ALL_EXCEPT, old_excepts; // previous masks @@ -20,6 +21,7 @@ FEenableexcept (unsigned int excepts) fenv.__mxcsr &= ~(new_excepts << 7); return ( fesetenv (&fenv) ? -1 : old_excepts ); +#endif } @@ -70,7 +72,7 @@ public: int main (int argc, char ** argv) { - FEenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT); + // FEenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT); Grid_init(&argc,&argv); From 26161addd004b8c7e3cce03d4c59708f0b4bf3ad Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 29 Nov 2015 11:19:12 +0000 Subject: [PATCH 27/27] Warn fix clang --- tests/Test_synthetic_lanczos.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Test_synthetic_lanczos.cc b/tests/Test_synthetic_lanczos.cc index 8067b4a0..d8bbc9a4 100644 --- a/tests/Test_synthetic_lanczos.cc +++ b/tests/Test_synthetic_lanczos.cc @@ -21,6 +21,8 @@ FEenableexcept (unsigned int excepts) fenv.__mxcsr &= ~(new_excepts << 7); return ( fesetenv (&fenv) ? -1 : old_excepts ); +#else + return 0; #endif }