27 const double unitarize_eps = 1e-14;
28 const double max_error = 1e-10;
29 const int reunit_allow_svd = 1;
30 const int reunit_svd_only = 0;
31 const double svd_rel_error = 1e-6;
32 const double svd_abs_error = 1e-6;
34 reunit_allow_svd, reunit_svd_only,
35 svd_rel_error, svd_abs_error);
51 double prec_val = 1.0e-5;
53 if ((a0 < prec_val) && (a1 < prec_val) && (a2 < prec_val))
return true;
58 double prec_val = 5e-8;
60 if (
std::abs(1.0 - detu.x) < prec_val &&
std::abs(detu.y) < prec_val)
return true;
101 int R[4] = {0,0,0,0};
103 for(
int dir=0; dir<4; ++dir) y[dir] =
param.
X[dir] + 2 * R[dir];
112 for(
int dir=0; dir<4; ++dir) gParamEx.r[dir] = R[dir];
127 a0.Start(__func__, __FILE__, __LINE__);
128 a1.Start(__func__, __FILE__, __LINE__);
139 SetReunitarizationConsts();
142 for(
int step=1; step<=nsteps; ++step){
144 Monte(*U, *randstates, beta_value, nhbsteps, novrsteps);
150 if (*num_failures_h > 0)
errorQuda(
"Error in the unitarization\n");
154 a1.Stop(__func__, __FILE__, __LINE__);
156 printfQuda(
"Time Monte -> %.6f s\n", a1.Last());
158 printfQuda(
"Plaq: %.16e, %.16e, %.16e\n", plaq.x, plaq.y, plaq.z);
166 printfQuda(
"Det: %.16e:%.16e\n", detu.x, detu.y);
167 printfQuda(
"Tr: %.16e:%.16e\n", tru.x/3.0, tru.y/3.0);
173 a0.Stop(__func__, __FILE__, __LINE__);
175 randstates->Release();
198 bool testgen =
false;
200 if (plaq.x < 0.614 && plaq.x > 0.611 && plaq.y < 0.614 && plaq.y > 0.611) testgen =
true;
202 if (testgen) {
ASSERT_TRUE(CheckDeterminant(detu)); }
207 const int reunit_interval = 10;
208 printfQuda(
"Landau gauge fixing with overrelaxation\n");
211 printfQuda(
"Plaq: %.16e, %.16e, %.16e\n", plaq_gf.x, plaq_gf.y, plaq_gf.z);
217 const int reunit_interval = 10;
218 printfQuda(
"Coulomb gauge fixing with overrelaxation\n");
221 printfQuda(
"Plaq: %.16e, %.16e, %.16e\n", plaq_gf.x, plaq_gf.y, plaq_gf.z);
227 if (!checkDimsPartitioned()) {
228 printfQuda(
"Landau gauge fixing with steepest descent method with FFTs\n");
231 printfQuda(
"Plaq: %.16e, %.16e, %.16e\n", plaq_gf.x, plaq_gf.y, plaq_gf.z);
238 if (!checkDimsPartitioned()) {
239 printfQuda(
"Coulomb gauge fixing with steepest descent method with FFTs\n");
242 printfQuda(
"Plaq: %.16e, %.16e, %.16e\n", plaq_gf.x, plaq_gf.y, plaq_gf.z);
247 int main(
int argc,
char **argv)
258 app->parse(argc, argv);
259 }
catch (
const CLI::ParseError &e) {
bool CheckDeterminant(double2 detu)
bool comparePlaquette(double3 a, double3 b)
bool checkDimsPartitioned()
void SetReunitarizationConsts()
Class declaration to initialize and hold CURAND RNG states.
TestEventListener * Release(TestEventListener *listener)
TestEventListener * default_result_printer() const
TestEventListeners & listeners()
static UnitTest * GetInstance()
int comm_dim_partitioned(int dim)
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
QudaReconstructType link_recon
std::array< int, 4 > gridsize_from_cmdline
@ QUDA_GHOST_EXCHANGE_EXTENDED
int main(int argc, char **argv)
TEST_F(GaugeAlgTest, Generation)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
#define ASSERT_TRUE(condition)
void initComms(int argc, char **argv, std::array< int, 4 > &commDims)
#define get_mapped_device_pointer(ptr)
#define mapped_malloc(size)
double2 getLinkTrace(GaugeField &data)
Calculate the Trace.
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)
double3 plaquette(const GaugeField &U)
Compute the plaquette of the gauge field.
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 gaugeFixingFFT(GaugeField &data, const int gauge_dir, const int Nsteps, const int verbose_interval, const double alpha, const int autotune, const double tolerance, const int stopWtheta)
Gauge fixing with Steepest descent method with FFTs with support for single GPU only.
void PGaugeExchangeFree()
Release all allocated memory used to exchange data between nodes.
void gaugeFixingOVR(GaugeField &data, const int gauge_dir, const int Nsteps, const int verbose_interval, const double relax_boost, const double tolerance, const int reunit_interval, const int stopWtheta)
Gauge fixing with overrelaxation with support for single and multi GPU.
void unitarizeLinks(GaugeField &outfield, const GaugeField &infield, int *fails)
__host__ __device__ ValueType abs(ValueType x)
double2 getLinkDeterminant(GaugeField &data)
Calculate the Determinant.
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Main header file for the QUDA library.
QudaGaugeParam newQudaGaugeParam(void)
void initQuda(int device)
#define qudaDeviceSynchronize()
QudaReconstructType reconstruct
QudaPrecision cuda_prec_sloppy
QudaReconstructType reconstruct_sloppy
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
void setVerbosity(QudaVerbosity verbosity)