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 all 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 @@ -18,5 +18,6 @@ tags
hmc_tm
invert
offline_measurement
gbergner marked this conversation as resolved.
Show resolved Hide resolved
measure
lib/
benchmark
19 changes: 19 additions & 0 deletions DDalphaAMG_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,25 @@ void MG_update_mu(double mu_tmLQCD, double odd_tmLQCD)
}
}

/*
* This extra interface has been required for the reweighting measurements.
* The update of the parameters was not taken into account properly.
*/
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);
}
}

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
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ ${addsuffix .o, ${SMODULES}}: %.o: ${srcdir}/%.c %.d Makefile $(abs_top_builddir
# C++ modules
$(addsuffix .o,${CXXMODULES}): %.o: ${srcdir}/%.cpp %.d Makefile $(abs_top_builddir)/config.h
${CXXCOMPILE} -c $<

${addsuffix .o, ${PROGRAMS}}: %.o: ${srcdir}/%.c %.d Makefile $(abs_top_builddir)/config.h ${top_srcdir}/git_hash.h
${COMPILE} ${OPTARGS} -c $<

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 \
measure_clover_field_strength_observables \
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) {

}




55 changes: 35 additions & 20 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,36 +20,41 @@
*
* 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
};

typedef struct {
enum MEAS_TYPE
{
ONLINE, PIONNORM, POLYAKOV, ORIENTED_PLAQUETTES, GRADIENT_FLOW, REWEIGHTING
};

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;

void* parameter;

/* frequency of the measurement */
int freq;

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

Expand All @@ -67,21 +74,29 @@ typedef struct {
double gf_tmax;

/* 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