1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-13 01:05:36 +00:00

Hadrons: result file macro with trajectory number

This commit is contained in:
Antonin Portelli 2018-01-10 10:59:58 +00:00
parent dd62f2f371
commit 58c7a13d54
10 changed files with 24 additions and 12 deletions

View File

@ -67,3 +67,10 @@ std::string Hadrons::typeName(const std::type_info *info)
return name; return name;
} }
// default writers/readers /////////////////////////////////////////////////////
#ifdef HAVE_HDF5
const std::string Hadrons::resultFileExt = "h5";
#else
const std::string Hadrons::resultFileExt = "xml";
#endif

View File

@ -167,14 +167,19 @@ std::string typeName(void)
} }
// default writers/readers // default writers/readers
extern const std::string resultFileExt;
#ifdef HAVE_HDF5 #ifdef HAVE_HDF5
typedef Hdf5Reader CorrReader; typedef Hdf5Reader ResultReader;
typedef Hdf5Writer CorrWriter; typedef Hdf5Writer ResultWriter;
#else #else
typedef XmlReader CorrReader; typedef XmlReader ResultReader;
typedef XmlWriter CorrWriter; typedef XmlWriter ResultWriter;
#endif #endif
#define RESULT_FILE_NAME(name) \
name + "." + std::to_string(vm().getTrajectory()) + "." + resultFileExt
END_HADRONS_NAMESPACE END_HADRONS_NAMESPACE
#include <Grid/Hadrons/Exceptions.hpp> #include <Grid/Hadrons/Exceptions.hpp>

View File

@ -122,7 +122,7 @@ void TBaryon<FImpl1, FImpl2, FImpl3>::execute(void)
<< " quarks '" << par().q1 << "', '" << par().q2 << "', and '" << " quarks '" << par().q1 << "', '" << par().q2 << "', and '"
<< par().q3 << "'" << std::endl; << par().q3 << "'" << std::endl;
CorrWriter writer(par().output); ResultWriter writer(RESULT_FILE_NAME(par().output));
auto &q1 = envGet(PropagatorField1, par().q1); auto &q1 = envGet(PropagatorField1, par().q1);
auto &q2 = envGet(PropagatorField2, par().q2); auto &q2 = envGet(PropagatorField2, par().q2);
auto &q3 = envGet(PropagatorField3, par().q2); auto &q3 = envGet(PropagatorField3, par().q2);

View File

@ -119,7 +119,7 @@ void TDiscLoop<FImpl>::execute(void)
<< "' using '" << par().q_loop << "' with " << par().gamma << "' using '" << par().q_loop << "' with " << par().gamma
<< " insertion." << std::endl; << " insertion." << std::endl;
CorrWriter writer(par().output); ResultWriter writer(RESULT_FILE_NAME(par().output));
auto &q_loop = envGet(PropagatorField, par().q_loop); auto &q_loop = envGet(PropagatorField, par().q_loop);
Gamma gamma(par().gamma); Gamma gamma(par().gamma);
std::vector<TComplex> buf; std::vector<TComplex> buf;

View File

@ -153,7 +153,7 @@ void TGamma3pt<FImpl1, FImpl2, FImpl3>::execute(void)
// Initialise variables. q2 and q3 are normal propagators, q1 may be // Initialise variables. q2 and q3 are normal propagators, q1 may be
// sink smeared. // sink smeared.
CorrWriter writer(par().output); ResultWriter writer(RESULT_FILE_NAME(par().output));
auto &q1 = envGet(SlicedPropagator1, par().q1); auto &q1 = envGet(SlicedPropagator1, par().q1);
auto &q2 = envGet(PropagatorField2, par().q2); auto &q2 = envGet(PropagatorField2, par().q2);
auto &q3 = envGet(PropagatorField2, par().q3); auto &q3 = envGet(PropagatorField2, par().q3);

View File

@ -172,7 +172,7 @@ void TMeson<FImpl1, FImpl2>::execute(void)
<< " quarks '" << par().q1 << "' and '" << par().q2 << "'" << " quarks '" << par().q1 << "' and '" << par().q2 << "'"
<< std::endl; << std::endl;
CorrWriter writer(par().output); ResultWriter writer(RESULT_FILE_NAME(par().output));
std::vector<TComplex> buf; std::vector<TComplex> buf;
std::vector<Result> result; std::vector<Result> result;
Gamma g5(Gamma::Algebra::Gamma5); Gamma g5(Gamma::Algebra::Gamma5);

View File

@ -104,7 +104,7 @@ void TWeakHamiltonianEye::execute(void)
<< par().q2 << ", '" << par().q3 << "' and '" << par().q4 << par().q2 << ", '" << par().q3 << "' and '" << par().q4
<< "'." << std::endl; << "'." << std::endl;
CorrWriter writer(par().output); ResultWriter writer(RESULT_FILE_NAME(par().output));
auto &q1 = envGet(SlicedPropagator, par().q1); auto &q1 = envGet(SlicedPropagator, par().q1);
auto &q2 = envGet(PropagatorField, par().q2); auto &q2 = envGet(PropagatorField, par().q2);
auto &q3 = envGet(PropagatorField, par().q3); auto &q3 = envGet(PropagatorField, par().q3);

View File

@ -104,7 +104,7 @@ void TWeakHamiltonianNonEye::execute(void)
<< par().q2 << ", '" << par().q3 << "' and '" << par().q4 << par().q2 << ", '" << par().q3 << "' and '" << par().q4
<< "'." << std::endl; << "'." << std::endl;
CorrWriter writer(par().output); ResultWriter writer(RESULT_FILE_NAME(par().output));
auto &q1 = envGet(PropagatorField, par().q1); auto &q1 = envGet(PropagatorField, par().q1);
auto &q2 = envGet(PropagatorField, par().q2); auto &q2 = envGet(PropagatorField, par().q2);
auto &q3 = envGet(PropagatorField, par().q3); auto &q3 = envGet(PropagatorField, par().q3);

View File

@ -104,7 +104,7 @@ void TWeakNeutral4ptDisc::execute(void)
<< par().q2 << ", '" << par().q3 << "' and '" << par().q4 << par().q2 << ", '" << par().q3 << "' and '" << par().q4
<< "'." << std::endl; << "'." << std::endl;
CorrWriter writer(par().output); ResultWriter writer(RESULT_FILE_NAME(par().output));
auto &q1 = envGet(PropagatorField, par().q1); auto &q1 = envGet(PropagatorField, par().q1);
auto &q2 = envGet(PropagatorField, par().q2); auto &q2 = envGet(PropagatorField, par().q2);
auto &q3 = envGet(PropagatorField, par().q3); auto &q3 = envGet(PropagatorField, par().q3);

View File

@ -133,7 +133,7 @@ void TChargedProp::execute(void)
LOG(Message) << "Saving zero-momentum projection to '" LOG(Message) << "Saving zero-momentum projection to '"
<< filename << "'..." << std::endl; << filename << "'..." << std::endl;
CorrWriter writer(filename); ResultWriter writer(RESULT_FILE_NAME(par().output));
std::vector<TComplex> vecBuf; std::vector<TComplex> vecBuf;
std::vector<Complex> result; std::vector<Complex> result;