18 #define MAX(a,b) ((a)>(b)?(a):(b))
24 printfQuda(
"prec sloppy_prec link_recon sloppy_link_recon S_dimension T_dimension\n");
42 printfQuda(
"\nOver-Improved Stout smearing\n");
93 int pad_size =
MAX(x_face_size, y_face_size);
94 pad_size =
MAX(pad_size, z_face_size);
95 pad_size =
MAX(pad_size, t_face_size);
100 int main(
int argc,
char **argv)
105 CLI::TransformPairs<int> test_type_map {{
"APE", 0}, {
"Stout", 1}, {
"Over-Improved Stout", 2}, {
"Wilson Flow", 3}};
106 app->add_option(
"--test",
test_type,
"Test method")->transform(CLI::CheckedTransformer(test_type_map));
109 app->parse(argc, argv);
110 }
catch (
const CLI::ParseError &e) {
126 void *gauge[4], *new_gauge[4];
128 for (
int dir = 0; dir < 4; dir++) {
147 printfQuda(
"Computed plaquette gauge precise is %.16e (spatial = %.16e, temporal = %.16e)\n", plaq[0], plaq[1],
150 #ifdef GPU_GAUGE_TOOLS
156 double q_charge_check = 0.0;
159 size_t array_size =
V * data_size;
160 void *qDensity = malloc(array_size);
162 double time0 = -((double)clock());
166 param.qcharge_density = qDensity;
172 time0 /= CLOCKS_PER_SEC;
173 printfQuda(
"Computed Etot, Es, Et, Q is\n%.16e %.16e, %.16e %.16e\nDone in %g secs\n",
param.energy[0],
178 for (
int i = 0; i <
V; i++) q_charge_check += ((
double *)qDensity)[i];
180 for (
int i = 0; i <
V; i++) q_charge_check += ((
float *)qDensity)[i];
186 printfQuda(
"GPU value %e and host density sum %e. Q charge deviation: %e\n",
param.qcharge, q_charge_check,
187 param.qcharge - q_charge_check);
198 time0 = -((double)clock());
202 time0 /= CLOCKS_PER_SEC;
203 printfQuda(
"Total time for APE = %g secs\n", time0);
208 time0 = -((double)clock());
212 time0 /= CLOCKS_PER_SEC;
213 printfQuda(
"Total time for STOUT = %g secs\n", time0);
221 time0 = -((double)clock());
225 time0 /= CLOCKS_PER_SEC;
226 printfQuda(
"Total time for Over Improved STOUT = %g secs\n", time0);
231 time0 = -((double)clock());
235 time0 /= CLOCKS_PER_SEC;
236 printfQuda(
"Total time for Wilson Flow = %g secs\n", time0);
242 printfQuda(
"Skipping other gauge tests since gauge tools have not been compiled\n");
251 for (
int dir = 0; dir < 4; dir++) {
253 free(new_gauge[dir]);
void comm_allreduce(double *data)
double stout_smear_epsilon
QudaReconstructType link_recon_sloppy
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
QudaReconstructType link_recon
void add_su3_option_group(std::shared_ptr< QUDAApp > quda_app)
std::array< int, 4 > gridsize_from_cmdline
QudaPrecision prec_sloppy
QudaGaugeParam gauge_param
@ QUDA_RECONSTRUCT_INVALID
size_t host_gauge_data_type_size
int dimPartitioned(int dim)
QudaPrecision & cuda_prec
void initComms(int argc, char **argv, std::array< int, 4 > &commDims)
QudaPrecision & cuda_prec_sloppy
void constructHostGaugeField(void **gauge, QudaGaugeParam &gauge_param, int argc, char **argv)
void check_gauge(void **oldG, void **newG, double epsilon, QudaPrecision precision)
const char * get_prec_str(QudaPrecision prec)
const char * get_recon_str(QudaReconstructType recon)
Main header file for the QUDA library.
void plaqQuda(double plaq[3])
void performAPEnStep(unsigned int n_steps, double alpha, int meas_interval)
QudaGaugeParam newQudaGaugeParam(void)
void initQuda(int device)
QudaGaugeObservableParam newQudaGaugeObservableParam(void)
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
void saveGaugeQuda(void *h_gauge, QudaGaugeParam *param)
void performWFlownStep(unsigned int n_steps, double step_size, int meas_interval, QudaWFlowType wflow_type)
void gaugeObservablesQuda(QudaGaugeObservableParam *param)
Calculates a variety of gauge-field observables. If a smeared gauge field is presently loaded (in gau...
void performSTOUTnStep(unsigned int n_steps, double rho, int meas_interval)
void performOvrImpSTOUTnStep(unsigned int n_steps, double rho, double epsilon, int meas_interval)
QudaReconstructType reconstruct
QudaPrecision cuda_prec_sloppy
QudaReconstructType reconstruct_sloppy
QudaGaugeFieldOrder gauge_order
int main(int argc, char **argv)
void setGaugeParam(QudaGaugeParam &gauge_param)
void setVerbosity(QudaVerbosity verbosity)