20 #define MAX(a,b) ((a)>(b)?(a):(b))
21 #define DABS(a) ((a)<(0.)?(-(a)):(a))
32 const double unitarize_eps = 1e-14;
33 const double max_error = 1e-10;
34 const int reunit_allow_svd = 1;
35 const int reunit_svd_only = 0;
36 const double svd_rel_error = 1e-6;
37 const double svd_abs_error = 1e-6;
45 printfQuda(
"prec sloppy_prec link_recon sloppy_link_recon S_dimension T_dimension Ls_dimension\n");
55 int main(
int argc,
char **argv)
60 app->parse(argc, argv);
61 }
catch (
const CLI::ParseError &e) {
99 double time0 = -((double)clock());
102 using namespace quda;
114 int R[4] = {0,0,0,0};
116 for(
int dir=0; dir<4; ++dir) y[dir] =
gauge_param.
X[dir] + 2 * R[dir];
124 for(
int dir=0; dir<4; ++dir) gParamEx.r[dir] = R[dir];
127 RNG *randstates =
new RNG(*gauge, 1234);
137 printfQuda(
"Starting heatbath for beta = %f from a %s start\n", beta_value, strcmp(
latfile,
"") ?
"loaded" : (coldstart ?
"cold" :
"hot"));
138 printfQuda(
" %d Heatbath hits and %d overrelaxation hits per step\n", nhbsteps, novrsteps);
140 printfQuda(
" %d Measurement steps\n", nsteps);
174 printfQuda(
"Initial gauge field plaquette = %e topological charge = %e\n",
param.plaquette[0],
param.qcharge);
181 for (
int step = 1; step <= nwarm; ++step) {
182 Monte(*gaugeEx, *randstates, beta_value, nhbsteps, novrsteps);
185 if (*num_failures_h > 0)
errorQuda(
"Error in the unitarization\n");
198 printfQuda(
"step=0 plaquette = %e topological charge = %e\n",
param.plaquette[0],
param.qcharge);
202 for(
int step=1; step<=nsteps; ++step){
203 Monte( *gaugeEx, *randstates, beta_value, nhbsteps, novrsteps);
207 if (*num_failures_h > 0)
errorQuda(
"Error in the unitarization\n");
214 printfQuda(
"step=%d plaquette = %e topological charge = %e\n", step,
param.plaquette[0],
param.qcharge);
237 for (
int dir = 0; dir<4; dir++) free(cpu_gauge[dir]);
253 time0 /= CLOCKS_PER_SEC;
257 printfQuda(
"\nDone, total time = %g secs\n", time0);
269 for (
int dir = 0; dir<4; dir++) free(load_gauge[dir]);
QudaGaugeFieldOrder Order() const
Class declaration to initialize and hold CURAND RNG states.
int comm_dim_partitioned(int dim)
QudaReconstructType link_recon_sloppy
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
QudaReconstructType link_recon
int heatbath_num_heatbath_per_step
double heatbath_beta_value
int heatbath_num_overrelax_per_step
std::array< int, 4 > gridsize_from_cmdline
int heatbath_warmup_steps
QudaPrecision prec_sloppy
QudaGaugeParam gauge_param
@ QUDA_CUDA_FIELD_LOCATION
@ QUDA_RECONSTRUCT_INVALID
@ QUDA_GHOST_EXCHANGE_EXTENDED
int main(int argc, char **argv)
void setReunitarizationConsts()
int dimPartitioned(int dim)
void initComms(int argc, char **argv, std::array< int, 4 > &commDims)
void constructHostGaugeField(void **gauge, QudaGaugeParam &gauge_param, int argc, char **argv)
void setWilsonGaugeParam(QudaGaugeParam &gauge_param)
cudaGaugeField * extendedGaugeResident
#define get_mapped_device_pointer(ptr)
#define mapped_malloc(size)
const char * get_prec_str(QudaPrecision prec)
const char * get_recon_str(QudaReconstructType recon)
void Monte(GaugeField &data, RNG &rngstate, double Beta, int nhb, int nover)
Perform heatbath and overrelaxation. Performs nhb heatbath steps followed by nover overrelaxation ste...
void setUnitarizeLinksConstants(double unitarize_eps, double max_error, bool allow_svd, bool svd_only, double svd_rel_error, double svd_abs_error)
void InitGaugeField(GaugeField &data)
Perform a cold start to the gauge field, identity SU(3) matrix, also fills the ghost links in multi-G...
void PGaugeExchangeFree()
Release all allocated memory used to exchange data between nodes.
void unitarizeLinks(GaugeField &outfield, const GaugeField &infield, int *fails)
void setTransferGPU(bool)
void copyExtendedGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out=0, void *In=0)
void write_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[])
Main header file for the QUDA library.
QudaGaugeParam newQudaGaugeParam(void)
void saveGaugeFieldQuda(void *outGauge, void *inGauge, QudaGaugeParam *param)
void initQuda(int device)
QudaGaugeObservableParam newQudaGaugeObservableParam(void)
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
void copyExtendedResidentGaugeQuda(void *resident_gauge, QudaFieldLocation loc)
void gaugeObservablesQuda(QudaGaugeObservableParam *param)
Calculates a variety of gauge-field observables. If a smeared gauge field is presently loaded (in gau...
QudaReconstructType reconstruct
QudaFieldLocation location
QudaGaugeFieldOrder gauge_order
QudaReconstructType reconstruct
QudaGaugeFieldOrder order
void setPrecision(QudaPrecision precision, bool force_native=false)
Helper function for setting the precision and corresponding field order for QUDA internal fields.
QudaGhostExchange ghostExchange
QudaPrecision Precision() const