1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00
This commit is contained in:
Peter Boyle 2024-04-30 05:20:41 -04:00
parent 1c5aa939fd
commit aefd255a3c

View File

@ -532,43 +532,49 @@ Grid : Message : 328.193436 s : CoarsenOperator mat 122213270 us
_A.resize(geom_srhs.npoint,CoarseGrid); _A.resize(geom_srhs.npoint,CoarseGrid);
// Count use small chunks than npoint == 81 and save memory // Count use small chunks than npoint == 81 and save memory
std::vector<FineField> _MphaV; int batch = 9;
_MphaV.resize(npoint,grid); std::vector<FineField> _MphaV(batch,grid);
std::vector<CoarseVector> TmpProj(batch,CoarseGrid);
std::vector<CoarseVector> ComputeProj(npoint,CoarseGrid); std::vector<CoarseVector> ComputeProj(npoint,CoarseGrid);
CoarseVector FT(CoarseGrid); CoarseVector FT(CoarseGrid);
for(int i=0;i<nbasis;i++){// Loop over basis vectors for(int i=0;i<nbasis;i++){// Loop over basis vectors
std::cout << GridLogMessage<< "CoarsenMatrixColoured vec "<<i<<"/"<<nbasis<< std::endl; std::cout << GridLogMessage<< "CoarsenMatrixColoured vec "<<i<<"/"<<nbasis<< std::endl;
std::cout << GridLogMessage << " phasing the fine vector "<<std::endl; // std::cout << GridLogMessage << " phasing the fine vector "<<std::endl;
for(int p=0;p<npoint;p++){ // Loop over momenta in npoint // Fixme : do this in batches
for(int p=0;p<npoint;p+=batch){ // Loop over momenta in npoint
for(int b=0;b<MIN(batch,npoint-p);b++){
tphaseBZ-=usecond(); tphaseBZ-=usecond();
phaV = phaF[p]*Subspace.subspace[i]; phaV = phaF[p+b]*Subspace.subspace[i];
tphaseBZ+=usecond(); tphaseBZ+=usecond();
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
// Multiple phased subspace vector by matrix and project to subspace // Multiple phased subspace vector by matrix and project to subspace
// Remove local bulk phase to leave relative phases // Remove local bulk phase to leave relative phases
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
// Memory footprint was an issue
tmat-=usecond(); tmat-=usecond();
linop.Op(phaV,MphaV); linop.Op(phaV,MphaV);
_MphaV[p] = MphaV; _MphaV[b] = MphaV;
tmat+=usecond(); tmat+=usecond();
} }
// std::cout << GridLogMessage << " Calling block project "<<std::endl;
std::cout << GridLogMessage << " Calling block project "<<std::endl;
tproj-=usecond(); tproj-=usecond();
Projector.blockProject(_MphaV,ComputeProj); Projector.blockProject(_MphaV,TmpProj);
tproj+=usecond(); tproj+=usecond();
std::cout << GridLogMessage << " conj phasing the coarse vectors "<<std::endl; // std::cout << GridLogMessage << " conj phasing the coarse vectors "<<std::endl;
for(int p=0;p<npoint;p++){ for(int b=0;b<MIN(batch,npoint-p);b++){
ComputeProj[p] = conjugate(pha[p])*ComputeProj[p]; ComputeProj[p+b] = conjugate(pha[p+b])*TmpProj[b];
}
} }
// Could do this with a block promote or similar BLAS call via the MultiRHSBlockProjector with a const matrix. // Could do this with a block promote or similar BLAS call via the MultiRHSBlockProjector with a const matrix.
std::cout << GridLogMessage << " Starting FT inv "<<std::endl; // std::cout << GridLogMessage << " Starting FT inv "<<std::endl;
tinv-=usecond(); tinv-=usecond();
for(int k=0;k<npoint;k++){ for(int k=0;k<npoint;k++){
FT = Zero(); FT = Zero();
@ -620,7 +626,7 @@ Grid : Message : 328.193436 s : CoarsenOperator mat 122213270 us
// PopulateAdag(); // PopulateAdag();
// } // }
// Need to write something to populate Adag from A // Need to write something to populate Adag from A
std::cout << GridLogMessage << " Calling GridtoBLAS "<<std::endl; // std::cout << GridLogMessage << " Calling GridtoBLAS "<<std::endl;
for(int p=0;p<geom_srhs.npoint;p++){ for(int p=0;p<geom_srhs.npoint;p++){
GridtoBLAS(_A[p],BLAS_A[p]); GridtoBLAS(_A[p],BLAS_A[p]);
} }