Skip to content

Commit

Permalink
Release 2.3: see NEWS and Release files
Browse files Browse the repository at this point in the history
  • Loading branch information
urbach committed Nov 23, 2004
1 parent 7bce438 commit 6036b56
Show file tree
Hide file tree
Showing 16 changed files with 1,475 additions and 1,235 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ LINKLIBS = ${top_builddir}/linalg/liblinalg.a \
COMPILE = ${CC} $(INCLUDES) -o $@ ${CFLAGS}

MODULES = init_gauge_field init_geometry_indices \
init_spinor_field init_moment_field \
init_spinor_field init_moment_field init_gauge_tmp \
read_input clover_eo linsolve xchange \
expo hybrid_update observables start \
geometry_eo linalg_eo ranlxd sw io Hopping_Matrix \
Expand Down
11 changes: 11 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
23.11.2004: The lattice size must be now set in the input file.
Recompilation is only needed for one or two dimensional
parallelisation.

For invert there is a new input parameter:
ReadSource = yes|no
SourceInputFilename = filename
This let's you read in a generalised source for the
inversion. The real filename must be of the form
filename${massnumber}.is${is}ic${ic}.${nstore}

22.11.2004: DBW2 implemented for the serial code and the parallel
code with new and old geometry.
Input parameter BoundaryCond is supplemented by
Expand Down
8 changes: 8 additions & 0 deletions Releases
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Release 2.3:
T and L can be set in the input file now.
The number of processors in x direction
is also set now in the input file.
T= integer
L= integer
NrXProcs = integer

Release 2.2:
DBW2 inplemented and working. New input parameter:
RGIC1 = floating point number
Expand Down
15 changes: 7 additions & 8 deletions benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "su3adj.h"
#include "ranlxd.h"
#include "geometry_eo.h"
#include "read_input.h"
#include "start.h"
#include "boundary.h"
#include "Hopping_Matrix.h"
Expand All @@ -30,6 +31,7 @@
#include "init_geometry_indices.h"
#include "init_spinor_field.h"
#include "init_moment_field.h"
#include "test/check_geometry.h"
#include "mpi_init.h"

#ifndef PARALLELXT
Expand All @@ -38,8 +40,6 @@
#define SLICE ((LX*LY*LZ/2)+(T*LY*LZ/2))
#endif


int check_geometry();
int check_xchange();

int main(int argc,char *argv[])
Expand All @@ -55,7 +55,6 @@ int main(int argc,char *argv[])
static double dt2;
int rlxd_state[105];
#endif
mpi_init(argc, argv);

if(g_proc_id==0) {
#ifdef SSE
Expand Down Expand Up @@ -96,11 +95,11 @@ int main(int argc,char *argv[])
fprintf(stderr, "Not enough memory for spinor fields! Aborting...\n");
exit(0);
}
j = init_moment_field(VOLUME, VOLUMEPLUSRAND);
if ( j!= 0) {
fprintf(stderr, "Not enough memory for moment fields! Aborting...\n");
exit(0);
}

/* Read the input file */
read_input("benchmark.input");

mpi_init(argc, argv);

/* define the geometry */
geometry();
Expand Down
3 changes: 3 additions & 0 deletions benchmark.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
T=16
L=16
NrXProcs=1
9 changes: 7 additions & 2 deletions default_input_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
* read_input.c
*
* Autor: Carsten Urbach
* urbach@ifh.de
*/
* urbach@desy.de
*************************************************/

#ifndef _DEFAULT_INPUT_VALUES_H
#define _DEFAULT_INPUT_VALUES_H

#define _default_T_global 4
#define _default_L 4
#define _default_N_PROC_X 1
#define _default_g_kappa 0.125
#define _default_g_mu 0.0
#define _default_g_mu1 0.0
Expand All @@ -34,6 +37,8 @@
#define _default_nstore 0
#define _default_rlxd_input_filename "last_state"
#define _default_gauge_input_filename "conf"
#define _default_read_source_flag 0
#define _default_source_filename "source.mass"
#define _default_g_stdio_proc 0
#define _default_index_start 0
#define _default_index_end 12
Expand Down
34 changes: 6 additions & 28 deletions global.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@
#include"su3.h"
#include"su3adj.h"

#define T 2
#define L 4

#ifndef PARALLELXT
#define N_PROC_X 1
#else
#define N_PROC_X 2
#endif

#define LX (L/N_PROC_X)
#define LY (L)
#define LZ (L)
#define VOLUME (T*LX*LY*LZ)

#define DUM_DERI 6
#define DUM_SOLVER (DUM_DERI+4)
#define DUM_MATRIX (DUM_SOLVER+6)
Expand All @@ -44,21 +30,9 @@
/* For benchmark set the following: */
/* #define NO_OF_SPINORFIELDS 100 */

