mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-24 12:45:56 +01:00
Checking in before pulling develop
This commit is contained in:
parent
f91e3af97f
commit
8ee26f9112
@ -447,7 +447,7 @@ for( int i =0;i<total;i++){
|
|||||||
|
|
||||||
cudaStat = cudaMallocManaged((void **)&w_acc, Nu*sites*12*sizeof(CUDA_COMPLEX));
|
cudaStat = cudaMallocManaged((void **)&w_acc, Nu*sites*12*sizeof(CUDA_COMPLEX));
|
||||||
// Glog << "w_acc= "<<w_acc << " "<< cudaStat << std::endl;
|
// Glog << "w_acc= "<<w_acc << " "<< cudaStat << std::endl;
|
||||||
cudaStat = cudaMallocManaged((void **)&evec_acc, Nevec_acc*sites*12*sizeof(CUDA_COMPLEX));
|
cudaStat = cudaMallocManaged((void **)&evec_acc, Nevec_acc*sites*12*sizeof(CUDA_COMPLEX));
|
||||||
// Glog << "evec_acc= "<<evec_acc << " "<< cudaStat << std::endl;
|
// Glog << "evec_acc= "<<evec_acc << " "<< cudaStat << std::endl;
|
||||||
cudaStat = cudaMallocManaged((void **)&c_acc, Nu*Nevec_acc*sizeof(CUDA_COMPLEX));
|
cudaStat = cudaMallocManaged((void **)&c_acc, Nu*Nevec_acc*sizeof(CUDA_COMPLEX));
|
||||||
// Glog << "c_acc= "<<c_acc << " "<< cudaStat << std::endl;
|
// Glog << "c_acc= "<<c_acc << " "<< cudaStat << std::endl;
|
||||||
@ -721,7 +721,9 @@ for( int i =0;i<total;i++){
|
|||||||
Eigen::MatrixXcd Q = Eigen::MatrixXcd::Zero(Nm,Nm);
|
Eigen::MatrixXcd Q = Eigen::MatrixXcd::Zero(Nm,Nm);
|
||||||
|
|
||||||
std::vector<int> Iconv(Nm);
|
std::vector<int> Iconv(Nm);
|
||||||
std::vector<Field> B(Nm,grid); // waste of space replicating
|
int Ntest=Nu;
|
||||||
|
// std::vector<Field> B(Nm,grid); // waste of space replicating
|
||||||
|
std::vector<Field> B(1,grid); // waste of space replicating
|
||||||
|
|
||||||
std::vector<Field> f(Nu,grid);
|
std::vector<Field> f(Nu,grid);
|
||||||
std::vector<Field> f_copy(Nu,grid);
|
std::vector<Field> f_copy(Nu,grid);
|
||||||
@ -782,22 +784,22 @@ for( int i =0;i<total;i++){
|
|||||||
// Convergence test
|
// Convergence test
|
||||||
Glog <<" #Convergence test: "<<std::endl;
|
Glog <<" #Convergence test: "<<std::endl;
|
||||||
Nconv = 0;
|
Nconv = 0;
|
||||||
for(int k = 0; k<Nr; ++k) B[k]=0.0;
|
|
||||||
for(int j = 0; j<Nr; j+=Nconv_test_interval){
|
for(int j = 0; j<Nr; j+=Nconv_test_interval){
|
||||||
|
B[0]=0.0;
|
||||||
if ( j/Nconv_test_interval == Nconv ) {
|
if ( j/Nconv_test_interval == Nconv ) {
|
||||||
Glog <<" #rotation for next check point evec"
|
Glog <<" #rotation for next check point evec"
|
||||||
<< std::setw(4)<< std::setiosflags(std::ios_base::right)
|
<< std::setw(4)<< std::setiosflags(std::ios_base::right)
|
||||||
<< "["<< j <<"]" <<std::endl;
|
<< "["<< j <<"]" <<std::endl;
|
||||||
for(int k = 0; k<Nr; ++k){
|
for(int k = 0; k<Nr; ++k){
|
||||||
B[j].Checkerboard() = evec[k].Checkerboard();
|
B[0].Checkerboard() = evec[k].Checkerboard();
|
||||||
B[j] += evec[k]*Qt(k,j);
|
B[0] += evec[k]*Qt(k,j);
|
||||||
}
|
}
|
||||||
|
|
||||||
_Linop.HermOp(B[j],v);
|
_Linop.HermOp(B[0],v);
|
||||||
RealD vnum = real(innerProduct(B[j],v)); // HermOp.
|
RealD vnum = real(innerProduct(B[0],v)); // HermOp.
|
||||||
RealD vden = norm2(B[j]);
|
RealD vden = norm2(B[0]);
|
||||||
eval2[j] = vnum/vden;
|
eval2[j] = vnum/vden;
|
||||||
v -= eval2[j]*B[j];
|
v -= eval2[j]*B[0];
|
||||||
RealD vv = norm2(v);
|
RealD vv = norm2(v);
|
||||||
resid[j] = vv;
|
resid[j] = vv;
|
||||||
|
|
||||||
@ -836,11 +838,20 @@ for( int i =0;i<total;i++){
|
|||||||
} else {
|
} else {
|
||||||
Glog << fname + " CONVERGED ; Summary :\n";
|
Glog << fname + " CONVERGED ; Summary :\n";
|
||||||
// Sort convered eigenpairs.
|
// Sort convered eigenpairs.
|
||||||
|
std::vector<Field> Btmp(Nconv,grid); // waste of space replicating
|
||||||
|
for(int i=0; i<Nconv; ++i) Btmp[i]=0;
|
||||||
|
for(int i=0; i<Nconv; ++i)
|
||||||
|
for(int k = 0; k<Nr; ++k){
|
||||||
|
Btmp[i].Checkerboard() = evec[k].Checkerboard();
|
||||||
|
Btmp[i] += evec[k]*Qt(k,Iconv[i]);
|
||||||
|
}
|
||||||
|
|
||||||
eval.resize(Nconv);
|
eval.resize(Nconv);
|
||||||
evec.resize(Nconv,grid);
|
evec.resize(Nconv,grid);
|
||||||
|
|
||||||
for(int i=0; i<Nconv; ++i){
|
for(int i=0; i<Nconv; ++i){
|
||||||
eval[i] = eval2[Iconv[i]];
|
eval[i] = eval2[Iconv[i]];
|
||||||
evec[i] = B[Iconv[i]];
|
evec[i] = Btmp[i];
|
||||||
}
|
}
|
||||||
_sort.push(eval,evec,Nconv);
|
_sort.push(eval,evec,Nconv);
|
||||||
}
|
}
|
||||||
|
@ -359,7 +359,7 @@ int main (int argc, char ** argv)
|
|||||||
JP.MaxIter,
|
JP.MaxIter,
|
||||||
IRBLdiagonaliseWithEigen);
|
IRBLdiagonaliseWithEigen);
|
||||||
// IRBLdiagonaliseWithLAPACK);
|
// IRBLdiagonaliseWithLAPACK);
|
||||||
IRBL.split_test=1;
|
IRBL.split_test=0;
|
||||||
|
|
||||||
std::vector<RealD> eval(JP.Nm);
|
std::vector<RealD> eval(JP.Nm);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user