Skip to content

Commit

Permalink
renamed measurements directory to meas and fixed build system for the…
Browse files Browse the repository at this point in the history
… subdirectories (apparently)\n seemingly chose appropriate normalization for energy density to get reasonable agreement with existing determinations of w0 and t0 (this nees to be checked carefully though...),\n imported some of Albert's work to help with exponentiating matrices
  • Loading branch information
kostrzewa committed Feb 16, 2015
1 parent a37950d commit a142349
Show file tree
Hide file tree
Showing 25 changed files with 303 additions and 241 deletions.
3 changes: 2 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ COMPILE = ${CC} ${DEFS} ${INCLUDES} -o $@ ${CFLAGS}
SMODULES =

MODULES = read_input gamma measure_gauge_action start \
expo get_staples update_backward_gauge \
expo matrix_utils get_staples update_backward_gauge \
measure_rectangles get_rectangle_staples \
test/check_geometry test/check_xchange \
test/overlaptests \
Expand Down Expand Up @@ -74,6 +74,7 @@ SUBDIRS = ${USESUBDIRS}
# delete the default suffix rules
.SUFFIXES:

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

$(SUBDIRS):
Expand Down
5 changes: 3 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ LDFLAGS="$LDFLAGS -L\${HOME}/lib -L\${top_builddir}/lib"
CCLD=${CC}

# compilation in operator is slowest so we do it first, saves time in parallel compiles
USESUBDIRS="operator linalg solver monomial buffers cu io xchange init rational wrapper measurements"
USESUBDIRS="operator linalg solver monomial buffers cu io meas xchange init rational wrapper"

