Skip to content

Commit

Permalink
Merge branch 'master', remote-tracking branch 'origin' into omf4
Browse files Browse the repository at this point in the history
  • Loading branch information
urbach committed Jan 19, 2013
2 parents 5645726 + 3a3457b commit 697aed3
Show file tree
Hide file tree
Showing 42 changed files with 444 additions and 270 deletions.
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ COMPILE = ${CC} ${DEFS} ${INCLUDES} -o $@ ${CFLAGS}

SMODULES =

MODULES = read_input gamma hybrid_update measure_gauge_action start \
measure_oriented_plaquettes \
MODULES = read_input gamma measure_gauge_action start \
measure_oriented_plaquettes \
expo get_staples update_backward_gauge \
measure_rectangles get_rectangle_staples \
test/check_geometry test/check_xchange \
Expand Down
6 changes: 1 addition & 5 deletions Ptilde_nd.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,12 @@ void degree_of_Ptilde(int * _degree, double ** coefs,
printf("# NDPOLY Acceptance Polynomial: coef[degree] = %e\n", (*coefs)[degree]);
}
if(sum < acc) {
/* if(fabs(*coefs[degree]) < acc) { */
if((g_proc_id == g_stdio_proc) && (g_debug_level > 1)) {
printf(" sum %e, coef %e\n", sum, (*coefs)[degree]);
}
break;
}
degree= (int)(degree*1.2);
}

