Skip to content

Commit

Permalink
Revert "I am adding a functionality to the HMC. For the CLOVERDETRATI…
Browse files Browse the repository at this point in the history
…O monomial, it's now possible to specify a solver for the heatbath, different from the one used in the MD evolution (computation of the forces)."

This reverts commit 583f2ee.
  • Loading branch information
simone-romiti committed Jul 6, 2022
1 parent 583f2ee commit da55dc9
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 71 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ config.status
*.mod.c
*.opari.inc
build/*
build*
tags
*.a
hmc_tm
Expand Down
1 change: 0 additions & 1 deletion default_input_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
#define _default_rlxd_level 1
#define _default_solver_flag 1 // this is CG (see solver/solver_types.h)
#define _default_nd_solver_flag 15 // this is CGMMSND (see solver/solver_types.h)
#define _default_HB_solver_flag 26 // this is INVALID_SOLVER (see solver/solver_types.h)
#define _default_startoption 0
#define _default_Ntherm 0
#define _default_Nmeas 1
Expand Down
10 changes: 5 additions & 5 deletions monomial/cloverdetratio_monomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ void cloverdetratio_heatbath(const int id, hamiltonian_field_t * const hf) {
zero_spinor_field(mnl->pf,VOLUME/2);
tm_stopwatch_pop(&g_timers, 0, 1, "");

if( mnl->HB_solver == MG ){
mnl->iter0 = solve_degenerate(mnl->pf, mnl->w_fields[1], mnl->HB_solver_params, mnl->maxiter, mnl->accprec,
g_relative_precision_flag, VOLUME/2, mnl->Qp, mnl->HB_solver);
if( mnl->solver == MG ){
mnl->iter0 = solve_degenerate(mnl->pf, mnl->w_fields[1], mnl->solver_params, mnl->maxiter, mnl->accprec,
g_relative_precision_flag, VOLUME/2, mnl->Qp, mnl->solver);

chrono_add_solution(mnl->pf, mnl->csg_field, mnl->csg_index_array,
mnl->csg_N, &mnl->csg_n, VOLUME/2);
} else {
mnl->iter0 = solve_degenerate(mnl->pf, mnl->w_fields[1], mnl->HB_solver_params, mnl->maxiter, mnl->accprec,
g_relative_precision_flag, VOLUME/2, mnl->Qsq, mnl->HB_solver);
mnl->iter0 = solve_degenerate(mnl->pf, mnl->w_fields[1], mnl->solver_params, mnl->maxiter, mnl->accprec,
g_relative_precision_flag, VOLUME/2, mnl->Qsq, mnl->solver);

chrono_add_solution(mnl->pf, mnl->csg_field, mnl->csg_index_array,
mnl->csg_N, &mnl->csg_n, VOLUME/2);
Expand Down
6 changes: 0 additions & 6 deletions monomial/monomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ int add_monomial(const int type) {
}
else{
monomial_list[no_monomials].solver = _default_solver_flag;
monomial_list[no_monomials].HB_solver = _default_HB_solver_flag;
}
monomial_list[no_monomials].solver_params.mcg_delta = _default_mixcg_innereps;
monomial_list[no_monomials].solver_params.solution_type = TM_SOLUTION_M_MDAG;
Expand Down Expand Up @@ -249,11 +248,6 @@ int init_monomials(const int V, const int even_odd_flag) {
}
}
else if(monomial_list[i].type == CLOVERDETRATIO) {
if (monomial_list[i].HB_solver == _default_HB_solver_flag) {
monomial_list[i].HB_solver = monomial_list[i].solver;
monomial_list[i].HB_solver_params = monomial_list[i].solver_params;
}

monomial_list[i].hbfunction = &cloverdetratio_heatbath;
monomial_list[i].accfunction = &cloverdetratio_acc;
monomial_list[i].derivativefunction = &cloverdetratio_derivative;
Expand Down
2 changes: 0 additions & 2 deletions monomial/monomial.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ typedef struct {
int even_odd_flag;
int rngrepro;
int solver;
int HB_solver; // solver for the HB only (optional)

int iter0, iter1, iter2;
int csg_N, csg_N2;
Expand All @@ -91,7 +90,6 @@ typedef struct {
double forceprec;
double accprec;
solver_params_t solver_params;
solver_params_t HB_solver_params; // parameters of the HB solver
/* force normalisation */
double forcefactor;
/* some book-keeping */
Expand Down
54 changes: 0 additions & 54 deletions read_input.l
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ static inline double fltlist_next_token(int * const list_end){
%x MNAME
%x MCSTR
%x MSOLVER
%x HB_MSOLVER
%x RATMSOLVER
%x NDMSOLVER
%x GTYPE
Expand Down Expand Up @@ -2447,10 +2446,6 @@ static inline double fltlist_next_token(int * const list_end){
solver_caller=YY_START;
BEGIN(NDMSOLVER);
}
{SPC}*HB_Solver{EQL} {
solver_caller=YY_START;
BEGIN(NDMSOLVER);
}
}

<RATMONOMIAL,RATCORMONOMIAL,CLRATMONOMIAL,CLRATCORMONOMIAL>{
Expand Down Expand Up @@ -2481,10 +2476,6 @@ static inline double fltlist_next_token(int * const list_end){
solver_caller=YY_START;
BEGIN(MSOLVER);
}
{SPC}*HB_Solver{EQL} {
solver_caller=YY_START;
BEGIN(HB_MSOLVER);
}
}

<GAUGEMONOMIAL>{
Expand Down Expand Up @@ -2726,51 +2717,6 @@ static inline double fltlist_next_token(int * const list_end){
}
}

<HB_MSOLVER>{
CG {
if(myverbose) printf(" HB Solver set to \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
mnl->HB_solver = CG;
BEGIN(solver_caller);
}
mixedCG {
if(myverbose) printf(" HB Solver set to \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
mnl->HB_solver = MIXEDCG;
BEGIN(solver_caller);
}
rgmixedCG {
if(myverbose) printf(" HB Solver set to \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
mnl->HB_solver = RGMIXEDCG;
BEGIN(solver_caller);
}
BICGSTAB {
if(myverbose) printf(" HB Solver set to \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
mnl->HB_solver = BICGSTAB;
BEGIN(solver_caller);
}
mixedbicgstab {
if(myverbose) printf(" HB Solver set to \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
mnl->HB_solver=MIXEDBICGSTAB;
BEGIN(name_caller);
}
MG {
if(myverbose) printf(" HB Solver set to \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
mnl->HB_solver = MG;
BEGIN(name_caller);
}
DDalphaAMG {
#ifdef DDalphaAMG
if(myverbose) printf(" HB Solver set to DDalphaAMG line %d operator %d\n", line_of_file, current_operator);
mnl->HB_solver = MG;
BEGIN(solver_caller);
#else
printf("ERROR line %d operator %d: DDalphaAMG library not included\n", line_of_file, current_operator);
exit(1);
#endif
}
}



<RATMSOLVER>{
rgmixedCG {
if(myverbose) printf(" Solver set to \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
Expand Down
3 changes: 1 addition & 2 deletions solver/solver_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ typedef enum SOLVER_TYPE {
MG,
MIXEDBICGSTAB,
DUMMYHERMTEST,
CA_GCR,
INVALID_SOLVER
CA_GCR
} SOLVER_TYPE;

int solver_is_mixed( const int solver_type );
Expand Down

0 comments on commit da55dc9

Please sign in to comment.