mirror of
https://github.com/paboyle/Grid.git
synced 2025-11-20 06:29:31 +00:00
Compare commits
5 Commits
hotfix/unw
...
2bf9179d2c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bf9179d2c | ||
|
|
c606f5dca0 | ||
|
|
8419cc5c64 | ||
|
|
2cc6deb8e0 | ||
|
|
19d0590579 |
@@ -28,6 +28,11 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
|||||||
/* END LEGAL */
|
/* END LEGAL */
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef MIN
|
||||||
|
#define MIN(x,y) ((x)>(y)?(y):(x))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// Introduce a class to gain deterministic bit reproducible reduction.
|
// Introduce a class to gain deterministic bit reproducible reduction.
|
||||||
// make static; perhaps just a namespace is required.
|
// make static; perhaps just a namespace is required.
|
||||||
NAMESPACE_BEGIN(Grid);
|
NAMESPACE_BEGIN(Grid);
|
||||||
|
|||||||
@@ -873,7 +873,7 @@ int main (int argc, char ** argv)
|
|||||||
int do_su4=0;
|
int do_su4=0;
|
||||||
int do_memory=1;
|
int do_memory=1;
|
||||||
int do_comms =1;
|
int do_comms =1;
|
||||||
int do_blas =1;
|
int do_blas =0;
|
||||||
int do_dslash=1;
|
int do_dslash=1;
|
||||||
|
|
||||||
int sel=4;
|
int sel=4;
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<grid>
|
<grid>
|
||||||
<LanczosParameters>
|
<LanczosParameters>
|
||||||
<mass>0.00107</mass>
|
<mass>-1.025</mass>
|
||||||
|
<mstep>-0.025</mstep>
|
||||||
<M5>1.8</M5>
|
<M5>1.8</M5>
|
||||||
<Ls>48</Ls>
|
<Ls>48</Ls>
|
||||||
<Nstop>10</Nstop>
|
<Nstop>10</Nstop>
|
||||||
<Nk>15</Nk>
|
<Nk>12</Nk>
|
||||||
<Np>85</Np>
|
<Np>30</Np>
|
||||||
<ChebyLow>0.003</ChebyLow>
|
<ChebyLow>0.1</ChebyLow>
|
||||||
<ChebyHigh>60</ChebyHigh>
|
<ChebyHigh>50</ChebyHigh>
|
||||||
<ChebyOrder>201</ChebyOrder>
|
<ChebyOrder>51</ChebyOrder>
|
||||||
</LanczosParameters>
|
</LanczosParameters>
|
||||||
</grid>
|
</grid>
|
||||||
|
|||||||
@@ -33,9 +33,13 @@ using namespace std;
|
|||||||
using namespace Grid;
|
using namespace Grid;
|
||||||
;
|
;
|
||||||
|
|
||||||
//typedef WilsonFermionD FermionOp;
|
#if 0
|
||||||
typedef DomainWallFermionD FermionOp;
|
typedef DomainWallFermionD FermionOp;
|
||||||
typedef typename DomainWallFermionD::FermionField FermionField;
|
typedef typename DomainWallFermionD::FermionField FermionField;
|
||||||
|
#else
|
||||||
|
typedef MobiusFermionD FermionOp;
|
||||||
|
typedef typename MobiusFermionD::FermionField FermionField;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
RealD AllZero(RealD x) { return 0.; }
|
RealD AllZero(RealD x) { return 0.; }
|
||||||
@@ -170,10 +174,11 @@ int main(int argc, char** argv) {
|
|||||||
int Nm = Nk + Np;
|
int Nm = Nk + Np;
|
||||||
int MaxIt = 10000;
|
int MaxIt = 10000;
|
||||||
RealD resid = 1.0e-5;
|
RealD resid = 1.0e-5;
|
||||||
|
RealD mob_b=1.5;
|
||||||
|
|
||||||
//while ( mass > - 5.0){
|
//while ( mass > - 5.0){
|
||||||
FermionOp Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
|
// FermionOp Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
|
||||||
|
FermionOp Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,mob_b,mob_b-1.);
|
||||||
MdagMLinearOperator<FermionOp,FermionField> HermOp(Ddwf); /// <-----
|
MdagMLinearOperator<FermionOp,FermionField> HermOp(Ddwf); /// <-----
|
||||||
// Gamma5HermitianLinearOperator <FermionOp,LatticeFermion> HermOp2(WilsonOperator); /// <-----
|
// Gamma5HermitianLinearOperator <FermionOp,LatticeFermion> HermOp2(WilsonOperator); /// <-----
|
||||||
Gamma5R5HermitianLinearOperator<FermionOp, LatticeFermion> G5R5Herm(Ddwf);
|
Gamma5R5HermitianLinearOperator<FermionOp, LatticeFermion> G5R5Herm(Ddwf);
|
||||||
|
|||||||
@@ -113,6 +113,9 @@ struct LanczosParameters: Serializable {
|
|||||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LanczosParameters,
|
GRID_SERIALIZABLE_CLASS_MEMBERS(LanczosParameters,
|
||||||
RealD, mass ,
|
RealD, mass ,
|
||||||
RealD, resid,
|
RealD, resid,
|
||||||
|
Integer, Nstop,
|
||||||
|
Integer, Nk,
|
||||||
|
Integer, Np,
|
||||||
RealD, ChebyLow,
|
RealD, ChebyLow,
|
||||||
RealD, ChebyHigh,
|
RealD, ChebyHigh,
|
||||||
Integer, ChebyOrder)
|
Integer, ChebyOrder)
|
||||||
@@ -204,7 +207,6 @@ int main(int argc, char** argv) {
|
|||||||
int Nstop = 5;
|
int Nstop = 5;
|
||||||
int Nk = 10;
|
int Nk = 10;
|
||||||
int Np = 90;
|
int Np = 90;
|
||||||
int Nm = Nk + Np;
|
|
||||||
int MaxIt = 10000;
|
int MaxIt = 10000;
|
||||||
RealD resid = 1.0e-5;
|
RealD resid = 1.0e-5;
|
||||||
|
|
||||||
@@ -226,10 +228,14 @@ int main(int argc, char** argv) {
|
|||||||
XmlWriter HMCwr("LanParams.xml.out");
|
XmlWriter HMCwr("LanParams.xml.out");
|
||||||
write(HMCwr,"LanczosParameters",LanParams);
|
write(HMCwr,"LanczosParameters",LanParams);
|
||||||
}
|
}
|
||||||
|
Nstop=LanParams.Nstop;
|
||||||
|
Nk=LanParams.Nk;
|
||||||
|
Np=LanParams.Np;
|
||||||
mass=LanParams.mass;
|
mass=LanParams.mass;
|
||||||
resid=LanParams.resid;
|
resid=LanParams.resid;
|
||||||
|
|
||||||
|
int Nm = Nk + Np;
|
||||||
|
|
||||||
|
|
||||||
while ( mass > - 5.0){
|
while ( mass > - 5.0){
|
||||||
FermionOp WilsonOperator(Umu,*FGrid,*FrbGrid,2.+mass);
|
FermionOp WilsonOperator(Umu,*FGrid,*FrbGrid,2.+mass);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ directory
|
|||||||
*************************************************************************************/
|
*************************************************************************************/
|
||||||
/* END LEGAL */
|
/* END LEGAL */
|
||||||
#include <Grid/Grid.h>
|
#include <Grid/Grid.h>
|
||||||
|
#include <Grid/parallelIO/IldgIOtypes.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Grid;
|
using namespace Grid;
|
||||||
@@ -38,11 +39,29 @@ typedef typename WilsonFermionD::FermionField FermionField;
|
|||||||
|
|
||||||
RealD AllZero(RealD x) { return 0.; }
|
RealD AllZero(RealD x) { return 0.; }
|
||||||
|
|
||||||
|
template <class T> void writeFile(T& in, std::string const fname){
|
||||||
|
#if 1
|
||||||
|
// Ref: https://github.com/paboyle/Grid/blob/feature/scidac-wp1/tests/debug/Test_general_coarse_hdcg_phys48.cc#L111
|
||||||
|
std::cout << Grid::GridLogMessage << "Writes to: " << fname << std::endl;
|
||||||
|
Grid::emptyUserRecord record;
|
||||||
|
Grid::ScidacWriter WR(in.Grid()->IsBoss());
|
||||||
|
WR.open(fname);
|
||||||
|
WR.writeScidacFieldRecord(in,record,0);
|
||||||
|
WR.close();
|
||||||
|
#endif
|
||||||
|
// What is the appropriate way to throw error?
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace Grid {
|
namespace Grid {
|
||||||
|
|
||||||
struct LanczosParameters: Serializable {
|
struct LanczosParameters: Serializable {
|
||||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LanczosParameters,
|
GRID_SERIALIZABLE_CLASS_MEMBERS(LanczosParameters,
|
||||||
RealD, mass ,
|
RealD, mass ,
|
||||||
|
RealD, mstep ,
|
||||||
|
Integer, Nstop,
|
||||||
|
Integer, Nk,
|
||||||
|
Integer, Np,
|
||||||
RealD, ChebyLow,
|
RealD, ChebyLow,
|
||||||
RealD, ChebyHigh,
|
RealD, ChebyHigh,
|
||||||
Integer, ChebyOrder)
|
Integer, ChebyOrder)
|
||||||
@@ -158,10 +177,19 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mass=LanParams.mass;
|
mass=LanParams.mass;
|
||||||
|
Nstop=LanParams.Nstop;
|
||||||
|
Nk=LanParams.Nk;
|
||||||
|
Np=LanParams.Np;
|
||||||
|
Nm = Nk + Np;
|
||||||
|
|
||||||
|
FermionField src(FGrid);
|
||||||
|
gaussian(RNG5, src);
|
||||||
|
std::vector<Complex> boundary = {1,1,1,-1};
|
||||||
|
FermionOp::ImplParams Params(boundary);
|
||||||
|
|
||||||
|
|
||||||
while ( mass > - 5.0){
|
while ( mass > - 2.5){
|
||||||
FermionOp WilsonOperator(Umu,*FGrid,*FrbGrid,mass);
|
FermionOp WilsonOperator(Umu,*FGrid,*FrbGrid,mass,Params);
|
||||||
MdagMLinearOperator<FermionOp,FermionField> HermOp(WilsonOperator); /// <-----
|
MdagMLinearOperator<FermionOp,FermionField> HermOp(WilsonOperator); /// <-----
|
||||||
//SchurDiagTwoOperator<FermionOp,FermionField> HermOp(WilsonOperator);
|
//SchurDiagTwoOperator<FermionOp,FermionField> HermOp(WilsonOperator);
|
||||||
Gamma5HermitianLinearOperator <FermionOp,LatticeFermion> HermOp2(WilsonOperator); /// <-----
|
Gamma5HermitianLinearOperator <FermionOp,LatticeFermion> HermOp2(WilsonOperator); /// <-----
|
||||||
@@ -182,8 +210,6 @@ while ( mass > - 5.0){
|
|||||||
ImplicitlyRestartedLanczos<FermionField> IRL(OpCheby, Op2, Nstop, Nk, Nm, resid, MaxIt);
|
ImplicitlyRestartedLanczos<FermionField> IRL(OpCheby, Op2, Nstop, Nk, Nm, resid, MaxIt);
|
||||||
|
|
||||||
std::vector<RealD> eval(Nm);
|
std::vector<RealD> eval(Nm);
|
||||||
FermionField src(FGrid);
|
|
||||||
gaussian(RNG5, src);
|
|
||||||
std::vector<FermionField> evec(Nm, FGrid);
|
std::vector<FermionField> evec(Nm, FGrid);
|
||||||
for (int i = 0; i < 1; i++) {
|
for (int i = 0; i < 1; i++) {
|
||||||
std::cout << i << " / " << Nm << " grid pointer " << evec[i].Grid()
|
std::cout << i << " / " << Nm << " grid pointer " << evec[i].Grid()
|
||||||
@@ -202,9 +228,17 @@ while ( mass > - 5.0){
|
|||||||
tmp = g5*evec[i];
|
tmp = g5*evec[i];
|
||||||
dot = innerProduct(tmp,evec[i]);
|
dot = innerProduct(tmp,evec[i]);
|
||||||
std::cout << mass << " : " << eval[i] << " " << real(dot) << " " << imag(dot) << std::endl ;
|
std::cout << mass << " : " << eval[i] << " " << real(dot) << " " << imag(dot) << std::endl ;
|
||||||
|
// if ( i<1)
|
||||||
|
{
|
||||||
|
std::string evfile ("./evec_"+std::to_string(mass)+"_"+std::to_string(i));
|
||||||
|
auto evdensity = localInnerProduct(evec[i],evec[i] );
|
||||||
|
writeFile(evdensity,evfile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
src = evec[0]+evec[1]+evec[2];
|
src = evec[0]+evec[1]+evec[2];
|
||||||
mass += -0.1;
|
src += evec[3]+evec[4]+evec[5];
|
||||||
|
src += evec[6]+evec[7]+evec[8];
|
||||||
|
mass += LanParams.mstep;
|
||||||
}
|
}
|
||||||
|
|
||||||
Grid_finalize();
|
Grid_finalize();
|
||||||
|
|||||||
Reference in New Issue
Block a user