Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reweighting branch merge #349

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
acceda0
added new measurements of reweighting factors and changed concept for…
Aug 19, 2016
bf00a97
added new measurements of reweighting factors and changed concept for…
Aug 19, 2016
12b43d2
updated
Sep 13, 2016
6448a5b
added eigevalue estimation and truncated polynomial factorization
Sep 13, 2016
507f733
added log estimation of reweighting
Dec 2, 2016
72b7964
rebase main master
Dec 9, 2016
25f1f89
added new measurements of reweighting factors and changed concept for…
Aug 19, 2016
af496d8
added new measurements of reweighting factors and changed concept for…
Aug 19, 2016
dec5d2d
updated
Sep 13, 2016
f43746f
added eigevalue estimation and truncated polynomial factorization
Sep 13, 2016
8f37f84
added log estimation of reweighting
Dec 2, 2016
93982ac
checked DDalphaAMG interfaces
Dec 22, 2016
add10f5
pull resolved
Dec 22, 2016
9607fe1
corrected for new interface with kappa changes
Feb 23, 2017
449e952
change of DDalphaAMG interface to allow for kappa change
Mar 2, 2017
1d63bb9
removed eigenvalue calculation (unsafe)
Apr 19, 2017
d7e232f
reverted chenges
Apr 25, 2017
8cdf1fe
indentation issue
Apr 25, 2017
6c87d09
changed includes
Apr 25, 2017
ac19c39
resolved conflicts with main master branch by merge
Oct 11, 2018
fe7a5b2
work on pull request
Nov 2, 2018
7c37cfe
small change
Nov 2, 2018
b9b15a7
added kappa.dat as optional input for intermediate kappa parameters
Nov 19, 2018
4c4ae30
added kappa.dat as optional input for intermediate kappa parameters, …
Nov 20, 2018
afc82c6
FLTLIST input instead of separate file
Nov 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ config.status
hmc_tm
invert
offline_measurement
gbergner marked this conversation as resolved.
Show resolved Hide resolved
measure
lib/
benchmark

16 changes: 16 additions & 0 deletions DDalphaAMG_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,22 @@ void MG_update_mu(double mu_tmLQCD, double odd_tmLQCD)
}
}

void MG_update_kappa(double kappa)
{
if(mg_initialized!=1){
return;
}
DDalphaAMG_get_parameters(&mg_params);
if (kappa!= mg_params.kappa) {
if (g_proc_id == 0) {
printf("MG WARNING: setting kappa from %.14f to %.14f general kappa %.14f\n",mg_params.kappa,kappa,g_kappa);
}
mg_params.kappa=kappa;
DDalphaAMG_update_parameters(&mg_params, &mg_status);
// DDalphaAMG_setup(&mg_status);
gbergner marked this conversation as resolved.
Show resolved Hide resolved
}
}

void MG_reset() {

if(mg_do_setup == 0)
Expand Down
1 change: 1 addition & 0 deletions DDalphaAMG_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ extern double mg_rho_update;
void MG_init(void);
void MG_update_gauge(double step);
void MG_update_mu(double mu_tmLQCD, double odd_tmLQCD);
void MG_update_kappa(double kappa);
void MG_reset(void);
void MG_finalize(void);

Expand Down
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ NOOPTMOD = test/check_xchange test/check_geometry

PROGRAMS = hmc_tm benchmark invert gen_sources \
check_locallity test_lemon hopping_test LapH_ev \
offline_measurement
offline_measurement measure
gbergner marked this conversation as resolved.
Show resolved Hide resolved

ALLOBJ = ${MODULES} ${PROGRAMS} ${SMODULES}
SUBDIRS = ${USESUBDIRS}
Expand All @@ -76,7 +76,7 @@ SUBDIRS = ${USESUBDIRS}
.SUFFIXES:

# need to build modules before subdirs!
all: Makefile dep $(SUBDIRS) hmc_tm invert benchmark offline_measurement
all: Makefile dep $(SUBDIRS) hmc_tm invert benchmark offline_measurement measure

$(SUBDIRS):
$(MAKE) --directory=$@
Expand Down
3 changes: 2 additions & 1 deletion doc/main.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
\documentclass[a4paper,12pt,dvips]{article}
\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
%amsmath
\usepackage{amssymb}
\usepackage{amsmath}
Expand Down
2 changes: 1 addition & 1 deletion invert.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int main(int argc, char *argv[])
int j, i, ix = 0, isample = 0, op_id = 0;
char datafilename[206];
char parameterfilename[206];
char conf_filename[50];
char conf_filename[300];
kostrzewa marked this conversation as resolved.
Show resolved Hide resolved
char * input_filename = NULL;
char * filename = NULL;
double plaquette_energy;
Expand Down
1 change: 1 addition & 0 deletions meas/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ LIBRARIES = libmeas
libmeas_TARGETS = measurements \
oriented_plaquettes \
correlators \
reweightingmeas \
pion_norm \
polyakov_loop \
energy_density gradient_flow
Expand Down
25 changes: 24 additions & 1 deletion meas/measurements.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Copyright (C) 2008 Carsten Urbach
* 2009 Florian Burger
* 2016 Georg Bergner
*
* This file is part of tmLQCD.
*
Expand Down Expand Up @@ -35,8 +36,10 @@
#include "polyakov_loop.h"
#include "oriented_plaquettes.h"
#include "gradient_flow.h"
#include "reweightingmeas.h"
#include "measurements.h"


measurement measurement_list[max_no_measurements];
int no_measurements = 0;

Expand All @@ -49,6 +52,8 @@ int add_measurement(const enum MEAS_TYPE meas_type) {
measurement_list[no_measurements].measurefunc = &dummy_meas;
measurement_list[no_measurements].type = meas_type;
measurement_list[no_measurements].initialised = 1;
measurement_list[no_measurements].parameter=(void *)NULL;
measurement_list[no_measurements].destructor = &default_destructor;
gbergner marked this conversation as resolved.
Show resolved Hide resolved
no_measurements++;
return(no_measurements);
}
Expand Down Expand Up @@ -80,6 +85,12 @@ int init_measurements(){
measurement_list[i].measurefunc = &gradient_flow_measurement;
}

if(measurement_list[i].type == REWEIGHTING) {
measurement_list[i].measurefunc = &reweighting_measurement;
initialize_reweighting_parameter(&measurement_list[i].parameter);
measurement_list[i].destructor = &free_reweighting_parameter;
}

measurement_list[i].id = i;
}
return(0);
Expand All @@ -88,7 +99,14 @@ return(0);


