mirror of
https://github.com/paboyle/Grid.git
synced 2026-03-27 14:26:10 +00:00
wqMerge branch 'develop' of https://github.com/paboyle/Grid into KS_shifted
This commit is contained in:
@@ -41,7 +41,7 @@ void SimpleConjugateGradient(LinearOperatorBase<Field> &HPDop,const Field &b, Fi
|
||||
return;
|
||||
}
|
||||
}
|
||||
assert(0);
|
||||
GRID_ASSERT(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
* without regression / tests being applied
|
||||
*/
|
||||
|
||||
#include "disable_examples_without_instantiations.h"
|
||||
#ifdef ENABLE_FERMION_INSTANTIATIONS
|
||||
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -115,8 +118,8 @@ void GaussianWallSource(GridParallelRNG &RNG,int tslice,LatticeGaugeField &U,Lat
|
||||
}
|
||||
void SequentialSource(int tslice,Coordinate &mom,LatticePropagator &spectator,LatticePropagator &source)
|
||||
{
|
||||
assert(mom.size()==Nd);
|
||||
assert(mom[Tdir] == 0);
|
||||
GRID_ASSERT(mom.size()==Nd);
|
||||
GRID_ASSERT(mom[Tdir] == 0);
|
||||
|
||||
GridBase * grid = spectator.Grid();
|
||||
|
||||
@@ -310,5 +313,4 @@ int main (int argc, char ** argv)
|
||||
Grid_finalize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
* without regression / tests being applied
|
||||
*/
|
||||
|
||||
#include "disable_examples_without_instantiations.h"
|
||||
#ifdef ENABLE_FERMION_INSTANTIATIONS
|
||||
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -119,8 +122,8 @@ void GaussianWallSource(GridParallelRNG &RNG,int tslice,LatticeGaugeField &U,Lat
|
||||
}
|
||||
void SequentialSource(int tslice,Coordinate &mom,LatticePropagator &spectator,LatticePropagator &source)
|
||||
{
|
||||
assert(mom.size()==Nd);
|
||||
assert(mom[Tdir] == 0);
|
||||
GRID_ASSERT(mom.size()==Nd);
|
||||
GRID_ASSERT(mom[Tdir] == 0);
|
||||
|
||||
GridBase * grid = spectator.Grid();
|
||||
|
||||
@@ -432,5 +435,4 @@ int main (int argc, char ** argv)
|
||||
Grid_finalize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -65,13 +65,12 @@
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
|
||||
<<<<<<< HEAD
|
||||
namespace Grid {
|
||||
|
||||
struct LanczosParameters: Serializable {
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LanczosParameters,
|
||||
RealD, mass ,
|
||||
RealD, mstep ,
|
||||
RealD, mass ,
|
||||
RealD, mstep ,
|
||||
Integer, Nstop,
|
||||
Integer, Nk,
|
||||
Integer, Np,
|
||||
@@ -90,7 +89,7 @@ struct LanczosParameters: Serializable {
|
||||
initialize(TheReader);
|
||||
}
|
||||
|
||||
template < class ReaderClass >
|
||||
template < class ReaderClass >
|
||||
void initialize(Reader<ReaderClass> &TheReader){
|
||||
read(TheReader, "HMC", *this);
|
||||
}
|
||||
@@ -104,38 +103,36 @@ struct LanczosParameters: Serializable {
|
||||
// std::cout << GridLogMessage << "[HMC parameters] Starting type : " << StartingType << "\n";
|
||||
// MD.print_parameters();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
=======
|
||||
template <class T> void writeFile(T& in, std::string const fname){
|
||||
#ifdef HAVE_LIME
|
||||
// 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); // Lexico
|
||||
WR.close();
|
||||
#endif
|
||||
template <class T> void writeFile(T& in, std::string const fname){
|
||||
#ifdef HAVE_LIME
|
||||
// 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); // Lexico
|
||||
WR.close();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the eigensystem of a Krylov Schur object to a directory.
|
||||
*
|
||||
* Writes the eigensystem of a Krylov Schur object to a directory.
|
||||
*
|
||||
* Parameters
|
||||
* ----------
|
||||
* std::string path
|
||||
* Directory to write to.
|
||||
* Directory to write to.
|
||||
*/
|
||||
template <class Field>
|
||||
void writeEigensystem(KrylovSchur<Field> KS, std::string outDir) {
|
||||
int Nk = KS.getNk();
|
||||
std::cout << GridLogMessage << "Writing output to directory: " << outDir << std::endl;
|
||||
|
||||
|
||||
// Write evals
|
||||
std::string evalPath = outDir + "/evals.txt";
|
||||
std::ofstream fEval;
|
||||
@@ -148,7 +145,7 @@ void writeEigensystem(KrylovSchur<Field> KS, std::string outDir) {
|
||||
if (i < Nk - 1) { fEval << "\n"; }
|
||||
}
|
||||
fEval.close();
|
||||
|
||||
|
||||
// Write evecs (TODO: very heavy on storage costs! Don't write them all out)
|
||||
// std::vector<Field> evecs = KS.getEvecs();
|
||||
// for (int i = 0; i < Nk; i++) {
|
||||
@@ -156,8 +153,6 @@ void writeEigensystem(KrylovSchur<Field> KS, std::string outDir) {
|
||||
// writeFile(evecs[i], fName); // using method from Grid/HMC/ComputeWilsonFlow.cc
|
||||
// }
|
||||
}
|
||||
|
||||
>>>>>>> 68af1bba67dd62881ead5ab1e54962a5486a0791
|
||||
// Hermitize a DWF operator by squaring it
|
||||
template<class Matrix,class Field>
|
||||
class SquaredLinearOperator : public LinearOperatorBase<Field> {
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
* without regression / tests being applied
|
||||
*/
|
||||
|
||||
#include "disable_examples_without_instantiations.h"
|
||||
#ifdef ENABLE_FERMION_INSTANTIATIONS
|
||||
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -157,8 +160,8 @@ void GaussianWallSource(GridParallelRNG &RNG,int tslice,LatticeGaugeField &U,Lat
|
||||
}
|
||||
void SequentialSource(int tslice,Coordinate &mom,LatticePropagator &spectator,LatticePropagator &source)
|
||||
{
|
||||
assert(mom.size()==Nd);
|
||||
assert(mom[Tdir] == 0);
|
||||
GRID_ASSERT(mom.size()==Nd);
|
||||
GRID_ASSERT(mom[Tdir] == 0);
|
||||
|
||||
GridBase * grid = spectator.Grid();
|
||||
|
||||
@@ -331,7 +334,7 @@ void WallSinkMesonTrace(std::string file,std::vector<Propagator> &q1,std::vector
|
||||
int make_idx(int p, int m,int nmom)
|
||||
{
|
||||
if (m==0) return p;
|
||||
assert(p==0);
|
||||
GRID_ASSERT(p==0);
|
||||
return nmom + m - 1;
|
||||
}
|
||||
|
||||
@@ -535,5 +538,4 @@ int main (int argc, char ** argv)
|
||||
Grid_finalize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
* without regression / tests being applied
|
||||
*/
|
||||
|
||||
#include "disable_examples_without_instantiations.h"
|
||||
#ifdef ENABLE_FERMION_INSTANTIATIONS
|
||||
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -157,8 +160,8 @@ void GaussianWallSource(GridParallelRNG &RNG,int tslice,LatticeGaugeField &U,Lat
|
||||
}
|
||||
void SequentialSource(int tslice,Coordinate &mom,LatticePropagator &spectator,LatticePropagator &source)
|
||||
{
|
||||
assert(mom.size()==Nd);
|
||||
assert(mom[Tdir] == 0);
|
||||
GRID_ASSERT(mom.size()==Nd);
|
||||
GRID_ASSERT(mom[Tdir] == 0);
|
||||
|
||||
GridBase * grid = spectator.Grid();
|
||||
|
||||
@@ -429,5 +432,4 @@ int main (int argc, char ** argv)
|
||||
Grid_finalize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
14
examples/disable_examples_without_instantiations.h
Normal file
14
examples/disable_examples_without_instantiations.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILD_FERMION_INSTANTIATIONS
|
||||
#include <iostream>
|
||||
|
||||
int main(void) {
|
||||
std::cout << "This build of Grid was configured to exclude fermion instantiations, "
|
||||
<< "which this example relies on. "
|
||||
<< "Please reconfigure and rebuild Grid with --enable-fermion-instantiations"
|
||||
<< "to run this example."
|
||||
<< std::endl;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user