#if (defined PARALLELT && !defined PARALLELXT)
#define RAND (2*LX*LY*LZ)
#define VOLUMEPLUSRAND ((T+2)*LX*LY*LZ)
#elif defined PARALLELXT
#define RAND (2*LY*LZ*(LX+T))
/* Note that VOLUMEPLUSRAND not equal to VOLUME+RAND in this case */
#define VOLUMEPLUSRAND (LY*LZ*(T+2)*(LX+2))
#else
#define RAND 0
#define VOLUMEPLUSRAND (VOLUME)
#endif

/* Here you can define antiperiodic */
/* boundary conditions with e.g. */
/* #define X1 1. (in time) */
/* #define X1 1. (in x-direction) */
#define X1 0.
#define X2 0.
#define X3 0.
Expand All @@ -80,7 +54,11 @@
#define ALIGN
#endif

/* translates from lexicagraphic order to even/odd order */
EXTERN int T_global, T, L, LX, LY, LZ, VOLUME;
EXTERN int N_PROC_X;
EXTERN int RAND, VOLUMEPLUSRAND;

/* translates from lexicographic order to even/odd order */
EXTERN int * g_lexic2eo;
/* translates from even/odd orderto lexicograhic order */
EXTERN int * g_eo2lexic;
Expand Down
14 changes: 8 additions & 6 deletions hmc_tm.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
#include "init_geometry_indices.h"
#include "init_spinor_field.h"
#include "init_moment_field.h"
#include "init_gauge_tmp.h"
#include "test/check_geometry.h"
#include "boundary.h"

char * Version = "2.2";
char * Version = "2.3";


