14 #if defined(QMP_COMMS) 16 #elif defined(MPI_COMMS) 43 #define MAX(a,b) ((a)>(b)?(a):(b)) 51 gauge_param.
X[0] =
xdim;
52 gauge_param.
X[1] =
ydim;
53 gauge_param.
X[2] =
zdim;
54 gauge_param.
X[3] =
tdim;
74 int x_face_size = gauge_param.
X[1]*gauge_param.
X[2]*gauge_param.
X[3]/2;
75 int y_face_size = gauge_param.
X[0]*gauge_param.
X[2]*gauge_param.
X[3]/2;
76 int z_face_size = gauge_param.
X[0]*gauge_param.
X[1]*gauge_param.
X[3]/2;
77 int t_face_size = gauge_param.
X[0]*gauge_param.
X[1]*gauge_param.
X[2]/2;
78 int pad_size =
MAX(x_face_size, y_face_size);
79 pad_size =
MAX(pad_size, z_face_size);
80 pad_size =
MAX(pad_size, t_face_size);
81 gauge_param.
ga_pad = pad_size;
86 extern void usage(
char**);
90 for (
int i = 1; i < argc; i++){
94 printf(
"ERROR: Invalid option:%s\n", argv[i]);
111 void *gauge[4], *new_gauge[4];
113 for (
int dir = 0; dir < 4; dir++) {
144 printfQuda(
"Computed plaquette gauge precise is %e (spatial = %e, temporal = %e)\n", plaq[0], plaq[1], plaq[2]);
146 #ifdef GPU_GAUGE_TOOLS 149 double qCharge = 0.0, qChargeCheck = 0.0;
151 double time0 = -((double)clock());
155 time0 /= CLOCKS_PER_SEC;
156 printfQuda(
"Computed topological charge gauge precise is %.16e Done in %g secs\n", qCharge, time0);
160 size_t array_size =
V * sSize;
162 void *qDensity = malloc(array_size);
167 for (
int i = 0; i <
V; i++) qChargeCheck += ((
double *)qDensity)[i];
169 for (
int i = 0; i <
V; i++) qChargeCheck += ((
float *)qDensity)[i];
171 printfQuda(
"Computed topological charge gauge precise from density function is %.16e\n", qCharge);
172 printfQuda(
"GPU value %e and host density sum %e. Q charge deviation: %e\n", qCharge, qChargeCheck,
173 qCharge - qChargeCheck);
178 unsigned int nSteps = 50;
179 double coeff_APE = 0.6;
180 double coeff_STOUT = coeff_APE/(2*(4-1));
184 time0 = -((double)clock());
188 time0 /= CLOCKS_PER_SEC;
189 printfQuda(
"Total time for STOUT = %g secs\n", time0);
191 printf(
"Computed topological charge after is %.16e \n", qCharge);
195 time0 = -((double)clock());
199 time0 /= CLOCKS_PER_SEC;
200 printfQuda(
"Total time for APE = %g secs\n", time0);
202 printfQuda(
"Computed topological charge after smearing is %.16e \n", qCharge);
209 time0 = -((double)clock());
213 time0 /= CLOCKS_PER_SEC;
214 printfQuda(
"Total time for Over Improved STOUT = %g secs\n", time0);
216 printfQuda(
"Computed topological charge after smearing is %.16e \n", qCharge);
219 printfQuda(
"Skipping other gauge tests since gauge tools have not been compiled\n");
228 for (
int dir = 0; dir < 4; dir++) {
230 free(new_gauge[dir]);
236 int main(
int argc,
char **argv) {
void performOvrImpSTOUTnStep(unsigned int nSteps, double rho, double epsilon)
QudaReconstructType reconstruct_sloppy
void construct_gauge_field(void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param)
enum QudaPrecision_s QudaPrecision
QudaPrecision & cuda_prec_sloppy
void performAPEnStep(unsigned int nSteps, double alpha)
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
int process_command_line_option(int argc, char **argv, int *idx)
void plaqQuda(double plaq[3])
QudaGaugeParam gauge_param
QudaGaugeFieldOrder gauge_order
int gridsize_from_cmdline[]
void initQuda(int device)
void saveGaugeQuda(void *h_gauge, QudaGaugeParam *param)
void SU3test(int argc, char **argv)
QudaPrecision cuda_prec_sloppy
QudaPrecision prec_sloppy
void setGaugeParam(QudaGaugeParam &gauge_param)
QudaReconstructType reconstruct
QudaReconstructType link_recon_sloppy
void check_gauge(void **oldG, void **newG, double epsilon, QudaPrecision precision)
void performSTOUTnStep(unsigned int nSteps, double rho)
QudaPrecision & cuda_prec
enum QudaReconstructType_s QudaReconstructType
Main header file for the QUDA library.
QudaReconstructType link_recon
enum QudaVerbosity_s QudaVerbosity
void initComms(int argc, char **argv, int *const commDims)
double qChargeDensityQuda(void *qDensity)
Calculates the topological charge from gaugeSmeared, if it exist, or from gaugePrecise if no smeared ...
void read_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[])
int main(int argc, char **argv)
void setVerbosity(QudaVerbosity verbosity)
QudaGaugeParam newQudaGaugeParam(void)