18 #define MAX(a, b) ((a) > (b) ? (a) : (b))
23 printfQuda(
"prec sloppy_prec link_recon sloppy_link_recon test_type S_dimension T_dimension\n");
38 printfQuda(
" - Operator: MdagM. Will compute SVD of M\n");
39 printfQuda(
" - ***********************************************************\n");
40 printfQuda(
" - **** Overriding any previous choices of operator type. ****\n");
41 printfQuda(
" - **** SVD demands normal operator, will use MdagM ****\n");
42 printfQuda(
" - ***********************************************************\n");
51 printfQuda(
" - Chebyshev polynomial maximum will be computed\n");
61 int main(
int argc,
char **argv)
68 CLI::TransformPairs<int> test_type_map {{
"full", 0}, {
"even", 3}, {
"odd", 4}};
69 app->add_option(
"--test",
test_type,
"Test method")->transform(CLI::CheckedTransformer(test_type_map));
72 app->parse(argc, argv);
73 }
catch (
const CLI::ParseError &e) {
111 errorQuda(
"ARPACK check only available in double precision");
121 void *qdp_inlink[4] = {
nullptr,
nullptr,
nullptr,
nullptr};
122 void *qdp_fatlink[4] = {
nullptr,
nullptr,
nullptr,
nullptr};
123 void *qdp_longlink[4] = {
nullptr,
nullptr,
nullptr,
nullptr};
124 void *milc_fatlink =
nullptr;
125 void *milc_longlink =
nullptr;
127 for (
int dir = 0; dir < 4; dir++) {
140 printfQuda(
"Computed plaquette is %e (spatial = %e, temporal = %e)\n", plaq[0], plaq[1], plaq[2]);
145 printfQuda(
"Computed fat link plaquette is %e (spatial = %e, temporal = %e)\n", plaq[0], plaq[1], plaq[2]);
158 void **host_evecs = (
void **)malloc(
eig_n_conv *
sizeof(
void *));
162 double _Complex *host_evals = (
double _Complex *)malloc(eig_param.
n_ev *
sizeof(
double _Complex));
178 time = -((double)clock());
180 time += (double)clock();
182 printfQuda(
"Time for %s solution = %f\n", eig_param.
arpack_check ?
"ARPACK" :
"QUDA", time / CLOCKS_PER_SEC);
185 default:
errorQuda(
"Unsupported test type");
190 for (
int i = 0; i <
eig_n_conv; i++) free(host_evecs[i]);
195 for (
int dir = 0; dir < 4; dir++) {
196 if (qdp_inlink[dir] !=
nullptr) {
197 free(qdp_inlink[dir]);
198 qdp_inlink[dir] =
nullptr;
200 if (qdp_fatlink[dir] !=
nullptr) {
201 free(qdp_fatlink[dir]);
202 qdp_fatlink[dir] =
nullptr;
204 if (qdp_longlink[dir] !=
nullptr) {
205 free(qdp_longlink[dir]);
206 qdp_longlink[dir] =
nullptr;
209 if (milc_fatlink !=
nullptr) {
211 milc_fatlink =
nullptr;
213 if (milc_longlink !=
nullptr) {
215 milc_longlink =
nullptr;
QudaReconstructType link_recon_sloppy
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
QudaReconstructType link_recon
QudaDslashType dslash_type
void add_eigen_option_group(std::shared_ptr< QUDAApp > quda_app)
QudaEigSpectrumType eig_spectrum
bool eig_require_convergence
std::array< int, 4 > gridsize_from_cmdline
QudaPrecision prec_sloppy
QudaGaugeParam gauge_param
@ QUDA_EIG_BLK_TR_LANCZOS
size_t host_gauge_data_type_size
int dimPartitioned(int dim)
void initComms(int argc, char **argv, std::array< int, 4 > &commDims)
void dw_setDims(int *X, const int L5)
void setQudaStaggeredEigTestParams()
void setStaggeredInvertParam(QudaInvertParam &inv_param)
#define stag_spinor_site_size
void reorderQDPtoMILC(void *milc_out, void **qdp_in, int V, int siteSize, QudaPrecision out_precision, QudaPrecision in_precision)
void setEigParam(QudaEigParam &eig_param)
void setStaggeredGaugeParam(QudaGaugeParam &gauge_param)
void constructStaggeredHostGaugeField(void **qdp_inlink, void **qdp_longlink, void **qdp_fatlink, QudaGaugeParam &gauge_param, int argc, char **argv)
void loadFatLongGaugeQuda(QudaInvertParam *inv_param, QudaGaugeParam *gauge_param, void *milc_fatlinks, void *milc_longlinks)
const char * get_prec_str(QudaPrecision prec)
const char * get_eig_spectrum_str(QudaEigSpectrumType type)
const char * get_dslash_str(QudaDslashType type)
const char * get_eig_type_str(QudaEigType type)
const char * get_staggered_test_type(int t)
const char * get_recon_str(QudaReconstructType recon)
Main header file for the QUDA library.
QudaGaugeParam newQudaGaugeParam(void)
void eigensolveQuda(void **h_evecs, double_complex *h_evals, QudaEigParam *param)
void initQuda(int device)
QudaInvertParam newQudaInvertParam(void)
QudaEigParam newQudaEigParam(void)
int main(int argc, char **argv)
void computeStaggeredPlaquetteQDPOrder(void **qdp_link, double plaq[3], const QudaGaugeParam &gauge_param_in, const QudaDslashType dslash_type)
QudaInvertParam * invert_param