mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-09 23:45:36 +00:00
Hermitian dealing with
This commit is contained in:
parent
737d3ffb98
commit
b82eee4733
@ -226,6 +226,7 @@ public:
|
|||||||
void ProjectNearestNeighbour(RealD shift, GeneralCoarseOp &CopyMe)
|
void ProjectNearestNeighbour(RealD shift, GeneralCoarseOp &CopyMe)
|
||||||
{
|
{
|
||||||
int nfound=0;
|
int nfound=0;
|
||||||
|
std::cout << " ProjectNearestNeighbour "<< CopyMe._A[0].Grid()<<std::endl;
|
||||||
for(int p=0;p<geom.npoint;p++){
|
for(int p=0;p<geom.npoint;p++){
|
||||||
for(int pp=0;pp<CopyMe.geom.npoint;pp++){
|
for(int pp=0;pp<CopyMe.geom.npoint;pp++){
|
||||||
// Search for the same relative shift
|
// Search for the same relative shift
|
||||||
@ -233,12 +234,12 @@ public:
|
|||||||
if ( CopyMe.geom.shifts[pp]==geom.shifts[p] ) {
|
if ( CopyMe.geom.shifts[pp]==geom.shifts[p] ) {
|
||||||
_A[p] = CopyMe.Cell.Extract(CopyMe._A[pp]);
|
_A[p] = CopyMe.Cell.Extract(CopyMe._A[pp]);
|
||||||
_Adag[p] = CopyMe.Cell.Extract(CopyMe._Adag[pp]);
|
_Adag[p] = CopyMe.Cell.Extract(CopyMe._Adag[pp]);
|
||||||
ExchangeCoarseLinks();
|
|
||||||
nfound++;
|
nfound++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(nfound==geom.npoint);
|
assert(nfound==geom.npoint);
|
||||||
|
ExchangeCoarseLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralCoarsenedMatrix(NonLocalStencilGeometry &_geom,GridBase *FineGrid, GridCartesian * CoarseGrid)
|
GeneralCoarsenedMatrix(NonLocalStencilGeometry &_geom,GridBase *FineGrid, GridCartesian * CoarseGrid)
|
||||||
@ -271,7 +272,8 @@ public:
|
|||||||
}
|
}
|
||||||
void Mdag (const CoarseVector &in, CoarseVector &out)
|
void Mdag (const CoarseVector &in, CoarseVector &out)
|
||||||
{
|
{
|
||||||
Mult(_Adag,in,out);
|
if ( hermitian ) M(in,out);
|
||||||
|
else Mult(_Adag,in,out);
|
||||||
}
|
}
|
||||||
void Mult (std::vector<CoarseMatrix> &A,const CoarseVector &in, CoarseVector &out)
|
void Mult (std::vector<CoarseMatrix> &A,const CoarseVector &in, CoarseVector &out)
|
||||||
{
|
{
|
||||||
@ -343,15 +345,15 @@ public:
|
|||||||
text+=usecond();
|
text+=usecond();
|
||||||
ttot+=usecond();
|
ttot+=usecond();
|
||||||
|
|
||||||
std::cout << GridLogMessage<<"Coarse Mult Aviews "<<tviews<<" us"<<std::endl;
|
std::cout << GridLogPerformance<<"Coarse Mult Aviews "<<tviews<<" us"<<std::endl;
|
||||||
std::cout << GridLogMessage<<"Coarse Mult exch "<<texch<<" us"<<std::endl;
|
std::cout << GridLogPerformance<<"Coarse Mult exch "<<texch<<" us"<<std::endl;
|
||||||
std::cout << GridLogMessage<<"Coarse Mult mult "<<tmult<<" us"<<std::endl;
|
std::cout << GridLogPerformance<<"Coarse Mult mult "<<tmult<<" us"<<std::endl;
|
||||||
std::cout << GridLogMessage<<"Coarse Mult ext "<<text<<" us"<<std::endl;
|
std::cout << GridLogPerformance<<"Coarse Mult ext "<<text<<" us"<<std::endl;
|
||||||
std::cout << GridLogMessage<<"Coarse Mult tot "<<ttot<<" us"<<std::endl;
|
std::cout << GridLogPerformance<<"Coarse Mult tot "<<ttot<<" us"<<std::endl;
|
||||||
std::cout << GridLogMessage<<"Coarse Kernel "<< flops/tmult<<" mflop/s"<<std::endl;
|
std::cout << GridLogPerformance<<"Coarse Kernel "<< flops/tmult<<" mflop/s"<<std::endl;
|
||||||
std::cout << GridLogMessage<<"Coarse Kernel "<< bytes/tmult<<" MB/s"<<std::endl;
|
std::cout << GridLogPerformance<<"Coarse Kernel "<< bytes/tmult<<" MB/s"<<std::endl;
|
||||||
std::cout << GridLogMessage<<"Coarse flops/s "<< flops/ttot<<" mflop/s"<<std::endl;
|
std::cout << GridLogPerformance<<"Coarse flops/s "<< flops/ttot<<" mflop/s"<<std::endl;
|
||||||
std::cout << GridLogMessage<<"Coarse bytes "<< bytes/1e6<<" MB"<<std::endl;
|
std::cout << GridLogPerformance<<"Coarse bytes "<< bytes/1e6<<" MB"<<std::endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
void PopulateAdag(void)
|
void PopulateAdag(void)
|
||||||
@ -412,10 +414,10 @@ public:
|
|||||||
*
|
*
|
||||||
* Where q_k = delta_k . (2*M_PI/global_nb[mu])
|
* Where q_k = delta_k . (2*M_PI/global_nb[mu])
|
||||||
*/
|
*/
|
||||||
void CoarsenOperatorColoured(LinearOperatorBase<Lattice<Fobj> > &linop,
|
void CoarsenOperator(LinearOperatorBase<Lattice<Fobj> > &linop,
|
||||||
Aggregation<Fobj,CComplex,nbasis> & Subspace)
|
Aggregation<Fobj,CComplex,nbasis> & Subspace)
|
||||||
{
|
{
|
||||||
std::cout << GridLogMessage<< "CoarsenMatrixColoured "<< std::endl;
|
std::cout << GridLogMessage<< "GeneralCoarsenMatrix "<< std::endl;
|
||||||
GridBase *grid = FineGrid();
|
GridBase *grid = FineGrid();
|
||||||
|
|
||||||
RealD tproj=0.0;
|
RealD tproj=0.0;
|
||||||
@ -540,7 +542,9 @@ public:
|
|||||||
auto sval = peekSite(_A[p],coor);
|
auto sval = peekSite(_A[p],coor);
|
||||||
}
|
}
|
||||||
|
|
||||||
PopulateAdag();
|
// Only needed if nonhermitian
|
||||||
|
if ( ! hermitian )
|
||||||
|
PopulateAdag();
|
||||||
|
|
||||||
// Need to write something to populate Adag from A
|
// Need to write something to populate Adag from A
|
||||||
ExchangeCoarseLinks();
|
ExchangeCoarseLinks();
|
||||||
|
Loading…
Reference in New Issue
Block a user