void usage(){
Expand Down Expand Up @@ -91,8 +92,6 @@ int main(int argc,char *argv[]) {
signal(SIGXCPU,&catch_del_sig);
#endif

mpi_init(argc, argv);

while ((c = getopt(argc, argv, "h?f:o:")) != -1) {
switch (c) {
case 'f':
Expand Down Expand Up @@ -120,6 +119,8 @@ int main(int argc,char *argv[]) {
/* Read the input file */
read_input(input_filename);

mpi_init(argc, argv);

if(Nskip == 0){
Nskip = 1;
}
Expand Down Expand Up @@ -215,13 +216,13 @@ int main(int argc,char *argv[]) {
printf("# The code was compiled with -D_GAUGE_COPY\n");
#endif
printf("# The lattice size is %d x %d^3\n",(int)(T)*g_nproc_t,(int)(L));
printf("# The local lattice size is %d x %d^3\n",(int)(T),(int)(L));
printf("# The local lattice size is %d x %d x %d^2\n", (int)(T), (int)(LX), (int)(L));
printf("# beta = %f , kappa= %f, mu= %f \n",g_beta,g_kappa,g_mu);
printf("# mus = %f, %f, %f\n", g_mu1, g_mu2, g_mu3);
printf("# g_rgi_C0 = %f, g_rgi_C1 = %f\n", g_rgi_C0, g_rgi_C1);

fprintf(parameterfile, "The lattice size is %d x %d^3\n", (int)(g_nproc_t*T),(int)(L));
fprintf(parameterfile, "The local lattice size is %d x %d^3\n", (int)(T),(int)(L));
fprintf(parameterfile, "The lattice size is %d x %d^3\n", (int)(g_nproc_t*T), (int)(L));
fprintf(parameterfile, "The local lattice size is %d x %d x %d^2\n", (int)(T), (int)(LX), (int)(L));
fprintf(parameterfile, "g_beta = %f , g_kappa= %f, g_kappa*csw/8= %f g_mu = %f \n",g_beta,g_kappa,g_ka_csw_8, g_mu);
fprintf(parameterfile, "boundary of fermion fields (t,x,y,z): %f %f %f %f \n",X0,X1,X2,X3);
fprintf(parameterfile, "ITER_MAX_BCG=%d, EPS_SQ0=%e, EPS_SQ1=%e EPS_SQ2=%e, EPS_SQ3=%e \n"
Expand Down Expand Up @@ -418,6 +419,7 @@ int main(int argc,char *argv[]) {
#ifdef MPI
MPI_Finalize();
#endif
free_gauge_tmp();
free_gauge_field();
free_geometry_indices();
free_spinor_field();
Expand Down
39 changes: 39 additions & 0 deletions init_gauge_tmp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* $Id$ */

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include "global.h"
#include "su3.h"
#include "sse.h"
#include "init_gauge_tmp.h"

su3 * gauge_tmp_ = NULL;
su3 ** gauge_tmp = NULL;

int init_gauge_tmp(const int V) {
int i=0;

gauge_tmp = calloc(V, sizeof(su3*));
if(errno == ENOMEM) {
return(1);
}
gauge_tmp_ = calloc(4*V+1, sizeof(su3));
if(errno == ENOMEM) {
return(1);
}
#if (defined SSE || defined SSE2 || defined SSE3)
gauge_tmp[0] = (su3*)(((unsigned long int)(gauge_tmp_)+ALIGN_BASE)&~ALIGN_BASE);
#else
gauge_tmp[0] = gauge_tmp_;
#endif
for(i = 1; i < V; i++){
gauge_tmp[i] = gauge_tmp[i-1]+4;
}
return(0);
}

void free_gauge_tmp() {
free(gauge_tmp_);
free(gauge_tmp);
}
10 changes: 10 additions & 0 deletions init_gauge_tmp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* $Id$ */
#ifndef _INIT_GAUGE_TMP_H
#define _INIT_GAUGE_TMP_H

extern su3 ** gauge_tmp;

int init_gauge_tmp(const int V);
void free_gauge_tmp();

#endif
20 changes: 10 additions & 10 deletions invert.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
#include "init_moment_field.h"
#include "invert_eo.h"

char * Version = "2.1";

char * Version = "2.3";

void usage(){
fprintf(stderr, "Inversion for EO preconditioned Wilson twisted mass QCD\n\n");
Expand Down Expand Up @@ -87,8 +86,6 @@ int main(int argc,char *argv[]) {
signal(SIGXCPU,&catch_del_sig);
#endif

mpi_init(argc, argv);

while ((c = getopt(argc, argv, "h?f:o:")) != -1) {
switch (c) {
case 'f':
Expand Down Expand Up @@ -116,6 +113,8 @@ int main(int argc,char *argv[]) {
/* Read the input file */
read_input(input_filename);

mpi_init(argc, argv);

if(nstore == -1) {
countfile = fopen(nstore_filename, "r");
if(countfile != NULL) {
Expand Down Expand Up @@ -147,11 +146,6 @@ int main(int argc,char *argv[]) {
fprintf(stderr, "Not enough memory for spinor fields! Aborting...\n");
exit(0);
}
j = init_moment_field(VOLUME, VOLUMEPLUSRAND);
if ( j!= 0) {
fprintf(stderr, "Not enough memory for moment fields! Aborting...\n");
exit(0);
}

q_off = 0.;
q_off2 = 0.;
Expand Down Expand Up @@ -237,7 +231,13 @@ int main(int argc,char *argv[]) {
for(ix = index_start; ix < index_end; ix++) {
is = (ix / 3);
ic = (ix % 3);
source_spinor_field(spinor_field[0], spinor_field[1], is, ic);
if(read_source_flag == 0) {
source_spinor_field(spinor_field[0], spinor_field[1], is, ic);
}
else {
sprintf(conf_filename,"%s%.2d.is%.1dic%.1d.%.4d", source_input_filename, mass_number, is, ic, nstore);
read_spinorfield_eo_time(spinor_field[0], spinor_field[1], conf_filename);
}

if(g_proc_id == 0) {printf("mu = %e\n", g_mu);}

Expand Down
29 changes: 27 additions & 2 deletions mpi_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ void mpi_init(int argc,char *argv[]) {

#ifdef PARALLELT
ndims = 1;
g_dbw2rand = (2*LX*LY*LZ);
#endif
#if defined PARALLELXT
ndims = 2;
g_dbw2rand = (2*LY*LZ*(LX+T+4));
#endif

MPI_Init(&argc, &argv);
Expand All @@ -70,6 +68,24 @@ void mpi_init(int argc,char *argv[]) {

g_nproc_t = dims[0];
g_nproc_x = dims[1];
N_PROC_X = g_nproc_x;
LY = L;
LZ = L;
T = T_global/g_nproc_t;
LX = L/g_nproc_x;
VOLUME = (T*LX*LY*LZ);
#ifdef PARALLELT
RAND = (2*LX*LY*LZ);
VOLUMEPLUSRAND = ((T+2)*LX*LY*LZ);
g_dbw2rand = (2*LX*LY*LZ);
#endif
#if defined PARALLELXT
RAND = (2*LY*LZ*(LX+T));
/* Note that VOLUMEPLUSRAND not equal to VOLUME+RAND in this case */
VOLUMEPLUSRAND = (LY*LZ*(T+2)*(LX+2));
g_dbw2rand = (2*LY*LZ*(LX+T+4));
#endif

MPI_Cart_create(MPI_COMM_WORLD, ndims, dims, periods, reorder, &g_cart_grid);
MPI_Comm_rank(g_cart_grid, &g_cart_id);
MPI_Cart_coords(g_cart_grid, g_cart_id, ndims, g_proc_coords);
Expand Down Expand Up @@ -149,7 +165,16 @@ void mpi_init(int argc,char *argv[]) {

g_proc_coords[0] = 0;
g_proc_coords[1] = 0;

LY = L;
LZ = L;
T = T_global;
LX = L;
VOLUME = (T*LX*LY*LZ);
RAND = 0;
VOLUMEPLUSRAND = VOLUME;
g_dbw2rand = 0;
N_PROC_X = 1;
#endif
}

Expand Down
Loading

0 comments on commit 6036b56

Please sign in to comment.