1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

first tesseract test

This commit is contained in:
ferben 2019-02-25 11:18:25 +00:00
parent cad26a736e
commit 76b6e8a01e
4 changed files with 133 additions and 50 deletions

View File

@ -0,0 +1,7 @@
#include <Hadrons/Modules/MDistil/g5_multiply.hpp>
using namespace Grid;
using namespace Hadrons;
using namespace MDistil;
template class Grid::Hadrons::MDistil::Tg5_multiply<FIMPL>;

View File

@ -0,0 +1,121 @@
#ifndef Hadrons_MDistil_g5_multiply_hpp_
#define Hadrons_MDistil_g5_multiply_hpp_
#include <Hadrons/Global.hpp>
#include <Hadrons/Module.hpp>
#include <Hadrons/ModuleFactory.hpp>
#include <Hadrons/Solver.hpp>
#include <Hadrons/EigenPack.hpp>
#include <Hadrons/A2AVectors.hpp>
#include <Hadrons/DilutedNoise.hpp>
// These are members of Distillation
#include <Hadrons/Modules/MDistil/Distil.hpp>
BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* g5_multiply *
******************************************************************************/
BEGIN_MODULE_NAMESPACE(MDistil)
class g5_multiplyPar: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(g5_multiplyPar,
std::string, input,
int, nnoise,
int, LI,
int, Ns,
int, Nt_inv);
};
template <typename FImpl>
class Tg5_multiply: public Module<g5_multiplyPar>
{
public:
FERM_TYPE_ALIASES(FImpl,);
public:
// constructor
Tg5_multiply(const std::string name);
// destructor
virtual ~Tg5_multiply(void) {};
// dependency relation
virtual std::vector<std::string> getInput(void);
virtual std::vector<std::string> getOutput(void);
// setup
virtual void setup(void);
// execution
virtual void execute(void);
};
MODULE_REGISTER_TMP(g5_multiply, Tg5_multiply<FIMPL>, MDistil);
/******************************************************************************
* Tg5_multiply implementation *
******************************************************************************/
// constructor /////////////////////////////////////////////////////////////////
template <typename FImpl>
Tg5_multiply<FImpl>::Tg5_multiply(const std::string name)
: Module<g5_multiplyPar>(name)
{}
// dependencies/products ///////////////////////////////////////////////////////
template <typename FImpl>
std::vector<std::string> Tg5_multiply<FImpl>::getInput(void)
{
std::vector<std::string> in;
in.push_back(par().input);
return in;
}
template <typename FImpl>
std::vector<std::string> Tg5_multiply<FImpl>::getOutput(void)
{
std::vector<std::string> out = {getName()};
return out;
}
// setup ///////////////////////////////////////////////////////////////////////
template <typename FImpl>
void Tg5_multiply<FImpl>::setup(void)
{
int nnoise=par().nnoise;
int LI=par().LI;
int Ns=par().Ns;
int Nt_inv=par().Nt_inv;
envCreate(std::vector<FermionField>, getName(), 1,
nnoise*LI*Ns*Nt_inv, envGetGrid(FermionField));
}
// execution ///////////////////////////////////////////////////////////////////
template <typename FImpl>
void Tg5_multiply<FImpl>::execute(void)
{
auto &input_vector = envGet(std::vector<FermionField>, par().input);
auto &output_vector = envGet(std::vector<FermionField>, getName());
Gamma g5(Gamma::Algebra::Gamma5);
int nnoise=par().nnoise;
int LI=par().LI;
int Ns=par().Ns;
int Nt_inv=par().Nt_inv;
int Ntot = nnoise*LI*Ns*Nt_inv;
for (int i =0; i<Ntot;i++){
output_vector[i] = g5*input_vector[i];
}
}
END_MODULE_NAMESPACE
END_HADRONS_NAMESPACE
#endif // Hadrons_MDistil_g5_multiply_hpp_

View File

@ -334,6 +334,7 @@ void test_Aslash(Application &application)
// DistilVectors parameters
MContraction::A2AAslashField::Par A2AAslashFieldPar;
A2AAslashFieldPar.left="g5phi";
//A2AAslashFieldPar.right="DistilVecs_phi";
A2AAslashFieldPar.right="Peramb_unsmeared_sink";
A2AAslashFieldPar.output="unsmeared_Aslash";
A2AAslashFieldPar.emField={"Em"};
@ -802,7 +803,6 @@ int main(int argc, char *argv[])
test_Perambulators( application );
test_DistilVectors( application );
test_MesonField( application );
test_MesonFieldRho( application );
break;
case 9: // 3
test_Global( application );

View File

@ -731,63 +731,18 @@ int main(int argc, char *argv[])
//const unsigned int nt = GridDefaultLatt()[Tp];
switch(iTestNum) {
case 1:
test_Global( application );
test_LapEvec( application );
break;
case 2:
test_Global( application );
test_LapEvec( application );
test_Perambulators( application );
break;
case 3: // 3
test_Global( application );
test_LapEvec( application );
test_Perambulators( application );
test_DistilVectors( application );
break;
default: // 4
test_Global( application );
test_LapEvec( application );
test_Perambulators( application );
test_DistilVectors( application );
test_MesonField( application );
break;
case 5: // 3
test_Global( application );
test_LapEvec( application );
test_Perambulators( application );
test_DistilVectors( application );
test_PerambulatorsS( application );
test_DistilVectorsS( application );
test_MesonFieldSL( application );
break;
case 6: // 3
default:
test_Global( application );
test_LapEvec( application );
test_Perambulators( application );
test_MesonSink( application );
break;
case 7: // 3
test_Global( application );
test_LapEvec( application );
test_Perambulators( application );
test_DistilVectors( application );
test_BaryonFieldPhi( application );
test_BaryonFieldRho( application );
break;
case 8: // 3
test_Global( application );
test_LapEvec( application );
test_Perambulators( application );
test_g5_sinks( application );
test_em( application );
test_Aslash( application );
test_DistilVectors( application );
test_MesonField( application );
test_MesonFieldRho( application );
break;
case 9: // 3
test_Global( application );
test_Baryon2pt( application );
break;
}
LOG(Message) << "====== XML creation for test " << iTestNum << " complete ======" << std::endl;