Skip to content

Commit

Permalink
renamed hybrid_update file to moment_energy and added timing informat…
Browse files Browse the repository at this point in the history
…ion to moment_energy
  • Loading branch information
urbach committed Dec 17, 2012
1 parent 13f5379 commit 3ea8552
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 30 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
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
1 change: 0 additions & 1 deletion monomial/det_monomial.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "deriv_Sb.h"
#include "deriv_Sb_D_psi.h"
#include "operator/tm_operators.h"
#include "hybrid_update.h"
#include "operator/Hopping_Matrix.h"
#include "solver/chrono_guess.h"
#include "solver/solver.h"
Expand Down
35 changes: 16 additions & 19 deletions hybrid_update.c → monomial/moment_energy.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,10 @@
#include <math.h>
#include <time.h>
#include "global.h"
#include "su3.h"
#include "su3adj.h"
#include "su3spinor.h"
#include "expo.h"
#include "sse.h"
#include "xchange/xchange.h"
#include "get_rectangle_staples.h"
#include "gamma.h"
#include "get_staples.h"
#include "read_input.h"
#include "smearing/stout.h"

#include "ranlxd.h"
#include "start.h"
#include "phmc.h"
#include "hybrid_update.h"
#include "gettime.h"
#include "moment_energy.h"

/*----------------------------------------------------------------------------*/

Expand All @@ -56,7 +44,8 @@
*
*******************************************/
double moment_energy(su3adj ** const momenta) {

double atime, etime;
atime = gettime();
su3adj *xm;
int i,mu;
static double tt,tr,ts,kc,ks,sum;
Expand Down Expand Up @@ -84,10 +73,18 @@ double moment_energy(su3adj ** const momenta) {
/* the contribution to the E is however (p^2)/2: */
kc=0.5*(ks+kc);
#ifdef MPI
MPI_Allreduce(&kc, &ks, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
return ks;
#else
return kc;
ks = kc;
MPI_Allreduce(&ks, &kc, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
#endif
etime = gettime();
if(g_proc_id == 0) {
if(g_debug_level > 1) {
printf("# Time for moment_energy: %e s\n", etime-atime);
}
if(g_debug_level > 3) {
printf("called moment_energy: energy %f\n", kc);
}
}
return kc;
}

5 changes: 2 additions & 3 deletions hybrid_update.h → monomial/moment_energy.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with tmLQCD. If not, see <http://www.gnu.org/licenses/>.
***********************************************************************/
#ifndef _HYBRID_UPDATE_H
#define _HYBRID_UPDATE_H
#ifndef _MOMENT_ENERGY_H
#define _MOMENT_ENERGY_H

double moment_energy(su3adj ** const momenta);
double init_momenta(const int repro, su3adj ** const momenta);

#endif
1 change: 1 addition & 0 deletions monomial/monomial.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ typedef struct {
#include "monomial/cloverdet_monomial.h"
#include "monomial/cloverdetratio_monomial.h"
#include "monomial/cloverndpoly_monomial.h"
#include "monomial/moment_energy.h"

/* list of all monomials */
extern monomial monomial_list[max_no_monomials];
Expand Down
2 changes: 1 addition & 1 deletion overrelaxation.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#include "global.h"
#include "su3.h"
#include "su3adj.h"
#include "hybrid_update.h"
#include "monomial/moment_energy.h"
#include "ranlxd.h"
#include "sse.h"
#include "get_staples.h"
Expand Down
2 changes: 1 addition & 1 deletion test/test_eigenvalues.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include "read_input.h"
#include "mpi_init.h"
#include "sighandler.h"
#include "hybrid_update.h"
#include "monomial/moment_energy.h"
#include "update_tm.h"
#include "init/init.h"
#include "test/check_geometry.h"
Expand Down
3 changes: 1 addition & 2 deletions update_tm.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#include "io/gauge.h"
#include "io/params.h"
#include "measure_gauge_action.h"
#include "hybrid_update.h"
#include "ranlxd.h"
#include "read_input.h"
#include "expo.h"
Expand All @@ -75,7 +74,7 @@ int update_tm(double *plaquette_energy, double *rectangle_energy,
double yy[1];
double dh, expmdh, ret_dh=0., ret_gauge_diff=0., tmp;
double atime=0., etime=0.;
double ks,kc,ds,tr,ts,tt;
double ks = 0., kc = 0., ds, tr, ts, tt;

char tmp_filename[50];

Expand Down

0 comments on commit 3ea8552

Please sign in to comment.