From e80a87ff7fa81c78d75d697443f8964e6f1ca104 Mon Sep 17 00:00:00 2001 From: Chulwoo Jung Date: Thu, 4 May 2017 16:05:07 -0400 Subject: [PATCH] Checking in before modifying --- .../iterative/ImplicitlyRestartedLanczos.h | 351 +++++++++++------- 1 file changed, 214 insertions(+), 137 deletions(-) diff --git a/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h b/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h index d12b6d38..b35e5243 100644 --- a/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h +++ b/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h @@ -530,15 +530,23 @@ PARALLEL_FOR_LOOP DenseVector& evec, int k1, int k2 ) -//Christoph's version. Still fails on CJ's workstation for some reason { GridBase *grid = evec[0]._grid; + typedef typename Field::vector_object vobj; + assert(k1>0); + assert(k2oSites()); - for(int j=0; joSites()); + for(int j=0; j& Qt, + DenseVector& evec, + DenseVector &eval2, + DenseVector &Iconv, + int &Nconv) +{ + + GridBase *grid = evec[0]._grid; + DenseVector B(Nm,grid); // waste of space replicating + Field v(grid); +if (0) { + for(int k = 0; k& Qt, + DenseVector& evec, + DenseVector &eval2, + DenseVector &Iconv, + int &Nconv) + { + GridBase *grid = evec[0]._grid; + Field v(grid); + Field B(grid); + Nconv = 0; + for(int j = 0; j& Qt, + DenseVector& evec, + DenseVector &eval, + DenseVector &eval2, + DenseVector &Iconv, + int &Nconv) +{ + GridBase *grid = evec[0]._grid; + int thr=GridThread::GetThreads(); + for(int i=0; ioSites();ss++){ + int me = GridThread::ThreadBarrier(); + printf("thr=%d ss=%d me=%d\n",thr,ss,me);fflush(stdout); + assert( (Nm*thr)oSites()); +// auto B2 = evec[0]._odata[0]; +// std::vector < decltype( B2 ) > B(Nm,B2); + for(int j=0; j& Qt, + DenseVector& evec, + DenseVector &eval, + DenseVector &eval2, + DenseVector &Iconv, + int &Nconv) +{ + GridBase *grid = evec[0]._grid; + typedef typename Field::vector_object vobj; +#pragma omp parallel + { + std::vector < vobj > B(Nm); +#pragma omp for + for(int ss=0;ss < grid->oSites();ss++){ +// for(int j=0; j K P = M − K † @@ -722,9 +915,12 @@ until convergence assert(k2oSites();ss++){ - for(int jj=0; jjoSites();ss++){ - int thr=GridThread::GetThreads(); - int me = GridThread::ThreadBarrier(); -// printf("thr=%d ss=%d me=%d\n",thr,ss,me);fflush(stdout); -// auto B2 = evec[0]._odata[0]; -// std::vector < decltype( B2 ) > B(Nm,B2); - assert( (Nm*thr)oSites()); - for(int j=0; j