void free_measurements(){

int i;
for(i = 0; i < no_measurements; i++) {
if (measurement_list[i].parameter) {
measurement_list[i].destructor(measurement_list[i].parameter);
free(measurement_list[i].parameter);
measurement_list[i].parameter = NULL;
}
}
return;
}

Expand All @@ -102,5 +120,10 @@ void dummy_meas(const int traj, const int id, const int ieo) {
}


gbergner marked this conversation as resolved.
Show resolved Hide resolved
void default_destructor(void* ptr) {

}




65 changes: 40 additions & 25 deletions meas/measurements.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*
* Adapted from monomial.h by Florian Burger 2009/12/16
*
* More flexible handling of measurements parameters by Georg Bergner 2016
*
* This file is part of tmLQCD.
*
* tmLQCD is free software: you can redistribute it and/or modify
Expand All @@ -18,61 +20,74 @@
*
* You should have received a copy of the GNU General Public License
* along with tmLQCD. If not, see <http://www.gnu.org/licenses/>.
*
*
*
***********************************************************************/
#ifndef _MEASUREMENTS_H
#define _MEASUREMENTS_H

#define max_no_measurements 20

/* Give the measurement types an unambiguous ID*/
enum MEAS_TYPE {
ONLINE,
PIONNORM,
POLYAKOV,
ORIENTED_PLAQUETTES,
GRADIENT_FLOW
};
enum MEAS_TYPE
{
ONLINE, PIONNORM, POLYAKOV, ORIENTED_PLAQUETTES, GRADIENT_FLOW, REWEIGHTING
};

typedef struct {
typedef struct
{
enum MEAS_TYPE type;
int initialised;
int id;

/* frequency of the measurement */
int freq;
/* for maximal iterations in inversions for correlators */
int max_iter;

/* for polyakov loop */
int direction;

/* for maximal iterations in inversions for correlators */
int max_iter;

// random seed
unsigned int seed;

/* maximum number of slice, the source can be put
if the correlator is measured in T(Z)-direction this will be set to
T(LZ) by init_measurements
*/
int max_source_slice;

void* parameter;

/* frequency of the measurement */
int freq;

/* how it's usually called */
char name[100];

/* maximum number of slice, the source can be put
if the correlator is measured in T(Z)-direction this will be set to
T(LZ) by init_measurements
*/
int max_source_slice;

/* functions for the measurement */
void (*measurefunc) (const int traj, const int id, const int ieo);
void
(*measurefunc) (const int traj, const int id, const int ieo);
void
(*destructor) (void* param);
} measurement;


/* list of all monomials */
extern measurement measurement_list[max_no_measurements];
extern int no_measurements;

/* add a new measurement to the list of measurements */
int add_measurement(const enum MEAS_TYPE);
int
add_measurement (const enum MEAS_TYPE);
/* initialise all measurements in the list */
int init_measurements();
int
init_measurements ();
/* free space again */
void free_measurements();
void
free_measurements ();

void dummy_meas(const int traj, const int id, const int ieo);
void
dummy_meas (const int traj, const int id, const int ieo);
void
default_destructor (void* ptr);

#endif
Loading