mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Roll over to MPI version of I/O
This commit is contained in:
parent
1a1f6d55f9
commit
4b98e524a0
@ -38,10 +38,13 @@ int main (int argc, char ** argv)
|
|||||||
{
|
{
|
||||||
Grid_init(&argc,&argv);
|
Grid_init(&argc,&argv);
|
||||||
|
|
||||||
|
std::cout <<GridLogMessage<< " main "<<std::endl;
|
||||||
|
|
||||||
std::vector<int> simd_layout = GridDefaultSimd(4,vComplex::Nsimd());
|
std::vector<int> simd_layout = GridDefaultSimd(4,vComplex::Nsimd());
|
||||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||||
std::vector<int> latt_size ({16,16,16,16});
|
std::vector<int> latt_size ({48,48,48,96});
|
||||||
|
//std::vector<int> latt_size ({32,32,32,32});
|
||||||
|
//std::vector<int> latt_size ({16,16,16,32});
|
||||||
std::vector<int> clatt_size ({4,4,4,8});
|
std::vector<int> clatt_size ({4,4,4,8});
|
||||||
int orthodir=3;
|
int orthodir=3;
|
||||||
int orthosz =latt_size[orthodir];
|
int orthosz =latt_size[orthodir];
|
||||||
@ -49,14 +52,17 @@ int main (int argc, char ** argv)
|
|||||||
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
||||||
GridCartesian Coarse(clatt_size,simd_layout,mpi_layout);
|
GridCartesian Coarse(clatt_size,simd_layout,mpi_layout);
|
||||||
|
|
||||||
|
|
||||||
GridParallelRNG pRNGa(&Fine);
|
GridParallelRNG pRNGa(&Fine);
|
||||||
GridParallelRNG pRNGb(&Fine);
|
GridParallelRNG pRNGb(&Fine);
|
||||||
GridSerialRNG sRNGa;
|
GridSerialRNG sRNGa;
|
||||||
GridSerialRNG sRNGb;
|
GridSerialRNG sRNGb;
|
||||||
|
|
||||||
|
std::cout <<GridLogMessage<< " seeding... "<<std::endl;
|
||||||
pRNGa.SeedFixedIntegers(std::vector<int>({45,12,81,9}));
|
pRNGa.SeedFixedIntegers(std::vector<int>({45,12,81,9}));
|
||||||
sRNGa.SeedFixedIntegers(std::vector<int>({45,12,81,9}));
|
sRNGa.SeedFixedIntegers(std::vector<int>({45,12,81,9}));
|
||||||
|
std::cout <<GridLogMessage<< " ...done "<<std::endl;
|
||||||
|
|
||||||
std::string rfile("./ckpoint_rng.4000");
|
std::string rfile("./ckpoint_rng.4000");
|
||||||
NerscIO::writeRNGState(sRNGa,pRNGa,rfile);
|
NerscIO::writeRNGState(sRNGa,pRNGa,rfile);
|
||||||
NerscField rngheader;
|
NerscField rngheader;
|
||||||
@ -65,14 +71,13 @@ int main (int argc, char ** argv)
|
|||||||
LatticeComplex tmpa(&Fine); random(pRNGa,tmpa);
|
LatticeComplex tmpa(&Fine); random(pRNGa,tmpa);
|
||||||
LatticeComplex tmpb(&Fine); random(pRNGb,tmpb);
|
LatticeComplex tmpb(&Fine); random(pRNGb,tmpb);
|
||||||
tmpa = tmpa - tmpb;
|
tmpa = tmpa - tmpb;
|
||||||
std::cout << " difference between restored randoms and orig "<<norm2( tmpa ) <<" / "<< norm2(tmpb)<<std::endl;
|
std::cout <<GridLogMessage<< " difference between restored randoms and orig "<<norm2( tmpa ) <<" / "<< norm2(tmpb)<<std::endl;
|
||||||
|
|
||||||
ComplexD a,b;
|
ComplexD a,b;
|
||||||
|
|
||||||
random(sRNGa,a);
|
random(sRNGa,a);
|
||||||
random(sRNGb,b);
|
random(sRNGb,b);
|
||||||
std::cout << " serial RNG numbers "<<a<<" "<<b<<std::endl;
|
std::cout <<GridLogMessage<< " serial RNG numbers "<<a<<" "<<b<<std::endl;
|
||||||
|
|
||||||
|
|
||||||
LatticeGaugeField Umu(&Fine);
|
LatticeGaugeField Umu(&Fine);
|
||||||
LatticeGaugeField Umu_diff(&Fine);
|
LatticeGaugeField Umu_diff(&Fine);
|
||||||
@ -93,7 +98,7 @@ int main (int argc, char ** argv)
|
|||||||
Umu_diff = Umu - Umu_saved;
|
Umu_diff = Umu - Umu_saved;
|
||||||
//std::cout << "Umu_save "<<Umu_saved[0]<<std::endl;
|
//std::cout << "Umu_save "<<Umu_saved[0]<<std::endl;
|
||||||
//std::cout << "Umu_read "<<Umu[0]<<std::endl;
|
//std::cout << "Umu_read "<<Umu[0]<<std::endl;
|
||||||
std::cout << "norm2 Gauge Diff = "<<norm2(Umu_diff)<<std::endl;
|
std::cout <<GridLogMessage<< "norm2 Gauge Diff = "<<norm2(Umu_diff)<<std::endl;
|
||||||
|
|
||||||
for(int mu=0;mu<Nd;mu++){
|
for(int mu=0;mu<Nd;mu++){
|
||||||
U[mu] = PeekIndex<LorentzIndex>(Umu,mu);
|
U[mu] = PeekIndex<LorentzIndex>(Umu,mu);
|
||||||
@ -120,7 +125,6 @@ int main (int argc, char ** argv)
|
|||||||
#endif
|
#endif
|
||||||
double vol = Fine.gSites();
|
double vol = Fine.gSites();
|
||||||
Complex PlaqScale(1.0/vol/6.0/3.0);
|
Complex PlaqScale(1.0/vol/6.0/3.0);
|
||||||
std::cout<<GridLogMessage <<"PlaqScale" << PlaqScale<<std::endl;
|
|
||||||
|
|
||||||
std::vector<TComplex> Plaq_T(orthosz);
|
std::vector<TComplex> Plaq_T(orthosz);
|
||||||
sliceSum(Plaq,Plaq_T,Nd-1);
|
sliceSum(Plaq,Plaq_T,Nd-1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user