From 92ec509bfa3f27f35f359bd2331f1565bf92a6bc Mon Sep 17 00:00:00 2001 From: Chulwoo Jung Date: Thu, 4 May 2017 19:32:00 -0400 Subject: [PATCH] Commiting to move to Jlab --- .../iterative/ImplicitlyRestartedLanczos.h | 94 +++++++++++++------ lib/algorithms/iterative/SchurRedBlack.h | 2 + 2 files changed, 68 insertions(+), 28 deletions(-) diff --git a/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h b/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h index b35e5243..8dda14b3 100644 --- a/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h +++ b/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h @@ -485,75 +485,81 @@ public: } // needs more memory - void Rotate0( - int Nm, +void Rotate0( + int _Nm, DenseVector& Qt, DenseVector& evec, - int k1, int k2 +//int k1, int k2 + int j0, int j1, + int _Nk ) +// void Rotate0( int Nm, DenseVector& Qt, DenseVector& evec, int k1, int k2) { GridBase *grid = evec[0]._grid; - DenseVector B(Nm,grid); // waste of space replicating + DenseVector B(_Nm,grid); // waste of space replicating if (0) { // old implementation without blocking - for(int i=0; i<(Nk+1); ++i) B[i] = 0.0; + for(int i=0; i<(_Nm); ++i) B[i] = 0.0; - for(int j=k1-1; joSites();ss++){ - for(int jj=k1-1; jj& Qt, DenseVector& evec, - int k1, int k2 +//int k1, int k2 + int j0, int j1, + int _Nk ) { GridBase *grid = evec[0]._grid; typedef typename Field::vector_object vobj; - assert(k1>0); - assert(k2=0); + assert(j1<_Nm); #pragma omp parallel { // int thr=GridThread::GetThreads(); // printf("thr=%d ss=%d me=%d\n",thr,ss,me);fflush(stdout); // std::cout<& Qt, DenseVector& evec, @@ -918,7 +951,8 @@ until convergence // Uses more temorary // Rotate0(Nm,Qt,evec,k1,k2); // Uses minimal temporary, possibly with less speed - Rotate(Nm,Qt,evec,k1,k2); +// Rotate(Nm,Qt,evec,k1,k2); + Rotate(Nm,Qt,evec,k1-1,k2+1,Nm); // Try if Rotate() doesn't work // Rotate2(Nm,Qt,evec,k1,k2); t1=usecond()/1e6; @@ -975,7 +1009,11 @@ until convergence } #else // ConvRotate0( Nk, Nm, Qt, evec, eval,eval2,Iconv,Nconv); - ConvRotate( Nk, Nm, Qt, evec, eval,eval2,Iconv,Nconv); +// ConvRotate( Nk, Nm, Qt, evec, eval,eval2,Iconv,Nconv); +// ConvCheck only counts Iconv[j]=j. ignore Iconv[] + Rotate(Nm,Qt,evec,0,Nk,Nk); + FinalCheck( Nk, Nm, evec); +exit(-1); // ConvRotate2( Nk, Nm, Qt, evec, eval,eval2,Iconv,Nconv); #endif _sort.push(eval,evec,Nconv); diff --git a/lib/algorithms/iterative/SchurRedBlack.h b/lib/algorithms/iterative/SchurRedBlack.h index 06f08034..e68b6195 100644 --- a/lib/algorithms/iterative/SchurRedBlack.h +++ b/lib/algorithms/iterative/SchurRedBlack.h @@ -141,6 +141,7 @@ namespace Grid { } }; +#if 1 /////////////////////////////////////////////////////////////////////////////////////////////////////// // Take a matrix and form a Red Black solver calling a Herm solver // Use of RB info prevents making SchurRedBlackSolve conform to standard interface @@ -220,6 +221,7 @@ namespace Grid { std::cout<