AC_CHECK_HEADERS([stdint.h],
[ dnl for inttypes.h and stdint.h for uint_xxx types
Expand Down Expand Up @@ -355,6 +355,7 @@ AC_SUBST(DEBUG_FLAG)
AC_SUBST(PROFILE_FLAG)
AC_SUBST(XCHANGELIB)
AC_SUBST(XCHANGEDIR)
AC_SUBST(MEASDIR)
AC_SUBST(XLIB)
AC_SUBST([LEMON_AVAILABLE])
AC_SUBST(SPI_FILES)
Expand Down Expand Up @@ -921,7 +922,7 @@ if test ! -e tests/regressions; then
fi


LIBS="-lhmc -lmonomial -loperator -lsolver -linit -llinalg -lhmc -lxchange -lrational -lio -lmeas $LIBS"
LIBS="-lhmc -lmonomial -loperator -lsolver -linit -lmeas -llinalg -lhmc -lxchange -lrational -lio $LIBS"
AUTOCONF=autoconf

for i in $USESUBDIRS
Expand Down
63 changes: 33 additions & 30 deletions get_rectangle_staples.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
#include "get_rectangle_staples.h"

void get_rectangle_staples(su3 * const v, const int x, const int mu) {
get_rectangle_staples_general(v,x,mu,g_gauge_field);
}

void get_rectangle_staples_general(su3 * const v, const int x, const int mu, su3** gf) {
su3 ALIGN tmp1, tmp2;
int y, z, nu;
su3 * a, * b, * c, * d, * e;
Expand All @@ -47,18 +50,18 @@ void get_rectangle_staples(su3 * const v, const int x, const int mu) {
* b| |e
* a| |d
*/
a = &g_gauge_field[x][nu];
a = &gf[x][nu];
y = g_iup[x][nu];
b = &g_gauge_field[y][nu];
b = &gf[y][nu];
_su3_times_su3(tmp1, *a, *b);
z = g_iup[y][nu];
c = &g_gauge_field[z][mu];
c = &gf[z][mu];
_su3_times_su3(tmp2, tmp1, *c);

y = g_iup[x][mu];
d = &g_gauge_field[y][nu];
d = &gf[y][nu];
z = g_iup[y][nu];
e = &g_gauge_field[z][nu];
e = &gf[z][nu];
_su3_times_su3(tmp1, *d, *e);
_su3_times_su3d_acc((*v), tmp2, tmp1);

Expand All @@ -71,16 +74,16 @@ void get_rectangle_staples(su3 * const v, const int x, const int mu) {
*/
y = g_idn[x][nu];
z = g_idn[y][nu];
d = &g_gauge_field[z][nu];
a = &g_gauge_field[z][mu];
d = &gf[z][nu];
a = &gf[z][mu];
_su3d_times_su3(tmp1, *d, *a);
e = &g_gauge_field[y][nu];
e = &gf[y][nu];
_su3d_times_su3(tmp2, *e, tmp1);

y = g_iup[z][mu];
b = &g_gauge_field[y][nu];
b = &gf[y][nu];
z = g_iup[y][nu];
c = &g_gauge_field[z][nu];
c = &gf[z][nu];
_su3_times_su3(tmp1, *b, *c);
_su3_times_su3_acc((*v), tmp2, tmp1);

Expand All @@ -92,18 +95,18 @@ void get_rectangle_staples(su3 * const v, const int x, const int mu) {
* a| _|e
* d
*/
a = &g_gauge_field[x][nu];
a = &gf[x][nu];
y = g_iup[x][nu];
b = &g_gauge_field[y][mu];
b = &gf[y][mu];
_su3_times_su3(tmp1, *a, *b);
z = g_iup[y][mu];
c = &g_gauge_field[z][mu];
c = &gf[z][mu];
_su3_times_su3(tmp2, tmp1, *c);

y = g_iup[x][mu];
d = &g_gauge_field[y][mu];
d = &gf[y][mu];
z = g_iup[y][mu];
e = &g_gauge_field[z][nu];
e = &gf[z][nu];
_su3_times_su3(tmp1, *d, *e);
_su3_times_su3d_acc((*v), tmp2, tmp1);

Expand All @@ -116,17 +119,17 @@ void get_rectangle_staples(su3 * const v, const int x, const int mu) {
* ab
*/
y = g_idn[x][nu];
d = &g_gauge_field[y][nu];
a = &g_gauge_field[y][mu];
d = &gf[y][nu];
a = &gf[y][mu];
_su3d_times_su3(tmp1, *d, *a);
z = g_iup[y][mu];
b = &g_gauge_field[z][mu];
b = &gf[z][mu];
_su3_times_su3(tmp2, tmp1, *b);

y = g_iup[z][mu];
c = &g_gauge_field[y][nu];
c = &gf[y][nu];
z = g_iup[x][mu];
e = &g_gauge_field[z][mu];
e = &gf[z][mu];
_su3_times_su3d(tmp1, *c, *e);
_su3_times_su3_acc((*v), tmp2, tmp1);

Expand All @@ -140,16 +143,16 @@ void get_rectangle_staples(su3 * const v, const int x, const int mu) {
*/
y = g_idn[x][mu];
z = g_idn[y][nu];
d = &g_gauge_field[z][nu];
a = &g_gauge_field[z][mu];
d = &gf[z][nu];
a = &gf[z][mu];
_su3d_times_su3(tmp1, *d, *a);
e = &g_gauge_field[y][mu];
e = &gf[y][mu];
_su3d_times_su3(tmp2, *e, tmp1);

y = g_idn[x][nu];
b = &g_gauge_field[y][mu];
b = &gf[y][mu];
z = g_iup[y][mu];
c = &g_gauge_field[z][nu];
c = &gf[z][nu];
_su3_times_su3(tmp1, *b, *c);
_su3_times_su3_acc((*v), tmp2, tmp1);

Expand All @@ -162,17 +165,17 @@ void get_rectangle_staples(su3 * const v, const int x, const int mu) {
* d
*/
y = g_idn[x][mu];
d = &g_gauge_field[y][mu];
d = &gf[y][mu];
z = g_iup[y][nu];
a = &g_gauge_field[y][nu];
a = &gf[y][nu];
_su3d_times_su3(tmp1, *d, *a);
b = &g_gauge_field[z][mu];
b = &gf[z][mu];
_su3_times_su3(tmp2, tmp1, *b);

y = g_iup[x][mu];
e = &g_gauge_field[y][nu];
e = &gf[y][nu];
z = g_iup[x][nu];
c = &g_gauge_field[z][mu];
c = &gf[z][mu];
_su3_times_su3d(tmp1, *c, *e);
_su3_times_su3_acc((*v), tmp2, tmp1);
}
Expand Down
1 change: 1 addition & 0 deletions get_rectangle_staples.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
#define _GET_RECTANGLE_STAPLES_H

void get_rectangle_staples(su3 * const v, const int x, const int mu);
void get_rectangle_staples_general(su3 * const v, const int x, const int mu, const su3** gf);

#endif
2 changes: 1 addition & 1 deletion hmc_tm.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#include "monomial/monomial.h"
#include "integrator.h"
#include "sighandler.h"
#include "measurements/measurements.h"
#include "meas/measurements.h"

extern int nstore;

Expand Down
2 changes: 1 addition & 1 deletion invert.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#include "operator/tm_operators.h"
#include "operator/Dov_psi.h"
#include "solver/spectral_proj.h"
#include "measurements/measurements.h"
#include "meas/measurements.h"

extern int nstore;
int check_geometry();
Expand Down
16 changes: 7 additions & 9 deletions measurements/Makefile.in → meas/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ top_builddir = @top_builddir@
abs_top_builddir = @abs_top_builddir@
top_srcdir = @top_srcdir@
abs_top_srcdir = @abs_top_srcdir@
subdir = measurements
subdir = meas
builddir = @builddir@

CFLAGS = @CFLAGS@
CFLAGS = @CFLAGS@ @MEASDIR@
DEPFLAGS = @DEPFLAGS@
LDFLAGS = @LDFLAGS@
DEFS = @DEFS@
Expand Down Expand Up @@ -39,8 +39,9 @@ libmeas_TARGETS = measurements \
energy_density w0

libmeas_OBJECTS = $(addsuffix .o, ${libmeas_TARGETS})
external_OBJECTS = ${top_builddir}/fatal_error.o ${top_builddir}/source_generation.o ${top_builddir}/prepare_source.o \
${top_builddir}/aligned_malloc.o

#external_OBJECTS = ${top_builddir}/fatal_error.o ${top_builddir}/source_generation.o ${top_builddir}/prepare_source.o \
# ${top_builddir}/aligned_malloc.o

# default rule

Expand All @@ -67,12 +68,9 @@ include ${top_srcdir}/Makefile.global
%.o: ${srcdir}/%.c %.d Makefile ${abs_top_builddir}/config.h
$(COMPILE) -c $<


# rule to make libmeas, linking those objects is clearly required for the libary
# to be self-contained, but maybe they should be "extern" instead?
libmeas.a: ${libmeas_OBJECTS} $(external_OBJECTS) Makefile
libmeas.a: ${libmeas_OBJECTS} Makefile
@rm -f libmeas.a
@${AR} cru libmeas.a $(libmeas_OBJECTS) $(external_OBJECTS)
@${AR} cru libmeas.a $(libmeas_OBJECTS)
@$(RANLIB) libmeas.a
@cp libmeas.a ${top_builddir}/lib/libmeas.a

Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions measurements/energy_density.c → meas/energy_density.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
#include "su3.h"
#include "sse.h"
#include "su3adj.h"
#include "matrix_utils.h"

void measure_energy_density(const su3 ** const gf, double *ret)
{
// NOTE This normalization is not obviously the correct one...
double normalization = 1 / (24.0 /* Plaquette directions */ * 3.0 /* Nc */ * VOLUME * g_nproc);
double normalization = 32 / ( 4 * 64.0 * VOLUME * g_nproc);
double res = 0;
#ifdef MPI
double ALIGN mres=0;
Expand All @@ -58,6 +58,7 @@ void measure_energy_density(const su3 ** const gf, double *ret)
#endif
su3 ALIGN v1, v2, plaq;
double ALIGN ac,tr,ts,tt,kc=0,ks=0;
su3 ALIGN trace;

/* compute the clover-leave */
/* l __ __
Expand Down Expand Up @@ -111,9 +112,7 @@ void measure_energy_density(const su3 ** const gf, double *ret)
_su3d_times_su3(v1, *w1, *w2);
_su3_times_su3d(v2, *w3, *w4);
_su3_times_su3_acc(plaq, v1, v2);
_su3_dagger(v2, plaq);
_su3_minus_su3(plaq, plaq, v2); // At this point: anti-hermitian clover average in direction k, l

project_traceless_antiherm(&plaq);
_trace_su3_times_su3(ac, plaq, plaq); // This should actually be the energy density already...

// Kahan summation for each thread
Expand Down Expand Up @@ -141,5 +140,6 @@ void measure_energy_density(const su3 ** const gf, double *ret)
MPI_Allreduce(&res, &mres, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
res = mres;
#endif
// -sign compensates for i^2
*ret = -normalization * res;
}
File renamed without changes.
10 changes: 5 additions & 5 deletions measurements/measurements.c → meas/measurements.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#include "default_input_values.h"
#include "read_input.h"

#include "measurements/pion_norm.h"
#include "measurements/correlators.h"
#include "measurements/polyakov_loop.h"
#include "measurements/oriented_plaquettes.h"
#include "measurements/w0.h"
#include "pion_norm.h"
#include "correlators.h"
#include "polyakov_loop.h"
#include "oriented_plaquettes.h"
#include "w0.h"
#include "measurements.h"

measurement measurement_list[max_no_measurements];
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include <string.h>
#include <stdio.h>

#include "global.h"
#include "su3.h"
#include "geometry_eo.h"
#include "global.h"
#include "oriented_plaquettes.h"
#include "fatal_error.h"
#include "measurements.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit a142349

Please sign in to comment.