if(g_debug_level > 0) {
if(g_debug_level > 2) {
/* Ptilde P S P Ptilde X - X */
/* for random spinor X */
random_spinor_field_eo(ss, repro, RN_GAUSS);
Expand Down
46 changes: 23 additions & 23 deletions chebyshev_polynomial_nd.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,35 +139,35 @@ void degree_of_polynomial_nd(int * _degree_of_p, double ** coefs,
fflush(stdout);
}

/* Here we check the accuracy */
Ptilde_ndpsi(&auxs[0], &auxc[0], *coefs, degree_of_p, &ss[0], &sc[0], Qsq);
Qsq(&aux2s[0], &aux2c[0], &auxs[0], &auxc[0]);
Ptilde_ndpsi(&auxs[0], &auxc[0], *coefs, degree_of_p, &aux2s[0], &aux2c[0], Qsq);

diff(&aux2s[0],&auxs[0],&ss[0],VOLUME/2);
temp=square_norm(&aux2s[0],VOLUME/2, 1)/square_norm(&ss[0],VOLUME/2, 1)/4.0;

diff(&aux2c[0],&auxc[0],&sc[0],VOLUME/2);
temp2 = square_norm(&aux2c[0],VOLUME/2, 1)/square_norm(&sc[0],VOLUME/2, 1)/4.0;

if(g_epsbar == 0.){
temp2 = 0.0;
}

if(g_proc_id == g_stdio_proc && g_debug_level > 0){
/* this is || (P S P - 1)X ||^2 /|| 2X ||^2 */
/* where X is a random spinor field */
printf("# NDPOLY MD Polynomial: relative squared accuracy in components:\n# UP=%e DN=%e \n", temp, temp2);
fflush(stdout);
}

if(g_debug_level > 1) {
/* Here we check the accuracy */
Ptilde_ndpsi(&auxs[0], &auxc[0], *coefs, degree_of_p, &ss[0], &sc[0], Qsq);
Qsq(&aux2s[0], &aux2c[0], &auxs[0], &auxc[0]);
Ptilde_ndpsi(&auxs[0], &auxc[0], *coefs, degree_of_p, &aux2s[0], &aux2c[0], Qsq);

diff(&aux2s[0],&auxs[0],&ss[0],VOLUME/2);
temp=square_norm(&aux2s[0],VOLUME/2, 1)/square_norm(&ss[0],VOLUME/2, 1)/4.0;

diff(&aux2c[0],&auxc[0],&sc[0],VOLUME/2);
temp2 = square_norm(&aux2c[0],VOLUME/2, 1)/square_norm(&sc[0],VOLUME/2, 1)/4.0;

if(g_epsbar == 0.){
temp2 = 0.0;
}

if(g_proc_id == g_stdio_proc){
/* this is || (P S P - 1)X ||^2 /|| 2X ||^2 */
/* where X is a random spinor field */
printf("# NDPOLY MD Polynomial: relative squared accuracy in components:\n# UP=%e DN=%e \n", temp, temp2);
fflush(stdout);
}

temp = cheb_eval(degree_of_p, *coefs, EVMin);
temp *= EVMin;
temp *= cheb_eval(degree_of_p, *coefs, EVMin);
temp = 0.5*fabs(temp - 1);
if(g_proc_id == g_stdio_proc) {
printf("# PHMC: Delta_IR at s=%f: | P s_low P - 1 |/2 = %e \n", EVMin, temp);
printf("# NDPOLY MD Polynomial: Delta_IR at s=%f: | P s_low P - 1 |/2 = %e \n", EVMin, temp);
}
}
/* RECALL THAT WE NEED AN EVEN DEGREE !!!! */
Expand Down
22 changes: 12 additions & 10 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if test $enable_qpx = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BGQ,1,Compile with QPX intrinsics)
AC_MSG_NOTICE([Compiling with QPX intrinsics on BGQ, enabling compiler optimizations for XLC.])
OPTARGS="-O3 -qstrict=all -qtune=qp -qarch=qp -qmaxmem=-1"
OPTARGS="-O2 -qstrict=all -qtune=qp -qarch=qp -qmaxmem=-1"
SOPTARGS="$OPTARGS"
else
AC_MSG_RESULT(no)
Expand Down Expand Up @@ -302,15 +302,17 @@ dnl for the case of other configure scripts
dnl AC_CONFIG_SUBDIRS( rng )

dnl check for clock_gettime and set correct library flag if one is required
dnl (as done by AC_CHECK_LIB)
dnl (this is done by AC_CHECK_LIB)
AC_CHECK_FUNCS(clock_gettime, [], [AC_CHECK_LIB(rt, clock_gettime)])


dnl with glibc and c99 mode the timespec required for clock_gettime is only
dnl available in POSIX 199309L compatibility mode when clock_gettime is in librt
if test "$ac_cv_lib_rt_clock_gettime" = "yes"; then
dnl in principle clock_gettime and CLOCK_MONOTONIC/CLOCK_REALTIME should be available
dnl only when using POSIX 199309, we set this explicitly here
dnl this should not cause problems on any relatively modern (post y2k) machine!
if ( test "$ac_cv_lib_rt_clock_gettime" = "yes" || test "$ac_cv_func_clock_gettime" = "yes" ); then
AC_DEFINE(HAVE_CLOCK_GETTIME,1)
CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L"
dnl we set this in gettime.c explicitly for the time being
dnl due to endian problem on BG/Q
dnl CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L"
AC_MSG_NOTICE([Instructing the compiler to use POSIX 199309L])
fi

Expand Down Expand Up @@ -623,7 +625,7 @@ elif test "$host_cpu" = "powerpc64" && test "$host_vendor" = "unknown" && test "
DEBUGFLAG="$DEBUGFLAG -qfullpath"
fi

OPTARGS="$OPTARGS -O3"
OPTARGS="$OPTARGS"
SOPTARGS="$OPTARGS"
if test "$CCDEP" = "gcc"; then
DEPFLAGS="-MM"
Expand Down Expand Up @@ -710,8 +712,8 @@ elif test "$host_cpu" = "powerpc" && test "$host_vendor" = "ibm" && test "$host_
elif test "$host_cpu" = "powerpc" && test "$host_vendor" = "ibm"; then
CFLAGS="$CFLAGS -q64 -qsrcmsg"
LDFLAGS="$LDFLAGS -q64"
OPTARGS="-O3 -qhot"
SOPTARGS="-O3 -qhot"
OPTARGS="-O2"
SOPTARGS="-O2"
DEBUG_FLAG="-qfullpath -g"
if test "$CCDEP" = "gcc"; then
DEPFLAGS="-MM"
Expand Down
7 changes: 7 additions & 0 deletions gettime.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
#ifdef HAVE_CONFIG_H
# include<config.h>
#endif
#ifdef HAVE_CLOCK_GETTIME
# ifndef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 199309L
# endif
# include <sys/time.h>
# include <bits/time.h>
#endif
#include <time.h>
#if (defined BGL && !defined BGP)
# include <rts.h>
Expand Down
2 changes: 1 addition & 1 deletion monomial/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ COMPILE = ${CC} $(DEFS) ${INCLUDES} ${CFLAGS}
LIBRARIES = libmonomial
libmonomial_TARGETS = nddetratio_monomial monomial det_monomial detratio_monomial \
gauge_monomial ndpoly_monomial clover_trlog_monomial cloverdet_monomial cloverdetratio_monomial \
clovernd_trlog_monomial poly_monomial cloverndpoly_monomial
clovernd_trlog_monomial poly_monomial cloverndpoly_monomial moment_energy


libmonomial_STARGETS =
Expand Down
25 changes: 21 additions & 4 deletions monomial/clover_trlog_monomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "operator/clover_leaf.h"
#include "monomial/monomial.h"
#include "operator/Hopping_Matrix.h"
#include "gettime.h"
#include "clover_trlog_monomial.h"

void clover_trlog_derivative(const int id, hamiltonian_field_t * const hf) {
Expand All @@ -48,27 +49,43 @@ void clover_trlog_derivative(const int id, hamiltonian_field_t * const hf) {

void clover_trlog_heatbath(const int id, hamiltonian_field_t * const hf) {
monomial * mnl = &monomial_list[id];
double atime, etime;
atime = gettime();
mnl->energy0 = 0.;

init_sw_fields();
sw_term( (const su3**) hf->gaugefield, mnl->kappa, mnl->c_sw);
/*compute the contribution from the clover trlog term */
mnl->energy0 = -sw_trace(EO, mnl->mu);
if(g_proc_id == 0 && g_debug_level > 3) {
printf("called clover_trlog_heatbath for id %d E = %e\n", id, mnl->energy0);
etime = gettime();
if(g_proc_id == 0) {
if(g_debug_level > 1) {
printf("# Time for %s monomial heatbath: %e s\n", mnl->name, etime-atime);
}
if(g_debug_level > 3) {
printf("called clover_trlog_heatbath for id %d E = %e\n", id, mnl->energy0);
}
}
return;
}

double clover_trlog_acc(const int id, hamiltonian_field_t * const hf) {
monomial * mnl = &monomial_list[id];
double atime, etime;
atime = gettime();
mnl->energy1 = 0.;
sw_term( (const su3**) hf->gaugefield, mnl->kappa, mnl->c_sw);
/*compute the contribution from the clover trlog term */
mnl->energy1 = -sw_trace(EO, mnl->mu);
etime = gettime();
if(g_proc_id == 0 && g_debug_level > 3) {
printf("called clover_trlog_acc for id %d dH = %1.10e\n",
id, mnl->energy1 - mnl->energy0);
if(g_debug_level > 1) {
printf("# Time for %s monomial acc step: %e s\n", mnl->name, etime-atime);
}
if(g_debug_level > 3) {
printf("called clover_trlog_acc for id %d dH = %1.10e\n",
id, mnl->energy1 - mnl->energy0);
}
}
return(mnl->energy1 - mnl->energy0);
}
36 changes: 29 additions & 7 deletions monomial/cloverdet_monomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "ranlxd.h"
#include "sse.h"
#include "start.h"
#include "gettime.h"
#include "linalg_eo.h"
#include "deriv_Sb.h"
#include "gamma.h"
Expand All @@ -50,7 +51,8 @@

void cloverdet_derivative(const int id, hamiltonian_field_t * const hf) {
monomial * mnl = &monomial_list[id];

double atime, etime;
atime = gettime();
for(int i = 0; i < VOLUME; i++) {
for(int mu = 0; mu < 4; mu++) {
_su3_zero(swm[i][mu]);
Expand Down Expand Up @@ -128,14 +130,20 @@ void cloverdet_derivative(const int id, hamiltonian_field_t * const hf) {
g_mu = g_mu1;
g_mu3 = 0.;
boundary(g_kappa);

etime = gettime();
if(g_debug_level > 1 && g_proc_id == 0) {
printf("# Time for %s monomial derivative: %e s\n", mnl->name, etime-atime);
}
return;
}


void cloverdet_heatbath(const int id, hamiltonian_field_t * const hf) {

monomial * mnl = &monomial_list[id];
double atime, etime;
atime = gettime();

g_mu = mnl->mu;
g_mu3 = mnl->rho;
g_c_sw = mnl->c_sw;
Expand All @@ -159,8 +167,14 @@ void cloverdet_heatbath(const int id, hamiltonian_field_t * const hf) {
g_mu = g_mu1;
g_mu3 = 0.;
boundary(g_kappa);
if(g_proc_id == 0 && g_debug_level > 3) {
printf("called cloverdet_heatbath for id %d %d\n", id, mnl->even_odd_flag);
etime = gettime();
if(g_proc_id == 0) {
if(g_debug_level > 1) {
printf("# Time for %s monomial heatbath: %e s\n", mnl->name, etime-atime);
}
if(g_debug_level > 3) {
printf("called cloverdet_heatbath for id %d energy %f\n", id, mnl->energy0);
}
}
return;
}
Expand All @@ -169,6 +183,8 @@ void cloverdet_heatbath(const int id, hamiltonian_field_t * const hf) {
double cloverdet_acc(const int id, hamiltonian_field_t * const hf) {
monomial * mnl = &monomial_list[id];
int save_sloppy = g_sloppy_precision_flag;
double atime, etime;
atime = gettime();

g_mu = mnl->mu;
g_mu3 = mnl->rho;
Expand All @@ -192,9 +208,15 @@ double cloverdet_acc(const int id, hamiltonian_field_t * const hf) {
g_mu = g_mu1;
g_mu3 = 0.;
boundary(g_kappa);
if(g_proc_id == 0 && g_debug_level > 3) {
printf("called cloverdet_acc for id %d %d dH = %1.10e\n",
id, mnl->even_odd_flag, mnl->energy1 - mnl->energy0);
etime = gettime();
if(g_proc_id == 0) {
if(g_debug_level > 1) {
printf("# Time for %s monomial acc step: %e s\n", mnl->name, etime-atime);
}
if(g_debug_level > 3) {
printf("called cloverdet_acc for id %d dH = %1.10e\n",
id, mnl->energy1 - mnl->energy0);
}
}
return(mnl->energy1 - mnl->energy0);
}
Loading

0 comments on commit 697aed3

Please sign in to comment.