20 #if defined(QMP_COMMS) 22 #elif defined(MPI_COMMS) 28 #define MAX(a,b) ((a)>(b)?(a):(b)) 29 #define DABS(a) ((a)<(0.)?(-(a)):(a)) 54 extern void usage(
char** );
66 printfQuda(
"prec sloppy_prec link_recon sloppy_link_recon S_dimension T_dimension Ls_dimension\n");
88 gauge_param.
X[0] =
xdim;
89 gauge_param.
X[1] =
ydim;
90 gauge_param.
X[2] =
zdim;
91 gauge_param.
X[3] =
tdim;
112 int x_face_size = gauge_param.
X[1]*gauge_param.
X[2]*gauge_param.
X[3]/2;
113 int y_face_size = gauge_param.
X[0]*gauge_param.
X[2]*gauge_param.
X[3]/2;
114 int z_face_size = gauge_param.
X[0]*gauge_param.
X[1]*gauge_param.
X[3]/2;
115 int t_face_size = gauge_param.
X[0]*gauge_param.
X[1]*gauge_param.
X[2]/2;
116 int pad_size =
MAX(x_face_size, y_face_size);
117 pad_size =
MAX(pad_size, z_face_size);
118 pad_size =
MAX(pad_size, t_face_size);
119 gauge_param.
ga_pad = pad_size;
124 using namespace quda;
126 const double max_error = 1e-10;
132 reunit_allow_svd, reunit_svd_only,
133 svd_rel_error, svd_abs_error);
138 using namespace quda;
141 cudaMemset(num_failures_dev, 0,
sizeof(
int));
144 cudaMemcpy(&num_failures, num_failures_dev,
sizeof(
int), cudaMemcpyDeviceToHost);
145 if(num_failures>0)
errorQuda(
"Error in the unitarization\n");
149 int main(
int argc,
char **argv)
152 for (
int i = 1; i < argc; i++){
156 printf(
"ERROR: Invalid option:%s\n", argv[i]);
187 for (
int dir = 0; dir < 4; dir++) {
197 double time0 = -((double)clock());
203 using namespace quda;
216 int R[4] = {0,0,0,0};
218 for(
int dir=0; dir<4; ++dir) y[dir] = gauge_param.
X[dir] + 2 * R[dir];
222 gParamEx.order = gParam.
order;
226 for(
int dir=0; dir<4; ++dir) gParamEx.r[dir] = R[dir];
229 RNG *randstates =
new RNG(*gauge, 1234);
239 printfQuda(
"Starting heatbath for beta = %f from a %s start\n", beta_value, strcmp(
latfile,
"") ?
"loaded" : (coldstart ?
"cold" :
"hot"));
240 printfQuda(
" %d Heatbath hits and %d overrelaxation hits per step\n", nhbsteps, novrsteps);
242 printfQuda(
" %d Measurement steps\n", nsteps);
273 printfQuda(
"Initial gauge field plaquette = %e topological charge = %e\n", plaq.x, charge);
281 for (
int step = 1; step <= nwarm; ++step) {
282 Monte( *gaugeEx, *randstates, beta_value, nhbsteps, novrsteps);
299 printfQuda(
"step=0 plaquette = %e topological charge = %e\n", plaq.x, charge);
304 for(
int step=1; step<=nsteps; ++step){
306 Monte( *gaugeEx, *randstates, beta_value, nhbsteps, novrsteps);
317 printfQuda(
"step=%d plaquette = %e topological charge = %e\n", step, plaq.x, charge);
332 for (
int dir = 0; dir < 4; dir++) {
344 for (
int dir = 0; dir<4; dir++) free(cpu_gauge[dir]);
360 time0 /= CLOCKS_PER_SEC;
375 for (
int dir = 0; dir<4; dir++) free(load_gauge[dir]);
static bool reunit_allow_svd
int dimPartitioned(int dim)
QudaReconstructType reconstruct_sloppy
void Init()
Initialize CURAND RNG states.
QudaGhostExchange ghostExchange
void construct_gauge_field(void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param)
enum QudaPrecision_s QudaPrecision
int heatbath_num_heatbath_per_step
int main(int argc, char **argv)
void setUnitarizeLinksConstants(double unitarize_eps, double max_error, bool allow_svd, bool svd_only, double svd_rel_error, double svd_abs_error)
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
int process_command_line_option(int argc, char **argv, int *idx)
QudaPrecision prec_sloppy
QudaGaugeParam gauge_param
QudaGaugeFieldOrder gauge_order
int gridsize_from_cmdline[]
QudaReconstructType link_recon_sloppy
const char * get_prec_str(QudaPrecision prec)
QudaPrecision & cuda_prec
static double svd_rel_error
int heatbath_warmup_steps
void initQuda(int device)
void unitarizeLinks(cudaGaugeField &outfield, const cudaGaugeField &infield, int *fails)
QudaPrecision & cuda_prec_sloppy
void PGaugeExchangeFree()
Release all allocated memory used to exchange data between nodes.
void setTransferGPU(bool)
void CallUnitarizeLinks(quda::cudaGaugeField *cudaInGauge)
void Release()
Release Device memory for CURAND RNG states.
void setSpinorSiteSize(int n)
static bool reunit_svd_only
const char * get_recon_str(QudaReconstructType recon)
QudaReconstructType link_recon
Class declaration to initialize and hold CURAND RNG states.
void saveGaugeFieldQuda(void *outGauge, void *inGauge, QudaGaugeParam *param)
QudaGaugeFieldOrder order
QudaPrecision cuda_prec_sloppy
void InitGaugeField(cudaGaugeField &data)
Perform a cold start to the gauge field, identity SU(3) matrix, also fills the ghost links in multi-G...
static double svd_abs_error
QudaReconstructType reconstruct
int heatbath_num_overrelax_per_step
void setReunitarizationConsts()
void copyExtendedResidentGaugeQuda(void *resident_gauge, QudaFieldLocation loc)
QudaFieldLocation location
enum QudaReconstructType_s QudaReconstructType
Main header file for the QUDA library.
static double unitarize_eps
double heatbath_beta_value
#define device_malloc(size)
void setGaugeParam(QudaGaugeParam &gauge_param)
QudaReconstructType reconstruct
void Monte(cudaGaugeField &data, RNG &rngstate, double Beta, int nhb, int nover)
Perform heatbath and overrelaxation. Performs nhb heatbath steps followed by nover overrelaxation ste...
void initComms(int argc, char **argv, int *const commDims)
void read_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[])
cudaGaugeField * extendedGaugeResident
void copyExtendedGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out=0, void *In=0)
double3 plaquette(const GaugeField &U)
Compute the plaquette of the gauge field.
int comm_dim_partitioned(int dim)
void write_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[])
QudaGaugeParam newQudaGaugeParam(void)