4 #include <externals/CLI11.hpp>
12 template <
typename T>
using mgarray = std::array<T, QUDA_MAX_MG_LEVEL>;
25 std::string option_description =
"",
bool defaulted =
false)
28 CLI::callback_t f = [&variable, &option_name, trans](CLI::results_t vals) {
34 for (
size_t i {0}; i < vals.size() / 2; ++i) {
35 auto levelok = validlevel(vals.at(2 * i));
36 auto transformok = trans(vals.at(2 * i + 1));
37 if (!levelok.empty())
throw CLI::ValidationError(option_name, levelok);
38 if (!transformok.empty())
throw CLI::ValidationError(option_name, transformok);
39 worked = worked and CLI::detail::lexical_cast(vals.at(2 * i), l);
40 worked = worked and CLI::detail::lexical_cast(vals.at(2 * i + 1), j);
42 if (worked) variable[l] = j;
46 CLI::Option *opt = add_option(option_name, f, option_description);
48 opt->type_name(valuename)->type_size(-2);
50 opt->check(CLI::Validator(trans.get_description()));
59 CLI::Validator trans,
std::string option_description =
"",
bool defaulted =
false)
62 CLI::callback_t f = [&variable, &option_name, trans](CLI::results_t vals) {
68 for (
size_t i {0}; i < vals.size() / 2; ++i) {
69 auto levelok = validlevel(vals.at(2 * i));
70 auto transformok = trans(vals.at(2 * i + 1));
71 if (!levelok.empty())
throw CLI::ValidationError(option_name, levelok);
72 if (!transformok.empty())
throw CLI::ValidationError(option_name, transformok);
73 worked = worked and CLI::detail::lexical_cast(vals.at(2 * i), l);
74 auto &j = variable[l];
75 worked = worked and CLI::detail::lexical_cast(vals.at(2 * i + 1), j);
81 CLI::Option *opt = add_option(option_name, f, option_description);
83 opt->type_name(valuename)->type_size(-2);
85 opt->check(CLI::Validator(trans.get_description()));
88 group->add_option(opt);
95 std::string option_description =
"",
bool defaulted =
false)
98 CLI::callback_t f = [&variable, &option_name, trans](CLI::results_t vals) {
104 for (
size_t i {0}; i < vals.size() / (4 + 1); ++i) {
105 auto levelok = validlevel(vals.at((4 + 1) * i));
107 if (!levelok.empty())
throw CLI::ValidationError(option_name, levelok);
108 worked = worked and CLI::detail::lexical_cast(vals.at((4 + 1) * i), l);
110 for (
int k = 0; k < 4; k++) {
111 auto transformok = trans(vals.at((4 + 1) * i + k + 1));
112 if (!transformok.empty())
throw CLI::ValidationError(option_name, transformok);
113 worked = worked and CLI::detail::lexical_cast(vals.at((4 + 1) * i + k + 1), j);
114 if (worked) variable[l][k] = j;
119 CLI::Option *opt = add_option(option_name, f, option_description);
121 opt->type_name(valuename)->type_size(-4 - 1);
123 opt->check(CLI::Validator(trans.get_description()));
126 group->add_option(opt);
142 = std::find_if(
map.begin(),
map.end(), [&val](
const decltype(
map.back()) &p) ->
bool { return p.second == val; });
169 extern std::array<int, 4>
dim;
QUDAApp(std::string app_description="", std::string app_name="")
CLI::Option * add_mgoption(std::string option_name, std::array< T, QUDA_MAX_MG_LEVEL > &variable, CLI::Validator trans, std::string option_description="", bool defaulted=false)
CLI::Option * add_mgoption(CLI::Option_group *group, std::string option_name, std::array< T, QUDA_MAX_MG_LEVEL > &variable, CLI::Validator trans, std::string option_description="", bool defaulted=false)
CLI::Option * add_mgoption(CLI::Option_group *group, std::string option_name, std::array< std::array< T, 4 >, QUDA_MAX_MG_LEVEL > &variable, CLI::Validator trans, std::string option_description="", bool defaulted=false)
QudaTransferType staggered_transfer_type
double stout_smear_epsilon
QudaInverterType precon_type
QudaPrecision prec_refinement_sloppy
quda::mgarray< int > num_setup_iter
bool eig_io_parity_inflate
quda::mgarray< int > mg_eig_poly_deg
QudaInverterType inv_type
quda::mgarray< QudaEigType > mg_eig_type
QudaReconstructType link_recon_sloppy
bool mg_eig_preserve_deflation
quda::mgarray< int > mg_eig_check_interval
quda::mgarray< char[256]> mg_vec_outfile
quda::mgarray< double > setup_ca_lambda_max
QudaExtLibType solver_ext_lib
QudaReconstructType link_recon
quda::mgarray< int > mg_eig_n_ev_deflate
quda::mgarray< bool > mg_eig
QudaPrecision eig_save_prec
quda::mgarray< QudaInverterType > coarse_solver
QudaReconstructType link_recon_precondition
quda::mgarray< QudaCABasis > coarse_solver_ca_basis
quda::mgarray< int > n_block_ortho
void add_multigrid_option_group(std::shared_ptr< QUDAApp > quda_app)
QudaTwistFlavorType twist_flavor
std::array< int, 4 > grid_partition
QudaBLASOperation blas_trans_b
quda::mgarray< int > coarse_solver_maxiter
quda::mgarray< char[256]> mg_vec_infile
quda::mgarray< int > nu_post
quda::mgarray< int > nu_pre
quda::mgarray< int > setup_ca_basis_size
quda::mgarray< int > mg_eig_n_kr
quda::mgarray< int > coarse_solver_ca_basis_size
std::shared_ptr< QUDAApp > make_app(std::string app_description="QUDA internal test", std::string app_name="")
std::string get_string(CLI::TransformPairs< T > &map, T val)
char eig_vec_outfile[256]
quda::mgarray< double > mg_eig_amin
quda::mgarray< QudaVerbosity > mg_verbosity
quda::mgarray< double > setup_ca_lambda_min
quda::mgarray< int > setup_maxiter
quda::mgarray< int > nvec
std::array< double, 2 > blas_alpha_re_im
void add_eofa_option_group(std::shared_ptr< QUDAApp > quda_app)
QudaBLASDataOrder blas_data_order
quda::mgarray< QudaCABasis > setup_ca_basis
quda::mgarray< QudaSchwarzType > mg_schwarz_type
QudaMemoryType mem_type_ritz
quda::mgarray< QudaEigSpectrumType > mg_eig_spectrum
quda::mgarray< int > mg_eig_max_restarts
QudaSolutionType solution_type
int heatbath_num_heatbath_per_step
QudaDslashType dslash_type
QudaTboundary fermion_t_boundary
quda::mgarray< bool > mg_eig_use_dagger
std::array< int, 3 > blas_leading_dims
quda::mgarray< double > mu_factor
QudaExtLibType deflation_ext_lib
quda::mgarray< double > coarse_solver_ca_lambda_max
bool alternative_reliable
int solution_accumulator_pipeline
std::array< int, 4 > dim_partitioned
std::array< int, 3 > blas_strides
quda::mgarray< int > mg_eig_n_ev
quda::mgarray< double > mg_eig_amax
void add_eigen_option_group(std::shared_ptr< QUDAApp > quda_app)
quda::mgarray< QudaInverterType > setup_inv
bool mg_evolve_thin_updates
std::array< double, 2 > blas_beta_re_im
quda::mgarray< double > setup_tol
QudaFieldLocation location_ritz
quda::mgarray< double > coarse_solver_ca_lambda_min
QudaEigSpectrumType eig_spectrum
quda::mgarray< bool > mg_eig_use_poly_acc
quda::mgarray< double > mg_eig_qr_tol
QudaPrecision prec_eigensolver
quda::mgarray< QudaSolveType > coarse_solve_type
std::array< int, 3 > blas_offsets
quda::mgarray< double > mg_eig_tol
QudaSchwarzType precon_schwarz_type
void add_deflation_option_group(std::shared_ptr< QUDAApp > quda_app)
quda::mgarray< int > mg_eig_batched_rotate
QudaPrecision prec_precondition
quda::mgarray< bool > mg_eig_use_normop
quda::mgarray< bool > mg_eig_use_eigen_qr
QudaReconstructType link_recon_eigensolver
quda::mgarray< QudaPrecision > mg_eig_save_prec
char eig_arpack_logfile[256]
void add_su3_option_group(std::shared_ptr< QUDAApp > quda_app)
quda::mgarray< double > smoother_tol
QudaContractType contract_type
double heatbath_beta_value
int heatbath_num_overrelax_per_step
quda::mgarray< QudaSolveType > smoother_solve_type
bool eig_require_convergence
quda::mgarray< bool > mg_eig_require_convergence
quda::mgarray< int > mg_eig_block_size
quda::mgarray< double > coarse_solver_tol
char eig_QUDA_logfile[256]
QudaPrecision smoother_halo_prec
std::array< int, 3 > blas_mnk
quda::mgarray< QudaInverterType > smoother_type
quda::mgarray< int > setup_maxiter_refresh
void add_comms_option_group(std::shared_ptr< QUDAApp > quda_app)
QudaBLASOperation blas_trans_a
quda::mgarray< int > mg_schwarz_cycle
std::array< int, 4 > gridsize_from_cmdline
int heatbath_warmup_steps
QudaMassNormalization normalization
QudaBLASDataType blas_data_type
quda::mgarray< std::array< int, 4 > > geo_block_size
QudaPrecision prec_sloppy
enum QudaSolveType_s QudaSolveType
enum QudaWFlowType_s QudaWFlowType
enum QudaBLASOperation_s QudaBLASOperation
enum QudaPrecision_s QudaPrecision
enum QudaTwistFlavorType_s QudaTwistFlavorType
enum QudaTransferType_s QudaTransferType
enum QudaBLASDataOrder_s QudaBLASDataOrder
enum QudaTboundary_s QudaTboundary
enum QudaDslashType_s QudaDslashType
enum QudaSolutionType_s QudaSolutionType
enum QudaEigSpectrumType_s QudaEigSpectrumType
enum QudaInverterType_s QudaInverterType
enum QudaFieldLocation_s QudaFieldLocation
enum QudaMassNormalization_s QudaMassNormalization
enum QudaBLASDataType_s QudaBLASDataType
enum QudaExtLibType_s QudaExtLibType
enum QudaEigType_s QudaEigType
enum QudaMatPCType_s QudaMatPCType
enum QudaSetupType_s QudaSetupType
enum QudaMemoryType_s QudaMemoryType
enum QudaReconstructType_s QudaReconstructType
enum QudaCABasis_s QudaCABasis
enum QudaContractType_s QudaContractType
enum QudaSchwarzType_s QudaSchwarzType
enum QudaVerbosity_s QudaVerbosity
std::map< TuneKey, TuneParam > map
std::array< T, QUDA_MAX_MG_LEVEL > mgarray
internal::ParamGenerator< T > Range(T start, T end, IncrementT step)
Main header file for the QUDA library.
#define QUDA_MAX_MG_LEVEL
Maximum number of multi-grid levels. This number may be increased if needed.