mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
Integrator verbosity updates
This commit is contained in:
parent
d416156c16
commit
e1124d9572
@ -54,7 +54,7 @@ public:
|
|||||||
|
|
||||||
template <class ReaderClass, typename std::enable_if<isReader<ReaderClass>::value, int >::type = 0 >
|
template <class ReaderClass, typename std::enable_if<isReader<ReaderClass>::value, int >::type = 0 >
|
||||||
IntegratorParameters(ReaderClass & Reader){
|
IntegratorParameters(ReaderClass & Reader){
|
||||||
std::cout << "Reading integrator\n";
|
std::cout << GridLogMessage << "Reading integrator\n";
|
||||||
read(Reader, "Integrator", *this);
|
read(Reader, "Integrator", *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ class Integrator {
|
|||||||
double end_full = usecond();
|
double end_full = usecond();
|
||||||
double time_full = (end_full - start_full) / 1e3;
|
double time_full = (end_full - start_full) / 1e3;
|
||||||
double time_force = (end_force - start_force) / 1e3;
|
double time_force = (end_force - start_force) / 1e3;
|
||||||
std::cout << GridLogIntegrator << "["<<level<<"]["<<a<<"] P update elapsed time: " << time_full << " ms (force: " << time_force << " ms)" << std::endl;
|
std::cout << GridLogMessage << "["<<level<<"]["<<a<<"] P update elapsed time: " << time_full << " ms (force: " << time_force << " ms)" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force from the other representations
|
// Force from the other representations
|
||||||
@ -237,8 +237,7 @@ class Integrator {
|
|||||||
for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
|
for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
|
||||||
// get gauge field from the SmearingPolicy and
|
// get gauge field from the SmearingPolicy and
|
||||||
// based on the boolean is_smeared in actionID
|
// based on the boolean is_smeared in actionID
|
||||||
Field& Us =
|
Field& Us = Smearer.get_U(as[level].actions.at(actionID)->is_smeared);
|
||||||
Smearer.get_U(as[level].actions.at(actionID)->is_smeared);
|
|
||||||
as[level].actions.at(actionID)->refresh(Us, pRNG);
|
as[level].actions.at(actionID)->refresh(Us, pRNG);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,13 +250,11 @@ class Integrator {
|
|||||||
// over the representations
|
// over the representations
|
||||||
struct _S {
|
struct _S {
|
||||||
template <class FieldType, class Repr>
|
template <class FieldType, class Repr>
|
||||||
void operator()(std::vector<Action<FieldType>*> repr_set, Repr& Rep,
|
void operator()(std::vector<Action<FieldType>*> repr_set, Repr& Rep, int level, RealD& H) {
|
||||||
int level, RealD& H) {
|
|
||||||
|
|
||||||
for (int a = 0; a < repr_set.size(); ++a) {
|
for (int a = 0; a < repr_set.size(); ++a) {
|
||||||
RealD Hterm = repr_set.at(a)->S(Rep.U);
|
RealD Hterm = repr_set.at(a)->S(Rep.U);
|
||||||
std::cout << GridLogMessage << "S Level " << level << " term " << a
|
std::cout << GridLogMessage << "S Level " << level << " term " << a << " H Hirep = " << Hterm << std::endl;
|
||||||
<< " H Hirep = " << Hterm << std::endl;
|
|
||||||
H += Hterm;
|
H += Hterm;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -269,7 +266,7 @@ class Integrator {
|
|||||||
|
|
||||||
|
|
||||||
RealD H = - FieldImplementation::FieldSquareNorm(P)/HMC_MOMENTUM_DENOMINATOR; // - trace (P*P)/denom
|
RealD H = - FieldImplementation::FieldSquareNorm(P)/HMC_MOMENTUM_DENOMINATOR; // - trace (P*P)/denom
|
||||||
std::cout << " Momentum hamiltonian "<< -H<<std::endl;
|
|
||||||
RealD Hterm;
|
RealD Hterm;
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
@ -279,8 +276,7 @@ class Integrator {
|
|||||||
// based on the boolean is_smeared in actionID
|
// based on the boolean is_smeared in actionID
|
||||||
Field& Us = Smearer.get_U(as[level].actions.at(actionID)->is_smeared);
|
Field& Us = Smearer.get_U(as[level].actions.at(actionID)->is_smeared);
|
||||||
Hterm = as[level].actions.at(actionID)->S(Us);
|
Hterm = as[level].actions.at(actionID)->S(Us);
|
||||||
std::cout << GridLogMessage << "S Level " << level << " term "
|
std::cout << GridLogMessage << "S [" << level << "][" << actionID << "] H = " << Hterm << std::endl;
|
||||||
<< actionID << " H = " << Hterm << std::endl;
|
|
||||||
H += Hterm;
|
H += Hterm;
|
||||||
}
|
}
|
||||||
as[level].apply(S_hireps, Representations, level, H);
|
as[level].apply(S_hireps, Representations, level, H);
|
||||||
@ -305,8 +301,7 @@ class Integrator {
|
|||||||
// Check the clocks all match on all levels
|
// Check the clocks all match on all levels
|
||||||
for (int level = 0; level < as.size(); ++level) {
|
for (int level = 0; level < as.size(); ++level) {
|
||||||
assert(fabs(t_U - t_P[level]) < 1.0e-6); // must be the same
|
assert(fabs(t_U - t_P[level]) < 1.0e-6); // must be the same
|
||||||
std::cout << GridLogIntegrator << " times[" << level
|
std::cout << GridLogIntegrator << " times[" << level << "]= " << t_P[level] << " " << t_U << std::endl;
|
||||||
<< "]= " << t_P[level] << " " << t_U << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// and that we indeed got to the end of the trajectory
|
// and that we indeed got to the end of the trajectory
|
||||||
|
@ -231,8 +231,7 @@ class ForceGradient : public Integrator<FieldImplementation, SmearingPolicy,
|
|||||||
Field Pfg(U._grid);
|
Field Pfg(U._grid);
|
||||||
Ufg = U;
|
Ufg = U;
|
||||||
Pfg = zero;
|
Pfg = zero;
|
||||||
std::cout << GridLogIntegrator << "FG update " << fg_dt << " " << ep
|
std::cout << GridLogIntegrator << "FG update " << fg_dt << " " << ep << std::endl;
|
||||||
<< std::endl;
|
|
||||||
// prepare_fg; no prediction/result cache for now
|
// prepare_fg; no prediction/result cache for now
|
||||||
// could relax CG stopping conditions for the
|
// could relax CG stopping conditions for the
|
||||||
// derivatives in the small step since the force gets multiplied by
|
// derivatives in the small step since the force gets multiplied by
|
||||||
@ -271,8 +270,7 @@ class ForceGradient : public Integrator<FieldImplementation, SmearingPolicy,
|
|||||||
this->step(U, level + 1, first_step, 0);
|
this->step(U, level + 1, first_step, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->FG_update_P(U, level, 2 * Chi / ((1.0 - 2.0 * lambda) * eps),
|
this->FG_update_P(U, level, 2 * Chi / ((1.0 - 2.0 * lambda) * eps), (1.0 - 2.0 * lambda) * eps);
|
||||||
(1.0 - 2.0 * lambda) * eps);
|
|
||||||
|
|
||||||
if (level == fl) { // lowest level
|
if (level == fl) { // lowest level
|
||||||
this->update_U(U, 0.5 * eps);
|
this->update_U(U, 0.5 * eps);
|
||||||
|
Loading…
Reference in New Issue
Block a user