From c9e84d1faeef1297a871f44992b30e567b8e6a39 Mon Sep 17 00:00:00 2001 From: sy3394 Date: Wed, 15 Mar 2023 15:38:14 +0200 Subject: [PATCH 1/7] the result of running setup.py --- lyncs_quda/enums.py | 405 +++++++----------------------------------- lyncs_quda/structs.py | 388 ++-------------------------------------- 2 files changed, 84 insertions(+), 709 deletions(-) diff --git a/lyncs_quda/enums.py b/lyncs_quda/enums.py index df82cb1..88fd089 100644 --- a/lyncs_quda/enums.py +++ b/lyncs_quda/enums.py @@ -1,3 +1,4 @@ + "List of QUDA enumerations" # NOTE: This file is automathically generated by setup.py @@ -15,7 +16,7 @@ class qudaError_t(Enum): _prefix = "quda_" _suffix = "" - _values = {"success": 0, "error": 1, "error_uninitialized": 2} + _values = {'success': 0, 'error': 1, 'error_uninitialized': 2} class QudaMemoryType(Enum): @@ -28,7 +29,7 @@ class QudaMemoryType(Enum): _prefix = "quda_memory_" _suffix = "" - _values = {"device": 0, "pinned": 1, "mapped": 2, "invalid": -2147483648} + _values = {'device': 0, 'pinned': 1, 'mapped': 2, 'invalid': -2147483648} class QudaLinkType(Enum): @@ -49,20 +50,7 @@ class QudaLinkType(Enum): _prefix = "quda_" _suffix = "_links" - _values = { - "su3": 0, - "general": 1, - "three": 2, - "momentum": 3, - "coarse": 4, - "smeared": 5, - "wilson": 0, - "asqtad_fat": 1, - "asqtad_long": 2, - "asqtad_mom": 3, - "asqtad_general": 1, - "invalid": -2147483648, - } + _values = {'su3': 0, 'general': 1, 'three': 2, 'momentum': 3, 'coarse': 4, 'smeared': 5, 'wilson': 0, 'asqtad_fat': 1, 'asqtad_long': 2, 'asqtad_mom': 3, 'asqtad_general': 1, 'invalid': -2147483648} class QudaGaugeFieldOrder(Enum): @@ -85,22 +73,7 @@ class QudaGaugeFieldOrder(Enum): _prefix = "quda_" _suffix = "_gauge_order" - _values = { - "float": 1, - "float2": 2, - "float4": 4, - "float8": 8, - "native": 9, - "qdp": 10, - "qdpjit": 11, - "cps_wilson": 12, - "milc": 13, - "milc_site": 14, - "bqcd": 15, - "tifr": 16, - "tifr_padded": 17, - "invalid": -2147483648, - } + _values = {'float': 1, 'float2': 2, 'float4': 4, 'float8': 8, 'native': 9, 'qdp': 10, 'qdpjit': 11, 'cps_wilson': 12, 'milc': 13, 'milc_site': 14, 'bqcd': 15, 'tifr': 16, 'tifr_padded': 17, 'invalid': -2147483648} class QudaTboundary(Enum): @@ -112,11 +85,7 @@ class QudaTboundary(Enum): _prefix = "quda_" _suffix = "" - _values = { - "anti_periodic_t": -1, - "periodic_t": 1, - "invalid_t_boundary": -2147483648, - } + _values = {'anti_periodic_t': -1, 'periodic_t': 1, 'invalid_t_boundary': -2147483648} class QudaPrecision(Enum): @@ -130,13 +99,7 @@ class QudaPrecision(Enum): _prefix = "quda_" _suffix = "_precision" - _values = { - "quarter": 1, - "half": 2, - "single": 4, - "double": 8, - "invalid": -2147483648, - } + _values = {'quarter': 1, 'half': 2, 'single': 4, 'double': 8, 'invalid': -2147483648} class QudaReconstructType(Enum): @@ -152,15 +115,7 @@ class QudaReconstructType(Enum): _prefix = "quda_reconstruct_" _suffix = "" - _values = { - "no": 18, - "12": 12, - "8": 8, - "9": 9, - "13": 13, - "10": 10, - "invalid": -2147483648, - } + _values = {'no': 18, '12': 12, '8': 8, '9': 9, '13': 13, '10': 10, 'invalid': -2147483648} class QudaGaugeFixed(Enum): @@ -172,7 +127,7 @@ class QudaGaugeFixed(Enum): _prefix = "quda_gauge_fixed_" _suffix = "" - _values = {"no": 0, "yes": 1, "invalid": -2147483648} + _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} class QudaDslashType(Enum): @@ -195,22 +150,7 @@ class QudaDslashType(Enum): _prefix = "quda_" _suffix = "_dslash" - _values = { - "wilson": 0, - "clover_wilson": 1, - "clover_hasenbusch_twist": 2, - "domain_wall": 3, - "domain_wall_4d": 4, - "mobius_dwf": 5, - "mobius_dwf_eofa": 6, - "staggered": 7, - "asqtad": 8, - "twisted_mass": 9, - "twisted_clover": 10, - "laplace": 11, - "covdev": 12, - "invalid": -2147483648, - } + _values = {'wilson': 0, 'clover_wilson': 1, 'clover_hasenbusch_twist': 2, 'domain_wall': 3, 'domain_wall_4d': 4, 'mobius_dwf': 5, 'mobius_dwf_eofa': 6, 'staggered': 7, 'asqtad': 8, 'twisted_mass': 9, 'twisted_clover': 10, 'laplace': 11, 'covdev': 12, 'invalid': -2147483648} class QudaInverterType(Enum): @@ -243,32 +183,7 @@ class QudaInverterType(Enum): _prefix = "quda_" _suffix = "_inverter" - _values = { - "cg": 0, - "bicgstab": 1, - "gcr": 2, - "mr": 3, - "sd": 4, - "pcg": 5, - "eigcg": 6, - "inc_eigcg": 7, - "gmresdr": 8, - "gmresdr_proj": 9, - "gmresdr_sh": 10, - "fgmresdr": 11, - "mg": 12, - "bicgstabl": 13, - "cgne": 14, - "cgnr": 15, - "cg3": 16, - "cg3ne": 17, - "cg3nr": 18, - "ca_cg": 19, - "ca_cgne": 20, - "ca_cgnr": 21, - "ca_gcr": 22, - "invalid": -2147483648, - } + _values = {'cg': 0, 'bicgstab': 1, 'gcr': 2, 'mr': 3, 'sd': 4, 'pcg': 5, 'eigcg': 6, 'inc_eigcg': 7, 'gmresdr': 8, 'gmresdr_proj': 9, 'gmresdr_sh': 10, 'fgmresdr': 11, 'mg': 12, 'bicgstabl': 13, 'cgne': 14, 'cgnr': 15, 'cg3': 16, 'cg3ne': 17, 'cg3nr': 18, 'ca_cg': 19, 'ca_cgne': 20, 'ca_cgnr': 21, 'ca_gcr': 22, 'invalid': -2147483648} class QudaEigType(Enum): @@ -282,13 +197,7 @@ class QudaEigType(Enum): _prefix = "quda_eig_" _suffix = "" - _values = { - "tr_lanczos": 0, - "blk_tr_lanczos": 1, - "ir_arnoldi": 2, - "blk_ir_arnoldi": 3, - "invalid": -2147483648, - } + _values = {'tr_lanczos': 0, 'blk_tr_lanczos': 1, 'ir_arnoldi': 2, 'blk_ir_arnoldi': 3, 'invalid': -2147483648} class QudaEigSpectrumType(Enum): @@ -304,15 +213,7 @@ class QudaEigSpectrumType(Enum): _prefix = "quda_spectrum_" _suffix = "" - _values = { - "lm_eig": 0, - "sm_eig": 1, - "lr_eig": 2, - "sr_eig": 3, - "li_eig": 4, - "si_eig": 5, - "invalid": -2147483648, - } + _values = {'lm_eig': 0, 'sm_eig': 1, 'lr_eig': 2, 'sr_eig': 3, 'li_eig': 4, 'si_eig': 5, 'invalid': -2147483648} class QudaSolutionType(Enum): @@ -328,15 +229,7 @@ class QudaSolutionType(Enum): _prefix = "quda_" _suffix = "_solution" - _values = { - "mat": 0, - "matdag_mat": 1, - "matpc": 2, - "matpc_dag": 3, - "matpcdag_matpc": 4, - "matpcdag_matpc_shift": 5, - "invalid": -2147483648, - } + _values = {'mat': 0, 'matdag_mat': 1, 'matpc': 2, 'matpc_dag': 3, 'matpcdag_matpc': 4, 'matpcdag_matpc_shift': 5, 'invalid': -2147483648} class QudaSolveType(Enum): @@ -354,17 +247,7 @@ class QudaSolveType(Enum): _prefix = "quda_" _suffix = "_solve" - _values = { - "direct": 0, - "normop": 1, - "direct_pc": 2, - "normop_pc": 3, - "normerr": 4, - "normerr_pc": 5, - "normeq": 1, - "normeq_pc": 3, - "invalid": -2147483648, - } + _values = {'direct': 0, 'normop': 1, 'direct_pc': 2, 'normop_pc': 3, 'normerr': 4, 'normerr_pc': 5, 'normeq': 1, 'normeq_pc': 3, 'invalid': -2147483648} class QudaMultigridCycleType(Enum): @@ -378,13 +261,7 @@ class QudaMultigridCycleType(Enum): _prefix = "quda_mg_cycle_" _suffix = "" - _values = { - "vcycle": 0, - "fcycle": 1, - "wcycle": 2, - "recursive": 3, - "invalid": -2147483648, - } + _values = {'vcycle': 0, 'fcycle': 1, 'wcycle': 2, 'recursive': 3, 'invalid': -2147483648} class QudaSchwarzType(Enum): @@ -396,7 +273,7 @@ class QudaSchwarzType(Enum): _prefix = "quda_" _suffix = "_schwarz" - _values = {"additive": 0, "multiplicative": 1, "invalid": -2147483648} + _values = {'additive': 0, 'multiplicative': 1, 'invalid': -2147483648} class QudaAcceleratorType(Enum): @@ -407,7 +284,7 @@ class QudaAcceleratorType(Enum): _prefix = "quda_" _suffix = "_accelerator" - _values = {"madwf": 0, "invalid": -2147483648} + _values = {'madwf': 0, 'invalid': -2147483648} class QudaResidualType(Enum): @@ -420,12 +297,7 @@ class QudaResidualType(Enum): _prefix = "quda_" _suffix = "_residual" - _values = { - "l2_relative": 1, - "l2_absolute": 2, - "heavy_quark": 4, - "invalid": -2147483648, - } + _values = {'l2_relative': 1, 'l2_absolute': 2, 'heavy_quark': 4, 'invalid': -2147483648} class QudaCABasis(Enum): @@ -437,7 +309,7 @@ class QudaCABasis(Enum): _prefix = "quda_" _suffix = "_basis" - _values = {"power": 0, "chebyshev": 1, "invalid": -2147483648} + _values = {'power': 0, 'chebyshev': 1, 'invalid': -2147483648} class QudaMatPCType(Enum): @@ -451,13 +323,7 @@ class QudaMatPCType(Enum): _prefix = "quda_matpc_" _suffix = "" - _values = { - "even_even": 0, - "odd_odd": 1, - "even_even_asymmetric": 2, - "odd_odd_asymmetric": 3, - "invalid": -2147483648, - } + _values = {'even_even': 0, 'odd_odd': 1, 'even_even_asymmetric': 2, 'odd_odd_asymmetric': 3, 'invalid': -2147483648} class QudaDagType(Enum): @@ -469,7 +335,7 @@ class QudaDagType(Enum): _prefix = "quda_dag_" _suffix = "" - _values = {"no": 0, "yes": 1, "invalid": -2147483648} + _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} class QudaMassNormalization(Enum): @@ -482,7 +348,7 @@ class QudaMassNormalization(Enum): _prefix = "quda_" _suffix = "_normalization" - _values = {"kappa": 0, "mass": 1, "asymmetric_mass": 2, "invalid": -2147483648} + _values = {'kappa': 0, 'mass': 1, 'asymmetric_mass': 2, 'invalid': -2147483648} class QudaSolverNormalization(Enum): @@ -493,7 +359,7 @@ class QudaSolverNormalization(Enum): _prefix = "quda_" _suffix = "_normalization" - _values = {"default": 0, "source": 1} + _values = {'default': 0, 'source': 1} class QudaPreserveSource(Enum): @@ -505,7 +371,7 @@ class QudaPreserveSource(Enum): _prefix = "quda_preserve_source_" _suffix = "" - _values = {"no": 0, "yes": 1, "invalid": -2147483648} + _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} class QudaDiracFieldOrder(Enum): @@ -522,16 +388,7 @@ class QudaDiracFieldOrder(Enum): _prefix = "quda_" _suffix = "_dirac_order" - _values = { - "internal": 0, - "": 1, - "qdp": 2, - "qdpjit": 3, - "cps_wilson": 4, - "lex": 5, - "tifr_padded": 6, - "invalid": -2147483648, - } + _values = {'internal': 0, '': 1, 'qdp': 2, 'qdpjit': 3, 'cps_wilson': 4, 'lex': 5, 'tifr_padded': 6, 'invalid': -2147483648} class QudaCloverFieldOrder(Enum): @@ -548,16 +405,7 @@ class QudaCloverFieldOrder(Enum): _prefix = "quda_" _suffix = "_clover_order" - _values = { - "float": 1, - "float2": 2, - "float4": 4, - "float8": 8, - "packed": 9, - "qdpjit": 10, - "bqcd": 11, - "invalid": -2147483648, - } + _values = {'float': 1, 'float2': 2, 'float4': 4, 'float8': 8, 'packed': 9, 'qdpjit': 10, 'bqcd': 11, 'invalid': -2147483648} class QudaVerbosity(Enum): @@ -571,13 +419,7 @@ class QudaVerbosity(Enum): _prefix = "quda_" _suffix = "" - _values = { - "silent": 0, - "summarize": 1, - "verbose": 2, - "debug_verbose": 3, - "invalid_verbosity": -2147483648, - } + _values = {'silent': 0, 'summarize': 1, 'verbose': 2, 'debug_verbose': 3, 'invalid_verbosity': -2147483648} class QudaTune(Enum): @@ -589,7 +431,7 @@ class QudaTune(Enum): _prefix = "quda_tune_" _suffix = "" - _values = {"no": 0, "yes": 1, "invalid": -2147483648} + _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} class QudaPreserveDirac(Enum): @@ -601,7 +443,7 @@ class QudaPreserveDirac(Enum): _prefix = "quda_preserve_dirac_" _suffix = "" - _values = {"no": 0, "yes": 1, "invalid": -2147483648} + _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} class QudaParity(Enum): @@ -613,7 +455,7 @@ class QudaParity(Enum): _prefix = "quda_" _suffix = "_parity" - _values = {"even": 0, "odd": 1, "invalid": -2147483648} + _values = {'even': 0, 'odd': 1, 'invalid': -2147483648} class QudaDiracType(Enum): @@ -652,38 +494,7 @@ class QudaDiracType(Enum): _prefix = "quda_" _suffix = "_dirac" - _values = { - "wilson": 0, - "wilsonpc": 1, - "clover": 2, - "cloverpc": 3, - "clover_hasenbusch_twist": 4, - "clover_hasenbusch_twistpc": 5, - "domain_wall": 6, - "domain_wallpc": 7, - "domain_wall_4d": 8, - "domain_wall_4dpc": 9, - "mobius_domain_wall": 10, - "mobius_domain_wallpc": 11, - "mobius_domain_wall_eofa": 12, - "mobius_domain_wallpc_eofa": 13, - "staggered": 14, - "staggeredpc": 15, - "staggeredkd": 16, - "asqtad": 17, - "asqtadpc": 18, - "asqtadkd": 19, - "twisted_mass": 20, - "twisted_masspc": 21, - "twisted_clover": 22, - "twisted_cloverpc": 23, - "coarse": 24, - "coarsepc": 25, - "gauge_laplace": 26, - "gauge_laplacepc": 27, - "gauge_covdev": 28, - "invalid": -2147483648, - } + _values = {'wilson': 0, 'wilsonpc': 1, 'clover': 2, 'cloverpc': 3, 'clover_hasenbusch_twist': 4, 'clover_hasenbusch_twistpc': 5, 'domain_wall': 6, 'domain_wallpc': 7, 'domain_wall_4d': 8, 'domain_wall_4dpc': 9, 'mobius_domain_wall': 10, 'mobius_domain_wallpc': 11, 'mobius_domain_wall_eofa': 12, 'mobius_domain_wallpc_eofa': 13, 'staggered': 14, 'staggeredpc': 15, 'staggeredkd': 16, 'asqtad': 17, 'asqtadpc': 18, 'asqtadkd': 19, 'twisted_mass': 20, 'twisted_masspc': 21, 'twisted_clover': 22, 'twisted_cloverpc': 23, 'coarse': 24, 'coarsepc': 25, 'gauge_laplace': 26, 'gauge_laplacepc': 27, 'gauge_covdev': 28, 'invalid': -2147483648} class QudaFieldLocation(Enum): @@ -695,7 +506,7 @@ class QudaFieldLocation(Enum): _prefix = "quda_" _suffix = "_field_location" - _values = {"cpu": 1, "cuda": 2, "invalid": -2147483648} + _values = {'cpu': 1, 'cuda': 2, 'invalid': -2147483648} class QudaSiteSubset(Enum): @@ -707,7 +518,7 @@ class QudaSiteSubset(Enum): _prefix = "quda_" _suffix = "_site_subset" - _values = {"parity": 1, "full": 2, "invalid": -2147483648} + _values = {'parity': 1, 'full': 2, 'invalid': -2147483648} class QudaSiteOrder(Enum): @@ -720,7 +531,7 @@ class QudaSiteOrder(Enum): _prefix = "quda_" _suffix = "_site_order" - _values = {"lexicographic": 0, "even_odd": 1, "odd_even": 2, "invalid": -2147483648} + _values = {'lexicographic': 0, 'even_odd': 1, 'odd_even': 2, 'invalid': -2147483648} class QudaFieldOrder(Enum): @@ -739,18 +550,7 @@ class QudaFieldOrder(Enum): _prefix = "quda_" _suffix = "_field_order" - _values = { - "float": 1, - "float2": 2, - "float4": 4, - "float8": 8, - "space_spin_color": 9, - "space_color_spin": 10, - "qdpjit": 11, - "qop_domain_wall": 12, - "padded_space_spin_color": 13, - "invalid": -2147483648, - } + _values = {'float': 1, 'float2': 2, 'float4': 4, 'float8': 8, 'space_spin_color': 9, 'space_color_spin': 10, 'qdpjit': 11, 'qop_domain_wall': 12, 'padded_space_spin_color': 13, 'invalid': -2147483648} class QudaFieldCreate(Enum): @@ -765,14 +565,7 @@ class QudaFieldCreate(Enum): _prefix = "quda_" _suffix = "_field_create" - _values = { - "null": 0, - "zero": 1, - "copy": 2, - "reference": 3, - "ghost": 4, - "invalid": -2147483648, - } + _values = {'null': 0, 'zero': 1, 'copy': 2, 'reference': 3, 'ghost': 4, 'invalid': -2147483648} class QudaGammaBasis(Enum): @@ -785,7 +578,7 @@ class QudaGammaBasis(Enum): _prefix = "quda_" _suffix = "_gamma_basis" - _values = {"degrand_rossi": 0, "ukqcd": 1, "chiral": 2, "invalid": -2147483648} + _values = {'degrand_rossi': 0, 'ukqcd': 1, 'chiral': 2, 'invalid': -2147483648} class QudaSourceType(Enum): @@ -800,14 +593,7 @@ class QudaSourceType(Enum): _prefix = "quda_" _suffix = "_source" - _values = { - "point": 0, - "random": 1, - "constant": 2, - "sinusoidal": 3, - "corner": 4, - "invalid": -2147483648, - } + _values = {'point': 0, 'random': 1, 'constant': 2, 'sinusoidal': 3, 'corner': 4, 'invalid': -2147483648} class QudaNoiseType(Enum): @@ -819,7 +605,7 @@ class QudaNoiseType(Enum): _prefix = "quda_noise_" _suffix = "" - _values = {"gauss": 0, "uniform": 1, "invalid": -2147483648} + _values = {'gauss': 0, 'uniform': 1, 'invalid': -2147483648} class QudaDilutionType(Enum): @@ -833,13 +619,7 @@ class QudaDilutionType(Enum): _prefix = "quda_dilution_" _suffix = "" - _values = { - "spin": 0, - "color": 1, - "spin_color": 2, - "spin_color_even_odd": 3, - "invalid": -2147483648, - } + _values = {'spin': 0, 'color': 1, 'spin_color': 2, 'spin_color_even_odd': 3, 'invalid': -2147483648} class QudaProjectionType(Enum): @@ -851,7 +631,7 @@ class QudaProjectionType(Enum): _prefix = "quda_" _suffix = "_projection" - _values = {"minres": 0, "galerkin": 1, "invalid": -2147483648} + _values = {'minres': 0, 'galerkin': 1, 'invalid': -2147483648} class QudaPCType(Enum): @@ -863,7 +643,7 @@ class QudaPCType(Enum): _prefix = "quda_" _suffix = "" - _values = {"4d_pc": 4, "5d_pc": 5, "pc_invalid": -2147483648} + _values = {'4d_pc': 4, '5d_pc': 5, 'pc_invalid': -2147483648} class QudaTwistFlavorType(Enum): @@ -876,7 +656,7 @@ class QudaTwistFlavorType(Enum): _prefix = "quda_twist_" _suffix = "" - _values = {"singlet": 1, "nondeg_doublet": 2, "no": 0, "invalid": -2147483648} + _values = {'singlet': 1, 'nondeg_doublet': 2, 'no': 0, 'invalid': -2147483648} class QudaTwistDslashType(Enum): @@ -890,13 +670,7 @@ class QudaTwistDslashType(Enum): _prefix = "quda_" _suffix = "" - _values = { - "deg_twist_inv_dslash": 0, - "deg_dslash_twist_inv": 1, - "deg_dslash_twist_xpay": 2, - "nondeg_dslash": 3, - "dslash_invalid": -2147483648, - } + _values = {'deg_twist_inv_dslash': 0, 'deg_dslash_twist_inv': 1, 'deg_dslash_twist_xpay': 2, 'nondeg_dslash': 3, 'dslash_invalid': -2147483648} class QudaTwistCloverDslashType(Enum): @@ -909,12 +683,7 @@ class QudaTwistCloverDslashType(Enum): _prefix = "quda_" _suffix = "" - _values = { - "deg_clover_twist_inv_dslash": 0, - "deg_dslash_clover_twist_inv": 1, - "deg_dslash_clover_twist_xpay": 2, - "tc_dslash_invalid": -2147483648, - } + _values = {'deg_clover_twist_inv_dslash': 0, 'deg_dslash_clover_twist_inv': 1, 'deg_dslash_clover_twist_xpay': 2, 'tc_dslash_invalid': -2147483648} class QudaTwistGamma5Type(Enum): @@ -926,7 +695,7 @@ class QudaTwistGamma5Type(Enum): _prefix = "quda_twist_gamma5_" _suffix = "" - _values = {"direct": 0, "inverse": 1, "invalid": -2147483648} + _values = {'direct': 0, 'inverse': 1, 'invalid': -2147483648} class QudaUseInitGuess(Enum): @@ -938,7 +707,7 @@ class QudaUseInitGuess(Enum): _prefix = "quda_use_init_guess_" _suffix = "" - _values = {"no": 0, "yes": 1, "invalid": -2147483648} + _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} class QudaDeflatedGuess(Enum): @@ -950,7 +719,7 @@ class QudaDeflatedGuess(Enum): _prefix = "quda_deflated_guess_" _suffix = "" - _values = {"no": 0, "yes": 1, "invalid": -2147483648} + _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} class QudaComputeNullVector(Enum): @@ -962,7 +731,7 @@ class QudaComputeNullVector(Enum): _prefix = "quda_compute_null_vector_" _suffix = "" - _values = {"no": 0, "yes": 1, "invalid": -2147483648} + _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} class QudaSetupType(Enum): @@ -974,11 +743,7 @@ class QudaSetupType(Enum): _prefix = "quda_" _suffix = "" - _values = { - "null_vector_setup": 0, - "test_vector_setup": 1, - "invalid_setup_type": -2147483648, - } + _values = {'null_vector_setup': 0, 'test_vector_setup': 1, 'invalid_setup_type': -2147483648} class QudaTransferType(Enum): @@ -992,13 +757,7 @@ class QudaTransferType(Enum): _prefix = "quda_transfer_" _suffix = "" - _values = { - "aggregate": 0, - "coarse_kd": 1, - "optimized_kd": 2, - "optimized_kd_drop_long": 3, - "invalid": -2147483648, - } + _values = {'aggregate': 0, 'coarse_kd': 1, 'optimized_kd': 2, 'optimized_kd_drop_long': 3, 'invalid': -2147483648} class QudaBoolean(Enum): @@ -1010,7 +769,7 @@ class QudaBoolean(Enum): _prefix = "quda_boolean_" _suffix = "" - _values = {"false": 0, "true": 1, "invalid": -2147483648} + _values = {'false': 0, 'true': 1, 'invalid': -2147483648} class QudaBLASType(Enum): @@ -1022,7 +781,7 @@ class QudaBLASType(Enum): _prefix = "quda_blas_" _suffix = "" - _values = {"gemm": 0, "lu_inv": 1, "invalid": -2147483648} + _values = {'gemm': 0, 'lu_inv': 1, 'invalid': -2147483648} class QudaBLASOperation(Enum): @@ -1035,7 +794,7 @@ class QudaBLASOperation(Enum): _prefix = "quda_blas_op_" _suffix = "" - _values = {"n": 0, "t": 1, "c": 2, "invalid": -2147483648} + _values = {'n': 0, 't': 1, 'c': 2, 'invalid': -2147483648} class QudaBLASDataType(Enum): @@ -1049,7 +808,7 @@ class QudaBLASDataType(Enum): _prefix = "quda_blas_datatype_" _suffix = "" - _values = {"s": 0, "d": 1, "c": 2, "z": 3, "invalid": -2147483648} + _values = {'s': 0, 'd': 1, 'c': 2, 'z': 3, 'invalid': -2147483648} class QudaBLASDataOrder(Enum): @@ -1061,7 +820,7 @@ class QudaBLASDataOrder(Enum): _prefix = "quda_blas_dataorder_" _suffix = "" - _values = {"row": 0, "col": 1, "invalid": -2147483648} + _values = {'row': 0, 'col': 1, 'invalid': -2147483648} class QudaDirection(Enum): @@ -1074,7 +833,7 @@ class QudaDirection(Enum): _prefix = "quda_" _suffix = "" - _values = {"backwards": -1, "in_place": 0, "forwards": 1, "both_dirs": 2} + _values = {'backwards': -1, 'in_place': 0, 'forwards': 1, 'both_dirs': 2} class QudaLinkDirection(Enum): @@ -1086,7 +845,7 @@ class QudaLinkDirection(Enum): _prefix = "quda_link_" _suffix = "" - _values = {"backwards": 0, "forwards": 1, "bidirectional": 2} + _values = {'backwards': 0, 'forwards': 1, 'bidirectional': 2} class QudaFieldGeometry(Enum): @@ -1101,14 +860,7 @@ class QudaFieldGeometry(Enum): _prefix = "quda_" _suffix = "_geometry" - _values = { - "scalar": 1, - "vector": 4, - "tensor": 6, - "coarse": 8, - "kdinverse": 16, - "invalid": -2147483648, - } + _values = {'scalar': 1, 'vector': 4, 'tensor': 6, 'coarse': 8, 'kdinverse': 16, 'invalid': -2147483648} class QudaGhostExchange(Enum): @@ -1121,7 +873,7 @@ class QudaGhostExchange(Enum): _prefix = "quda_ghost_exchange_" _suffix = "" - _values = {"no": 0, "pad": 1, "extended": 2, "invalid": -2147483648} + _values = {'no': 0, 'pad': 1, 'extended': 2, 'invalid': -2147483648} class QudaStaggeredPhase(Enum): @@ -1135,7 +887,7 @@ class QudaStaggeredPhase(Enum): _prefix = "quda_staggered_phase_" _suffix = "" - _values = {"no": 0, "milc": 1, "cps": 2, "tifr": 3, "invalid": -2147483648} + _values = {'no': 0, 'milc': 1, 'cps': 2, 'tifr': 3, 'invalid': -2147483648} class QudaContractType(Enum): @@ -1147,7 +899,7 @@ class QudaContractType(Enum): _prefix = "quda_contract_type_" _suffix = "" - _values = {"open": 0, "dr": 1, "invalid": -2147483648} + _values = {'open': 0, 'dr': 1, 'invalid': -2147483648} class QudaContractGamma(Enum): @@ -1173,25 +925,7 @@ class QudaContractGamma(Enum): _prefix = "quda_contract_gamma_" _suffix = "" - _values = { - "i": 0, - "g1": 1, - "g2": 2, - "g3": 3, - "g4": 4, - "g5": 5, - "g1g5": 6, - "g2g5": 7, - "g3g5": 8, - "g4g5": 9, - "s12": 10, - "s13": 11, - "s14": 12, - "s21": 13, - "s23": 14, - "s34": 15, - "invalid": -2147483648, - } + _values = {'i': 0, 'g1': 1, 'g2': 2, 'g3': 3, 'g4': 4, 'g5': 5, 'g1g5': 6, 'g2g5': 7, 'g3g5': 8, 'g4g5': 9, 's12': 10, 's13': 11, 's14': 12, 's21': 13, 's23': 14, 's34': 15, 'invalid': -2147483648} class QudaGaugeSmearType(Enum): @@ -1206,14 +940,7 @@ class QudaGaugeSmearType(Enum): _prefix = "quda_gauge_smear_" _suffix = "" - _values = { - "ape": 0, - "stout": 1, - "ovrimp_stout": 2, - "wilson_flow": 3, - "symanzik_flow": 4, - "invalid": -2147483648, - } + _values = {'ape': 0, 'stout': 1, 'ovrimp_stout': 2, 'wilson_flow': 3, 'symanzik_flow': 4, 'invalid': -2147483648} class QudaExtLibType(Enum): @@ -1225,4 +952,4 @@ class QudaExtLibType(Enum): _prefix = "quda_" _suffix = "" - _values = {"cusolve_extlib": 0, "eigen_extlib": 1, "extlib_invalid": -2147483648} + _values = {'cusolve_extlib': 0, 'eigen_extlib': 1, 'extlib_invalid': -2147483648} diff --git a/lyncs_quda/structs.py b/lyncs_quda/structs.py index 2f92eef..09fe839 100644 --- a/lyncs_quda/structs.py +++ b/lyncs_quda/structs.py @@ -1,3 +1,4 @@ + "List of QUDA parameter structures" # NOTE: This file is automathically generated by setup.py @@ -53,49 +54,7 @@ class QudaGaugeParam(Struct): - site_size : Size of MILC site struct (only if gauge_order=MILC_SITE_GAUGE_ORDER) """ - _types = { - "struct_size": "size_t", - "location": "QudaFieldLocation", - "X": "int [ 4 ]", - "anisotropy": "double", - "tadpole_coeff": "double", - "scale": "double", - "type": "QudaLinkType", - "gauge_order": "QudaGaugeFieldOrder", - "t_boundary": "QudaTboundary", - "cpu_prec": "QudaPrecision", - "cuda_prec": "QudaPrecision", - "reconstruct": "QudaReconstructType", - "cuda_prec_sloppy": "QudaPrecision", - "reconstruct_sloppy": "QudaReconstructType", - "cuda_prec_refinement_sloppy": "QudaPrecision", - "reconstruct_refinement_sloppy": "QudaReconstructType", - "cuda_prec_precondition": "QudaPrecision", - "reconstruct_precondition": "QudaReconstructType", - "cuda_prec_eigensolver": "QudaPrecision", - "reconstruct_eigensolver": "QudaReconstructType", - "gauge_fix": "QudaGaugeFixed", - "ga_pad": "int", - "site_ga_pad": "int", - "staple_pad": "int", - "llfat_ga_pad": "int", - "mom_ga_pad": "int", - "staggered_phase_type": "QudaStaggeredPhase", - "staggered_phase_applied": "int", - "i_mu": "double", - "overlap": "int", - "overwrite_gauge": "int", - "overwrite_mom": "int", - "use_resident_gauge": "int", - "use_resident_mom": "int", - "make_resident_gauge": "int", - "make_resident_mom": "int", - "return_result_gauge": "int", - "return_result_mom": "int", - "gauge_offset": "size_t", - "mom_offset": "size_t", - "site_size": "size_t", - } + _types = {'struct_size': 'size_t', 'location': 'QudaFieldLocation', 'X': 'int [ 4 ]', 'anisotropy': 'double', 'tadpole_coeff': 'double', 'scale': 'double', 'type': 'QudaLinkType', 'gauge_order': 'QudaGaugeFieldOrder', 't_boundary': 'QudaTboundary', 'cpu_prec': 'QudaPrecision', 'cuda_prec': 'QudaPrecision', 'reconstruct': 'QudaReconstructType', 'cuda_prec_sloppy': 'QudaPrecision', 'reconstruct_sloppy': 'QudaReconstructType', 'cuda_prec_refinement_sloppy': 'QudaPrecision', 'reconstruct_refinement_sloppy': 'QudaReconstructType', 'cuda_prec_precondition': 'QudaPrecision', 'reconstruct_precondition': 'QudaReconstructType', 'cuda_prec_eigensolver': 'QudaPrecision', 'reconstruct_eigensolver': 'QudaReconstructType', 'gauge_fix': 'QudaGaugeFixed', 'ga_pad': 'int', 'site_ga_pad': 'int', 'staple_pad': 'int', 'llfat_ga_pad': 'int', 'mom_ga_pad': 'int', 'staggered_phase_type': 'QudaStaggeredPhase', 'staggered_phase_applied': 'int', 'i_mu': 'double', 'overlap': 'int', 'overwrite_gauge': 'int', 'overwrite_mom': 'int', 'use_resident_gauge': 'int', 'use_resident_mom': 'int', 'make_resident_gauge': 'int', 'make_resident_mom': 'int', 'return_result_gauge': 'int', 'return_result_mom': 'int', 'gauge_offset': 'size_t', 'mom_offset': 'size_t', 'site_size': 'size_t'} class QudaInvertParam(Struct): @@ -117,10 +76,10 @@ class QudaInvertParam(Struct): * eofa_pm: plus or minus for the EOFA operator * mq1, mq2, mq3 are the three masses corresponds to Hasenbusch mass spliting. * As far as I know mq1 is always the same as "mass" but it's here just for consistence. - - eofa_pm : - - mq1 : - - mq2 : - - mq3 : + - eofa_pm : + - mq1 : + - mq2 : + - mq3 : - mu : Twisted mass parameter - tm_rho : Hasenbusch mass shift applied like twisted mass to diagonal (but not inverse) - epsilon : Twisted mass parameter @@ -281,150 +240,7 @@ class QudaInvertParam(Struct): - use_mobius_fused_kernel : Whether to use fused kernels for mobius """ - _types = { - "struct_size": "size_t", - "input_location": "QudaFieldLocation", - "output_location": "QudaFieldLocation", - "dslash_type": "QudaDslashType", - "inv_type": "QudaInverterType", - "mass": "double", - "kappa": "double", - "m5": "double", - "Ls": "int", - "b_5": "double_complex [ QUDA_MAX_DWF_LS ]", - "c_5": "double_complex [ QUDA_MAX_DWF_LS ]", - "eofa_shift": "double", - "eofa_pm": "int", - "mq1": "double", - "mq2": "double", - "mq3": "double", - "mu": "double", - "tm_rho": "double", - "epsilon": "double", - "twist_flavor": "QudaTwistFlavorType", - "laplace3D": "int", - "tol": "double", - "tol_restart": "double", - "tol_hq": "double", - "compute_true_res": "int", - "true_res": "double", - "true_res_hq": "double", - "maxiter": "int", - "reliable_delta": "double", - "reliable_delta_refinement": "double", - "use_alternative_reliable": "int", - "use_sloppy_partial_accumulator": "int", - "solution_accumulator_pipeline": "int", - "max_res_increase": "int", - "max_res_increase_total": "int", - "max_hq_res_increase": "int", - "max_hq_res_restart_total": "int", - "heavy_quark_check": "int", - "pipeline": "int", - "num_offset": "int", - "num_src": "int", - "num_src_per_sub_partition": "int", - "split_grid": "int [ QUDA_MAX_DIM ]", - "overlap": "int", - "offset": "double [ QUDA_MAX_MULTI_SHIFT ]", - "tol_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", - "tol_hq_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", - "true_res_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", - "iter_res_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", - "true_res_hq_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", - "residue": "double [ QUDA_MAX_MULTI_SHIFT ]", - "compute_action": "int", - "action": "double [ 2 ]", - "solution_type": "QudaSolutionType", - "solve_type": "QudaSolveType", - "matpc_type": "QudaMatPCType", - "dagger": "QudaDagType", - "mass_normalization": "QudaMassNormalization", - "solver_normalization": "QudaSolverNormalization", - "preserve_source": "QudaPreserveSource", - "cpu_prec": "QudaPrecision", - "cuda_prec": "QudaPrecision", - "cuda_prec_sloppy": "QudaPrecision", - "cuda_prec_refinement_sloppy": "QudaPrecision", - "cuda_prec_precondition": "QudaPrecision", - "cuda_prec_eigensolver": "QudaPrecision", - "dirac_order": "QudaDiracFieldOrder", - "gamma_basis": "QudaGammaBasis", - "clover_location": "QudaFieldLocation", - "clover_cpu_prec": "QudaPrecision", - "clover_cuda_prec": "QudaPrecision", - "clover_cuda_prec_sloppy": "QudaPrecision", - "clover_cuda_prec_refinement_sloppy": "QudaPrecision", - "clover_cuda_prec_precondition": "QudaPrecision", - "clover_cuda_prec_eigensolver": "QudaPrecision", - "clover_order": "QudaCloverFieldOrder", - "use_init_guess": "QudaUseInitGuess", - "clover_csw": "double", - "clover_coeff": "double", - "clover_rho": "double", - "compute_clover_trlog": "int", - "trlogA": "double [ 2 ]", - "compute_clover": "int", - "compute_clover_inverse": "int", - "return_clover": "int", - "return_clover_inverse": "int", - "verbosity": "QudaVerbosity", - "iter": "int", - "gflops": "double", - "secs": "double", - "tune": "QudaTune", - "Nsteps": "int", - "gcrNkrylov": "int", - "inv_type_precondition": "QudaInverterType", - "preconditioner": "void *", - "deflation_op": "void *", - "eig_param": "void *", - "deflate": "QudaBoolean", - "dslash_type_precondition": "QudaDslashType", - "verbosity_precondition": "QudaVerbosity", - "tol_precondition": "double", - "maxiter_precondition": "int", - "omega": "double", - "ca_basis": "QudaCABasis", - "ca_lambda_min": "double", - "ca_lambda_max": "double", - "ca_basis_precondition": "QudaCABasis", - "ca_lambda_min_precondition": "double", - "ca_lambda_max_precondition": "double", - "precondition_cycle": "int", - "schwarz_type": "QudaSchwarzType", - "accelerator_type_precondition": "QudaAcceleratorType", - "madwf_diagonal_suppressor": "double", - "madwf_ls": "int", - "madwf_null_miniter": "int", - "madwf_null_tol": "double", - "madwf_train_maxiter": "int", - "madwf_param_load": "QudaBoolean", - "madwf_param_save": "QudaBoolean", - "madwf_param_infile": "char [ 256 ]", - "madwf_param_outfile": "char [ 256 ]", - "residual_type": "QudaResidualType", - "cuda_prec_ritz": "QudaPrecision", - "n_ev": "int", - "max_search_dim": "int", - "rhs_idx": "int", - "deflation_grid": "int", - "eigenval_tol": "double", - "eigcg_max_restarts": "int", - "max_restart_num": "int", - "inc_tol": "double", - "make_resident_solution": "int", - "use_resident_solution": "int", - "chrono_make_resident": "int", - "chrono_replace_last": "int", - "chrono_use_resident": "int", - "chrono_max_dim": "int", - "chrono_index": "int", - "chrono_precision": "QudaPrecision", - "extlib_type": "QudaExtLibType", - "native_blas_lapack": "QudaBoolean", - "use_mobius_fused_kernel": "QudaBoolean", - } + _types = {'struct_size': 'size_t', 'input_location': 'QudaFieldLocation', 'output_location': 'QudaFieldLocation', 'dslash_type': 'QudaDslashType', 'inv_type': 'QudaInverterType', 'mass': 'double', 'kappa': 'double', 'm5': 'double', 'Ls': 'int', 'b_5': 'double_complex [ QUDA_MAX_DWF_LS ]', 'c_5': 'double_complex [ QUDA_MAX_DWF_LS ]', 'eofa_shift': 'double', 'eofa_pm': 'int', 'mq1': 'double', 'mq2': 'double', 'mq3': 'double', 'mu': 'double', 'tm_rho': 'double', 'epsilon': 'double', 'twist_flavor': 'QudaTwistFlavorType', 'laplace3D': 'int', 'tol': 'double', 'tol_restart': 'double', 'tol_hq': 'double', 'compute_true_res': 'int', 'true_res': 'double', 'true_res_hq': 'double', 'maxiter': 'int', 'reliable_delta': 'double', 'reliable_delta_refinement': 'double', 'use_alternative_reliable': 'int', 'use_sloppy_partial_accumulator': 'int', 'solution_accumulator_pipeline': 'int', 'max_res_increase': 'int', 'max_res_increase_total': 'int', 'max_hq_res_increase': 'int', 'max_hq_res_restart_total': 'int', 'heavy_quark_check': 'int', 'pipeline': 'int', 'num_offset': 'int', 'num_src': 'int', 'num_src_per_sub_partition': 'int', 'split_grid': 'int [ QUDA_MAX_DIM ]', 'overlap': 'int', 'offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'tol_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'tol_hq_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'true_res_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'iter_res_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'true_res_hq_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'residue': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'compute_action': 'int', 'action': 'double [ 2 ]', 'solution_type': 'QudaSolutionType', 'solve_type': 'QudaSolveType', 'matpc_type': 'QudaMatPCType', 'dagger': 'QudaDagType', 'mass_normalization': 'QudaMassNormalization', 'solver_normalization': 'QudaSolverNormalization', 'preserve_source': 'QudaPreserveSource', 'cpu_prec': 'QudaPrecision', 'cuda_prec': 'QudaPrecision', 'cuda_prec_sloppy': 'QudaPrecision', 'cuda_prec_refinement_sloppy': 'QudaPrecision', 'cuda_prec_precondition': 'QudaPrecision', 'cuda_prec_eigensolver': 'QudaPrecision', 'dirac_order': 'QudaDiracFieldOrder', 'gamma_basis': 'QudaGammaBasis', 'clover_location': 'QudaFieldLocation', 'clover_cpu_prec': 'QudaPrecision', 'clover_cuda_prec': 'QudaPrecision', 'clover_cuda_prec_sloppy': 'QudaPrecision', 'clover_cuda_prec_refinement_sloppy': 'QudaPrecision', 'clover_cuda_prec_precondition': 'QudaPrecision', 'clover_cuda_prec_eigensolver': 'QudaPrecision', 'clover_order': 'QudaCloverFieldOrder', 'use_init_guess': 'QudaUseInitGuess', 'clover_csw': 'double', 'clover_coeff': 'double', 'clover_rho': 'double', 'compute_clover_trlog': 'int', 'trlogA': 'double [ 2 ]', 'compute_clover': 'int', 'compute_clover_inverse': 'int', 'return_clover': 'int', 'return_clover_inverse': 'int', 'verbosity': 'QudaVerbosity', 'iter': 'int', 'gflops': 'double', 'secs': 'double', 'tune': 'QudaTune', 'Nsteps': 'int', 'gcrNkrylov': 'int', 'inv_type_precondition': 'QudaInverterType', 'preconditioner': 'void *', 'deflation_op': 'void *', 'eig_param': 'void *', 'deflate': 'QudaBoolean', 'dslash_type_precondition': 'QudaDslashType', 'verbosity_precondition': 'QudaVerbosity', 'tol_precondition': 'double', 'maxiter_precondition': 'int', 'omega': 'double', 'ca_basis': 'QudaCABasis', 'ca_lambda_min': 'double', 'ca_lambda_max': 'double', 'ca_basis_precondition': 'QudaCABasis', 'ca_lambda_min_precondition': 'double', 'ca_lambda_max_precondition': 'double', 'precondition_cycle': 'int', 'schwarz_type': 'QudaSchwarzType', 'accelerator_type_precondition': 'QudaAcceleratorType', 'madwf_diagonal_suppressor': 'double', 'madwf_ls': 'int', 'madwf_null_miniter': 'int', 'madwf_null_tol': 'double', 'madwf_train_maxiter': 'int', 'madwf_param_load': 'QudaBoolean', 'madwf_param_save': 'QudaBoolean', 'madwf_param_infile': 'char [ 256 ]', 'madwf_param_outfile': 'char [ 256 ]', 'residual_type': 'QudaResidualType', 'cuda_prec_ritz': 'QudaPrecision', 'n_ev': 'int', 'max_search_dim': 'int', 'rhs_idx': 'int', 'deflation_grid': 'int', 'eigenval_tol': 'double', 'eigcg_max_restarts': 'int', 'max_restart_num': 'int', 'inc_tol': 'double', 'make_resident_solution': 'int', 'use_resident_solution': 'int', 'chrono_make_resident': 'int', 'chrono_replace_last': 'int', 'chrono_use_resident': 'int', 'chrono_max_dim': 'int', 'chrono_index': 'int', 'chrono_precision': 'QudaPrecision', 'extlib_type': 'QudaExtLibType', 'native_blas_lapack': 'QudaBoolean', 'use_mobius_fused_kernel': 'QudaBoolean'} class QudaEigParam(Struct): @@ -436,7 +252,7 @@ class QudaEigParam(Struct): - use_poly_acc : Use Polynomial Acceleration - poly_deg : Degree of the Chebysev polynomial - a_min : Range used in polynomial acceleration - - a_max : + - a_max : - preserve_deflation : Whether to preserve the deflation space between solves. If true, the space will be stored in an instance of the deflation_space struct, pointed to by preserve_deflation_space @@ -448,8 +264,8 @@ class QudaEigParam(Struct): than the one used to generate the space, then this should be false, but preserve_deflation would be true - use_dagger : What type of Dirac operator we are using **/* If !(use_norm_op) && !(use_dagger) use M. **/* If use_dagger, use Mdag **/* If use_norm_op, use MdagM **/* If use_norm_op && use_dagger use MMdag. **/* If use_pc for any, then use the even-odd pc version - - use_norm_op : - - use_pc : + - use_norm_op : + - use_pc : - use_eigen_qr : Use Eigen routines to eigensolve the upper Hessenberg via QR - compute_svd : Performs an MdagM solve, then constructs the left and right SVD. - compute_gamma5 : Performs the \gamma_5 OP solve by Post multipling the eignvectors with @@ -471,7 +287,7 @@ class QudaEigParam(Struct): - arpack_logfile : For Arpack cross check, name of the Arpack logfile - QUDA_logfile : Name of the QUDA logfile (residua, upper Hessenberg/tridiag matrix updates) - nk : EIG-CG PARAMS - - np : + - np : - import_vectors : Whether to load eigenvectors - cuda_prec_ritz : The precision of the Ritz vectors - mem_type_ritz : The memory type used to keep the Ritz vectors @@ -488,62 +304,15 @@ class QudaEigParam(Struct): - extlib_type : Which external library to use in the deflation operations (Eigen) """ - _types = { - "struct_size": "size_t", - "invert_param": "QudaInvertParam *", - "eig_type": "QudaEigType", - "use_poly_acc": "QudaBoolean", - "poly_deg": "int", - "a_min": "double", - "a_max": "double", - "preserve_deflation": "QudaBoolean", - "preserve_deflation_space": "void *", - "preserve_evals": "QudaBoolean", - "use_dagger": "QudaBoolean", - "use_norm_op": "QudaBoolean", - "use_pc": "QudaBoolean", - "use_eigen_qr": "QudaBoolean", - "compute_svd": "QudaBoolean", - "compute_gamma5": "QudaBoolean", - "require_convergence": "QudaBoolean", - "spectrum": "QudaEigSpectrumType", - "n_ev": "int", - "n_kr": "int", - "nLockedMax": "int", - "n_conv": "int", - "n_ev_deflate": "int", - "tol": "double", - "qr_tol": "double", - "check_interval": "int", - "max_restarts": "int", - "batched_rotate": "int", - "block_size": "int", - "arpack_check": "QudaBoolean", - "arpack_logfile": "char [ 512 ]", - "QUDA_logfile": "char [ 512 ]", - "nk": "int", - "np": "int", - "import_vectors": "QudaBoolean", - "cuda_prec_ritz": "QudaPrecision", - "mem_type_ritz": "QudaMemoryType", - "location": "QudaFieldLocation", - "run_verify": "QudaBoolean", - "vec_infile": "char [ 256 ]", - "vec_outfile": "char [ 256 ]", - "save_prec": "QudaPrecision", - "io_parity_inflate": "QudaBoolean", - "gflops": "double", - "secs": "double", - "extlib_type": "QudaExtLibType", - } + _types = {'struct_size': 'size_t', 'invert_param': 'QudaInvertParam *', 'eig_type': 'QudaEigType', 'use_poly_acc': 'QudaBoolean', 'poly_deg': 'int', 'a_min': 'double', 'a_max': 'double', 'preserve_deflation': 'QudaBoolean', 'preserve_deflation_space': 'void *', 'preserve_evals': 'QudaBoolean', 'use_dagger': 'QudaBoolean', 'use_norm_op': 'QudaBoolean', 'use_pc': 'QudaBoolean', 'use_eigen_qr': 'QudaBoolean', 'compute_svd': 'QudaBoolean', 'compute_gamma5': 'QudaBoolean', 'require_convergence': 'QudaBoolean', 'spectrum': 'QudaEigSpectrumType', 'n_ev': 'int', 'n_kr': 'int', 'nLockedMax': 'int', 'n_conv': 'int', 'n_ev_deflate': 'int', 'tol': 'double', 'qr_tol': 'double', 'check_interval': 'int', 'max_restarts': 'int', 'batched_rotate': 'int', 'block_size': 'int', 'arpack_check': 'QudaBoolean', 'arpack_logfile': 'char [ 512 ]', 'QUDA_logfile': 'char [ 512 ]', 'nk': 'int', 'np': 'int', 'import_vectors': 'QudaBoolean', 'cuda_prec_ritz': 'QudaPrecision', 'mem_type_ritz': 'QudaMemoryType', 'location': 'QudaFieldLocation', 'run_verify': 'QudaBoolean', 'vec_infile': 'char [ 256 ]', 'vec_outfile': 'char [ 256 ]', 'save_prec': 'QudaPrecision', 'io_parity_inflate': 'QudaBoolean', 'gflops': 'double', 'secs': 'double', 'extlib_type': 'QudaExtLibType'} class QudaMultigridParam(Struct): """ QudaMultigridParam struct: - struct_size : Size of this struct in bytes. Used to ensure that the host application and QUDA see the same struct size - - invert_param : - - eig_param : + - invert_param : + - eig_param : - n_level : Number of multigrid levels - geo_block_size : Geometric block sizes to use on each level - spin_block_size : Spin block sizes to use on each level @@ -614,76 +383,7 @@ class QudaMultigridParam(Struct): - thin_update_only : Whether to do a full (false) or thin (true) update in the context of updateMultigridQuda """ - _types = { - "struct_size": "size_t", - "invert_param": "QudaInvertParam *", - "eig_param": "QudaEigParam * [ QUDA_MAX_MG_LEVEL ]", - "n_level": "int", - "geo_block_size": "int [ QUDA_MAX_MG_LEVEL ] [ QUDA_MAX_DIM ]", - "spin_block_size": "int [ QUDA_MAX_MG_LEVEL ]", - "n_vec": "int [ QUDA_MAX_MG_LEVEL ]", - "precision_null": "QudaPrecision [ QUDA_MAX_MG_LEVEL ]", - "n_block_ortho": "int [ QUDA_MAX_MG_LEVEL ]", - "block_ortho_two_pass": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", - "verbosity": "QudaVerbosity [ QUDA_MAX_MG_LEVEL ]", - "setup_inv_type": "QudaInverterType [ QUDA_MAX_MG_LEVEL ]", - "num_setup_iter": "int [ QUDA_MAX_MG_LEVEL ]", - "setup_tol": "double [ QUDA_MAX_MG_LEVEL ]", - "setup_maxiter": "int [ QUDA_MAX_MG_LEVEL ]", - "setup_maxiter_refresh": "int [ QUDA_MAX_MG_LEVEL ]", - "setup_ca_basis": "QudaCABasis [ QUDA_MAX_MG_LEVEL ]", - "setup_ca_basis_size": "int [ QUDA_MAX_MG_LEVEL ]", - "setup_ca_lambda_min": "double [ QUDA_MAX_MG_LEVEL ]", - "setup_ca_lambda_max": "double [ QUDA_MAX_MG_LEVEL ]", - "setup_type": "QudaSetupType", - "pre_orthonormalize": "QudaBoolean", - "post_orthonormalize": "QudaBoolean", - "coarse_solver": "QudaInverterType [ QUDA_MAX_MG_LEVEL ]", - "coarse_solver_tol": "double [ QUDA_MAX_MG_LEVEL ]", - "coarse_solver_maxiter": "int [ QUDA_MAX_MG_LEVEL ]", - "coarse_solver_ca_basis": "QudaCABasis [ QUDA_MAX_MG_LEVEL ]", - "coarse_solver_ca_basis_size": "int [ QUDA_MAX_MG_LEVEL ]", - "coarse_solver_ca_lambda_min": "double [ QUDA_MAX_MG_LEVEL ]", - "coarse_solver_ca_lambda_max": "double [ QUDA_MAX_MG_LEVEL ]", - "smoother": "QudaInverterType [ QUDA_MAX_MG_LEVEL ]", - "smoother_tol": "double [ QUDA_MAX_MG_LEVEL ]", - "nu_pre": "int [ QUDA_MAX_MG_LEVEL ]", - "nu_post": "int [ QUDA_MAX_MG_LEVEL ]", - "smoother_solver_ca_basis": "QudaCABasis [ QUDA_MAX_MG_LEVEL ]", - "smoother_solver_ca_lambda_min": "double [ QUDA_MAX_MG_LEVEL ]", - "smoother_solver_ca_lambda_max": "double [ QUDA_MAX_MG_LEVEL ]", - "omega": "double [ QUDA_MAX_MG_LEVEL ]", - "smoother_halo_precision": "QudaPrecision [ QUDA_MAX_MG_LEVEL ]", - "smoother_schwarz_type": "QudaSchwarzType [ QUDA_MAX_MG_LEVEL ]", - "smoother_schwarz_cycle": "int [ QUDA_MAX_MG_LEVEL ]", - "coarse_grid_solution_type": "QudaSolutionType [ QUDA_MAX_MG_LEVEL ]", - "smoother_solve_type": "QudaSolveType [ QUDA_MAX_MG_LEVEL ]", - "cycle_type": "QudaMultigridCycleType [ QUDA_MAX_MG_LEVEL ]", - "global_reduction": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", - "location": "QudaFieldLocation [ QUDA_MAX_MG_LEVEL ]", - "setup_location": "QudaFieldLocation [ QUDA_MAX_MG_LEVEL ]", - "use_eig_solver": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", - "setup_minimize_memory": "QudaBoolean", - "compute_null_vector": "QudaComputeNullVector", - "generate_all_levels": "QudaBoolean", - "run_verify": "QudaBoolean", - "run_low_mode_check": "QudaBoolean", - "run_oblique_proj_check": "QudaBoolean", - "vec_load": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", - "vec_infile": "char [ QUDA_MAX_MG_LEVEL ] [ 256 ]", - "vec_store": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", - "vec_outfile": "char [ QUDA_MAX_MG_LEVEL ] [ 256 ]", - "coarse_guess": "QudaBoolean", - "preserve_deflation": "QudaBoolean", - "gflops": "double", - "secs": "double", - "mu_factor": "double [ QUDA_MAX_MG_LEVEL ]", - "transfer_type": "QudaTransferType [ QUDA_MAX_MG_LEVEL ]", - "allow_truncation": "QudaBoolean", - "staggered_kd_dagger_approximation": "QudaBoolean", - "use_mma": "QudaBoolean", - "thin_update_only": "QudaBoolean", - } + _types = {'struct_size': 'size_t', 'invert_param': 'QudaInvertParam *', 'eig_param': 'QudaEigParam * [ QUDA_MAX_MG_LEVEL ]', 'n_level': 'int', 'geo_block_size': 'int [ QUDA_MAX_MG_LEVEL ] [ QUDA_MAX_DIM ]', 'spin_block_size': 'int [ QUDA_MAX_MG_LEVEL ]', 'n_vec': 'int [ QUDA_MAX_MG_LEVEL ]', 'precision_null': 'QudaPrecision [ QUDA_MAX_MG_LEVEL ]', 'n_block_ortho': 'int [ QUDA_MAX_MG_LEVEL ]', 'block_ortho_two_pass': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'verbosity': 'QudaVerbosity [ QUDA_MAX_MG_LEVEL ]', 'setup_inv_type': 'QudaInverterType [ QUDA_MAX_MG_LEVEL ]', 'num_setup_iter': 'int [ QUDA_MAX_MG_LEVEL ]', 'setup_tol': 'double [ QUDA_MAX_MG_LEVEL ]', 'setup_maxiter': 'int [ QUDA_MAX_MG_LEVEL ]', 'setup_maxiter_refresh': 'int [ QUDA_MAX_MG_LEVEL ]', 'setup_ca_basis': 'QudaCABasis [ QUDA_MAX_MG_LEVEL ]', 'setup_ca_basis_size': 'int [ QUDA_MAX_MG_LEVEL ]', 'setup_ca_lambda_min': 'double [ QUDA_MAX_MG_LEVEL ]', 'setup_ca_lambda_max': 'double [ QUDA_MAX_MG_LEVEL ]', 'setup_type': 'QudaSetupType', 'pre_orthonormalize': 'QudaBoolean', 'post_orthonormalize': 'QudaBoolean', 'coarse_solver': 'QudaInverterType [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_tol': 'double [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_maxiter': 'int [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_ca_basis': 'QudaCABasis [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_ca_basis_size': 'int [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_ca_lambda_min': 'double [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_ca_lambda_max': 'double [ QUDA_MAX_MG_LEVEL ]', 'smoother': 'QudaInverterType [ QUDA_MAX_MG_LEVEL ]', 'smoother_tol': 'double [ QUDA_MAX_MG_LEVEL ]', 'nu_pre': 'int [ QUDA_MAX_MG_LEVEL ]', 'nu_post': 'int [ QUDA_MAX_MG_LEVEL ]', 'smoother_solver_ca_basis': 'QudaCABasis [ QUDA_MAX_MG_LEVEL ]', 'smoother_solver_ca_lambda_min': 'double [ QUDA_MAX_MG_LEVEL ]', 'smoother_solver_ca_lambda_max': 'double [ QUDA_MAX_MG_LEVEL ]', 'omega': 'double [ QUDA_MAX_MG_LEVEL ]', 'smoother_halo_precision': 'QudaPrecision [ QUDA_MAX_MG_LEVEL ]', 'smoother_schwarz_type': 'QudaSchwarzType [ QUDA_MAX_MG_LEVEL ]', 'smoother_schwarz_cycle': 'int [ QUDA_MAX_MG_LEVEL ]', 'coarse_grid_solution_type': 'QudaSolutionType [ QUDA_MAX_MG_LEVEL ]', 'smoother_solve_type': 'QudaSolveType [ QUDA_MAX_MG_LEVEL ]', 'cycle_type': 'QudaMultigridCycleType [ QUDA_MAX_MG_LEVEL ]', 'global_reduction': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'location': 'QudaFieldLocation [ QUDA_MAX_MG_LEVEL ]', 'setup_location': 'QudaFieldLocation [ QUDA_MAX_MG_LEVEL ]', 'use_eig_solver': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'setup_minimize_memory': 'QudaBoolean', 'compute_null_vector': 'QudaComputeNullVector', 'generate_all_levels': 'QudaBoolean', 'run_verify': 'QudaBoolean', 'run_low_mode_check': 'QudaBoolean', 'run_oblique_proj_check': 'QudaBoolean', 'vec_load': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'vec_infile': 'char [ QUDA_MAX_MG_LEVEL ] [ 256 ]', 'vec_store': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'vec_outfile': 'char [ QUDA_MAX_MG_LEVEL ] [ 256 ]', 'coarse_guess': 'QudaBoolean', 'preserve_deflation': 'QudaBoolean', 'gflops': 'double', 'secs': 'double', 'mu_factor': 'double [ QUDA_MAX_MG_LEVEL ]', 'transfer_type': 'QudaTransferType [ QUDA_MAX_MG_LEVEL ]', 'allow_truncation': 'QudaBoolean', 'staggered_kd_dagger_approximation': 'QudaBoolean', 'use_mma': 'QudaBoolean', 'thin_update_only': 'QudaBoolean'} class QudaGaugeObservableParam(Struct): @@ -711,28 +411,7 @@ class QudaGaugeObservableParam(Struct): - remove_staggered_phase : Whether or not the resident gauge field has staggered phases applied and if they should """ - _types = { - "struct_size": "size_t", - "su_project": "QudaBoolean", - "compute_plaquette": "QudaBoolean", - "plaquette": "double [ 3 ]", - "compute_polyakov_loop": "QudaBoolean", - "ploop": "double [ 2 ]", - "compute_gauge_loop_trace": "QudaBoolean", - "traces": "double_complex *", - "input_path_buff": "int * *", - "path_length": "int *", - "loop_coeff": "double *", - "num_paths": "int", - "max_length": "int", - "factor": "double", - "compute_qcharge": "QudaBoolean", - "qcharge": "double", - "energy": "double [ 3 ]", - "compute_qcharge_density": "QudaBoolean", - "qcharge_density": "void *", - "remove_staggered_phase": "", - } + _types = {'struct_size': 'size_t', 'su_project': 'QudaBoolean', 'compute_plaquette': 'QudaBoolean', 'plaquette': 'double [ 3 ]', 'compute_polyakov_loop': 'QudaBoolean', 'ploop': 'double [ 2 ]', 'compute_gauge_loop_trace': 'QudaBoolean', 'traces': 'double_complex *', 'input_path_buff': 'int * *', 'path_length': 'int *', 'loop_coeff': 'double *', 'num_paths': 'int', 'max_length': 'int', 'factor': 'double', 'compute_qcharge': 'QudaBoolean', 'qcharge': 'double', 'energy': 'double [ 3 ]', 'compute_qcharge_density': 'QudaBoolean', 'qcharge_density': 'void *', 'remove_staggered_phase': ''} class QudaGaugeSmearParam(Struct): @@ -747,15 +426,7 @@ class QudaGaugeSmearParam(Struct): - smear_type : The smearing type to perform """ - _types = { - "struct_size": "size_t", - "n_steps": "unsigned int", - "epsilon": "double", - "alpha": "double", - "rho": "double", - "meas_interval": "unsigned int", - "smear_type": "QudaGaugeSmearType", - } + _types = {'struct_size': 'size_t', 'n_steps': 'unsigned int', 'epsilon': 'double', 'alpha': 'double', 'rho': 'double', 'meas_interval': 'unsigned int', 'smear_type': 'QudaGaugeSmearType'} class QudaBLASParam(Struct): @@ -785,27 +456,4 @@ class QudaBLASParam(Struct): - data_order : Specifies if using Row or Column major """ - _types = { - "struct_size": "size_t", - "blas_type": "QudaBLASType", - "trans_a": "QudaBLASOperation", - "trans_b": "QudaBLASOperation", - "m": "int", - "n": "int", - "k": "int", - "lda": "int", - "ldb": "int", - "ldc": "int", - "a_offset": "int", - "b_offset": "int", - "c_offset": "int", - "a_stride": "int", - "b_stride": "int", - "c_stride": "int", - "alpha": "double_complex", - "beta": "double_complex", - "inv_mat_size": "int", - "batch_count": "int", - "data_type": "QudaBLASDataType", - "data_order": "QudaBLASDataOrder", - } + _types = {'struct_size': 'size_t', 'blas_type': 'QudaBLASType', 'trans_a': 'QudaBLASOperation', 'trans_b': 'QudaBLASOperation', 'm': 'int', 'n': 'int', 'k': 'int', 'lda': 'int', 'ldb': 'int', 'ldc': 'int', 'a_offset': 'int', 'b_offset': 'int', 'c_offset': 'int', 'a_stride': 'int', 'b_stride': 'int', 'c_stride': 'int', 'alpha': 'double_complex', 'beta': 'double_complex', 'inv_mat_size': 'int', 'batch_count': 'int', 'data_type': 'QudaBLASDataType', 'data_order': 'QudaBLASDataOrder'} From d5e4f86007d1f501ae902d6596859167be2d14d5 Mon Sep 17 00:00:00 2001 From: sy3394 Date: Wed, 15 Mar 2023 18:57:00 +0200 Subject: [PATCH 2/7] added patch and test for making QUDA error function throwing std::exception --- patches/error.patch | 22 ++++++++++++++++++++++ test/test_error.py | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 patches/error.patch create mode 100644 test/test_error.py diff --git a/patches/error.patch b/patches/error.patch new file mode 100644 index 0000000..d7961d4 --- /dev/null +++ b/patches/error.patch @@ -0,0 +1,22 @@ +diff --git a/lib/comm_common.cpp b/lib/comm_common.cpp +index 2c58188..f0be27f 100644 +--- a/lib/comm_common.cpp ++++ b/lib/comm_common.cpp +@@ -1,6 +1,8 @@ + #include // for gethostname() + #include + #include ++#include ++#include + + #include + #include +@@ -142,7 +144,7 @@ namespace quda + backward::Printer p; + p.print(st, getOutputFile()); + #endif +- comm_abort_(status); ++ throw std::runtime_error("QUDA Error: exit code " + std::to_string(status)); + } + + } // namespace quda diff --git a/test/test_error.py b/test/test_error.py new file mode 100644 index 0000000..90a0a44 --- /dev/null +++ b/test/test_error.py @@ -0,0 +1,18 @@ +from lyncs_quda import gauge, gauge_scalar + +import pytest +from lyncs_quda.testing import ( + fixlib as lib, + lattice_loop, + ) + + +@lattice_loop +def test_error(lib, lattice): + gf = gauge(lattice) + gs = gauge_scalar(lattice) + + with pytest.raises(lib.std.runtime_error): + gf.quda_field.copy(gs.quda_field) + gf.zero() + assert gf == 0 From f194787605bcdce7002d077e1c90b658de2ac0b5 Mon Sep 17 00:00:00 2001 From: sy3394 Date: Thu, 16 Mar 2023 16:54:55 +0200 Subject: [PATCH 3/7] removed a space --- test/test_evenodd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_evenodd.py b/test/test_evenodd.py index 18ae6a6..0e1204c 100644 --- a/test/test_evenodd.py +++ b/test/test_evenodd.py @@ -1,7 +1,7 @@ import pytest from lyncs_quda import evenodd, continous, to_quda, from_quda -# from lyncs_quda.lib import fixlib as lib +#from lyncs_quda.lib import fixlib as lib import numpy as np From 511a7280ac4c4998d452e1ad6af97991ee5e8efb Mon Sep 17 00:00:00 2001 From: sy3394 Date: Tue, 28 Mar 2023 18:31:47 +0300 Subject: [PATCH 4/7] modified error patch; applied some of pylint suggestions --- lyncs_quda/array.py | 2 +- lyncs_quda/clover_field.py | 3 +-- lyncs_quda/dirac.py | 9 +++---- lyncs_quda/gauge_field.py | 20 +++++++-------- lyncs_quda/lattice_field.py | 5 ---- lyncs_quda/lib.py | 10 ++++---- lyncs_quda/solver.py | 2 +- lyncs_quda/spinor_field.py | 10 ++++---- patches/error.patch | 49 ++++++++++++++++++++++++++++++++++--- test/test_error.py | 1 + test/test_evenodd.py | 8 ++---- 11 files changed, 74 insertions(+), 45 deletions(-) diff --git a/lyncs_quda/array.py b/lyncs_quda/array.py index 3700680..0b96237 100644 --- a/lyncs_quda/array.py +++ b/lyncs_quda/array.py @@ -24,7 +24,7 @@ class Array: def __init__(self, typename, size, elems=None): self._qarray = lib.quda.array[typename, size]() - if elems != None: + if elems is not None: if isiterable(elems): if len(elems) > size: raise ValueError() diff --git a/lyncs_quda/clover_field.py b/lyncs_quda/clover_field.py index 958a969..e4cbb18 100644 --- a/lyncs_quda/clover_field.py +++ b/lyncs_quda/clover_field.py @@ -6,9 +6,8 @@ "CloverField", ] -import numpy -from cppyy.gbl.std import vector from functools import cache +import numpy from lyncs_cppyy import make_shared, to_pointer from .lib import lib, cupy diff --git a/lyncs_quda/dirac.py b/lyncs_quda/dirac.py index b978990..a6c723d 100644 --- a/lyncs_quda/dirac.py +++ b/lyncs_quda/dirac.py @@ -8,10 +8,9 @@ from functools import wraps from dataclasses import dataclass, field -from numpy import sqrt from typing import Union from lyncs_cppyy import make_shared, nullptr -from .gauge_field import gauge, GaugeField +from .gauge_field import GaugeField from .clover_field import CloverField from .spinor_field import spinor from .lib import lib @@ -222,13 +221,13 @@ def action(self, phi, **params): """ if not self.full: - if "CLOVER" in self.type and self.symm == True: + if "CLOVER" in self.type and self.symm: raise ValueError("Preconditioned matrix should be asymmetric") - if "CLOVER" not in self.type and self.symm != True: + if "CLOVER" not in self.type and not self.symm: raise ValueError( "Preconditioned matrix should be symmetric for non-clover type Dirac matrix" ) - if "CLOVER" in self.type and self.computeTrLog != True: + if "CLOVER" in self.type and not self.computeTrLog: raise ValueError( "computeTrLog should be set True in the preconditioned case" ) diff --git a/lyncs_quda/gauge_field.py b/lyncs_quda/gauge_field.py index 2494e13..b6ae5d9 100644 --- a/lyncs_quda/gauge_field.py +++ b/lyncs_quda/gauge_field.py @@ -18,12 +18,11 @@ from collections import defaultdict from functools import cache import numpy -from lyncs_cppyy import make_shared, lib as tmp, to_pointer, array_to_pointers +from lyncs_cppyy import make_shared, to_pointer, array_to_pointers from lyncs_utils import prod, isiterable from .lib import lib, cupy from .array import Array -from .lattice_field import LatticeField, backend -from .spinor_field import spinor +from .lattice_field import LatticeField from .time_profile import default_profiler from .enums import ( QudaReconstructType, @@ -121,8 +120,8 @@ def new(self, reconstruct=None, geometry=None, **kwargs): kwargs["dofs"][0], val // 2 if self.iscomplex else val, ) - except ValueError: - raise ValueError(f"Invalid reconstruct {reconstruct}") + except ValueError as VE: + raise VE(f"Invalid reconstruct {reconstruct}") out = super().new(**kwargs) is_momentum = kwargs.get("is_momentum", self.is_momentum) out.is_momentum = is_momentum @@ -197,9 +196,8 @@ def ncol(self): def order(self): "Data order of the field" dofs = self.dofs_per_link - if self.precision != "double" and ( - dofs == 8 or dofs == 12 - ): # if FLOAT8 defined, if prec=half/quarter and recon=8, FLOAT8 + if self.precision != "double" and dofs in (8, 12): + # if FLOAT8 defined, if prec=half/quarter and recon=8, FLOAT8 return "FLOAT4" return "FLOAT2" @@ -346,7 +344,7 @@ def extended_field(self, sites=1): self.ptr, self.quda_params, numpy.array(sites, dtype="int32") ) ) - elif self.location == "CUDA": + if self.location == "CUDA": "Returns cudaGaugeField" return make_shared( lib.createExtendedGauge( @@ -531,7 +529,7 @@ def gaussian(self, epsilon=1, seed=None): seed = seed or int(time() * 1e9) lib.gaugeGauss(self.quda_field, seed, epsilon) - def uniform(self, epsilon=1, seed=None): + def uniform(self, seed=None): """ Generates Uniform distributed SU(N) field. """ @@ -756,7 +754,7 @@ def compute_paths( if not len(paths) == len(coeffs): raise ValueError("Paths and coeffs must have the same length") else: - assert coeffs == None, "coeffs not used in case of not sum_paths" + assert coeffs is None, "coeffs not used in case of not sum_paths" # Preparing fnc if insertion is not None: diff --git a/lyncs_quda/lattice_field.py b/lyncs_quda/lattice_field.py index cdd57fd..fe74b8f 100644 --- a/lyncs_quda/lattice_field.py +++ b/lyncs_quda/lattice_field.py @@ -6,7 +6,6 @@ "LatticeField", ] -from array import array from contextlib import contextmanager from functools import cache import numpy @@ -16,10 +15,6 @@ from .lib import lib, cupy from .array import lat_dims -from lyncs_cppyy import to_pointer -import ctypes -import traceback - def get_precision(dtype): if dtype in ["float64", "complex128"]: diff --git a/lyncs_quda/lib.py b/lyncs_quda/lib.py index 2c68901..58c2a66 100644 --- a/lyncs_quda/lib.py +++ b/lyncs_quda/lib.py @@ -13,11 +13,10 @@ from os import environ from pathlib import Path from array import array -from appdirs import user_data_dir from math import prod -from lyncs_cppyy import Lib, nullptr, cppdef -from lyncs_cppyy.ll import addressof, to_pointer -from lyncs_utils import static_property, lazy_import +from appdirs import user_data_dir +from lyncs_cppyy import Lib, cppdef +from lyncs_utils import lazy_import from . import __path__ from .config import QUDA_MPI, QUDA_GITVERSION, QUDA_PRECISION, QUDA_RECONSTRUCT @@ -86,7 +85,7 @@ def device_id(self, value): f"device_id cannot be changed: current={self.device_id}, given={value}" ) if not isinstance(value, int): - raise TypeError(f"Unsupported type for device: {type(device)}") + raise TypeError(f"Unsupported type for device ID: {type(value)}") self._device_id = value def get_current_device(self): @@ -262,6 +261,7 @@ def __del__(self): PATHS = list(__path__) headers = [ + "comm_quda.h", "quda.h", "gauge_field.h", "gauge_tools.h", diff --git a/lyncs_quda/solver.py b/lyncs_quda/solver.py index dbb4fe9..c3eba68 100644 --- a/lyncs_quda/solver.py +++ b/lyncs_quda/solver.py @@ -7,7 +7,7 @@ "Solver", ] -from functools import wraps, cache +from functools import wraps from warnings import warn from lyncs_cppyy import nullptr, make_shared from .dirac import Dirac, DiracMatrix diff --git a/lyncs_quda/spinor_field.py b/lyncs_quda/spinor_field.py index 9889b43..befd590 100644 --- a/lyncs_quda/spinor_field.py +++ b/lyncs_quda/spinor_field.py @@ -1,5 +1,5 @@ """ -Interface to gauge_field.h +Interface to color_spinor_field.h """ __all__ = [ @@ -8,7 +8,7 @@ "SpinorField", ] -from functools import reduce, cache +from functools import cache from time import time from lyncs_cppyy import make_shared from lyncs_cppyy.ll import to_pointer @@ -124,7 +124,7 @@ def site_order(self): def site_order(self, value): if value is None: value = "NONE" - values = f"Possible values are NONE, EVEN_ODD, ODD_EVEN" + values = "Possible values are NONE, EVEN_ODD, ODD_EVEN" if not isinstance(value, str): raise TypeError("Expected a string. " + values) value = value.upper() @@ -215,7 +215,7 @@ def norm1(self, parity=None): "L1 norm of the field" if parity == "EVEN": return lib.blas.norm1(self.quda_field.Even()) - elif parity == "ODD": + if parity == "ODD": return lib.blas.norm1(self.quda_field.Odd()) return lib.blas.norm1(self.quda_field) @@ -223,7 +223,7 @@ def norm2(self, parity=None): "L2 norm of the field" if parity == "EVEN": return lib.blas.norm2(self.quda_field.Even()) - elif parity == "ODD": + if parity == "ODD": return lib.blas.norm2(self.quda_field.Odd()) return lib.blas.norm2(self.quda_field) diff --git a/patches/error.patch b/patches/error.patch index d7961d4..a8a4f8d 100644 --- a/patches/error.patch +++ b/patches/error.patch @@ -1,22 +1,63 @@ +diff --git a/include/comm_quda.h b/include/comm_quda.h +index e99d412..f221eab 100644 +--- a/include/comm_quda.h ++++ b/include/comm_quda.h +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + #ifdef __cplusplus + extern "C" { +@@ -420,4 +421,7 @@ namespace quda + bool commAsyncReduction(); + void commAsyncReductionSet(bool global_reduce); + ++ class QudaException : public std::runtime_error { ++ using std::runtime_error::runtime_error; ++ }; + } // namespace quda diff --git a/lib/comm_common.cpp b/lib/comm_common.cpp -index 2c58188..f0be27f 100644 +index 2c58188..330b0e0 100644 --- a/lib/comm_common.cpp +++ b/lib/comm_common.cpp -@@ -1,6 +1,8 @@ +@@ -1,6 +1,9 @@ #include // for gethostname() #include #include ++#include +#include +#include #include #include -@@ -142,7 +144,7 @@ namespace quda +@@ -130,7 +133,12 @@ namespace quda + + return topo; + } +- ++ ++ static int current_status; ++ void abort(){ ++ comm_abort_(current_status); ++ } ++ + void comm_abort(int status) + { + #ifdef HOST_DEBUG +@@ -142,7 +150,13 @@ namespace quda backward::Printer p; p.print(st, getOutputFile()); #endif - comm_abort_(status); -+ throw std::runtime_error("QUDA Error: exit code " + std::to_string(status)); ++ static bool called = false; ++ if (not called) { ++ std::set_terminate(abort); ++ called = true; ++ } ++ current_status = status; ++ throw QudaException("QUDA Error: exit code " + std::to_string(status)); } } // namespace quda diff --git a/test/test_error.py b/test/test_error.py index 90a0a44..82355d7 100644 --- a/test/test_error.py +++ b/test/test_error.py @@ -12,6 +12,7 @@ def test_error(lib, lattice): gf = gauge(lattice) gs = gauge_scalar(lattice) + gf.quda_field.copy(gs.quda_field) with pytest.raises(lib.std.runtime_error): gf.quda_field.copy(gs.quda_field) gf.zero() diff --git a/test/test_evenodd.py b/test/test_evenodd.py index 0e1204c..8759091 100644 --- a/test/test_evenodd.py +++ b/test/test_evenodd.py @@ -1,10 +1,9 @@ import pytest from lyncs_quda import evenodd, continous, to_quda, from_quda -#from lyncs_quda.lib import fixlib as lib +from lyncs_quda.lib import fixlib as lib import numpy as np - @pytest.fixture(params=[(4,), (4, 8), (4, 4, 8), (4, 6, 8, 2)]) def shape(request): return request.param @@ -19,8 +18,7 @@ def inner(request): def outer(request): return request.param - -def test_evenodd(shape, inner, outer): +def test_evenodd(lib, shape, inner, outer): tile = np.array([1, -1]) for i in range(1, len(shape)): tile = np.array([tile, tile * -1]) @@ -28,9 +26,7 @@ def test_evenodd(shape, inner, outer): arr = np.tile(tile, shape) shape = arr.shape out = evenodd(arr) - assert (continous(out) == arr).all() - out = out.flatten() n = out.shape[0] // 2 From 22aa8abbbfe967582fc440dd946ba8a0f6857e0d Mon Sep 17 00:00:00 2001 From: sy3394 <43974238+sy3394@users.noreply.github.com> Date: Tue, 28 Mar 2023 19:37:53 +0300 Subject: [PATCH 5/7] Update black_n_pylint.yml for debugging attempt --- .github/workflows/black_n_pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/black_n_pylint.yml b/.github/workflows/black_n_pylint.yml index be9dff9..9452e80 100644 --- a/.github/workflows/black_n_pylint.yml +++ b/.github/workflows/black_n_pylint.yml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install black lyncs_setuptools[pylint] + pip install black lyncs_setuptools[all] - name: Applying black formatting run: | From ec9be5b615e75fafe51cfde8ffe546f7b260f5c7 Mon Sep 17 00:00:00 2001 From: Simone Bacchio Date: Tue, 28 Mar 2023 16:43:42 +0000 Subject: [PATCH 6/7] Applying black formatting (from Github Action) --- lyncs_quda/clover_field.py | 7 +- lyncs_quda/dirac.py | 2 +- lyncs_quda/enums.py | 405 +++++++++++++++++++++++++++++++------ lyncs_quda/spinor_field.py | 2 +- lyncs_quda/structs.py | 388 +++++++++++++++++++++++++++++++++-- test/test_error.py | 2 +- test/test_evenodd.py | 2 + 7 files changed, 720 insertions(+), 88 deletions(-) diff --git a/lyncs_quda/clover_field.py b/lyncs_quda/clover_field.py index e4cbb18..8d1482e 100644 --- a/lyncs_quda/clover_field.py +++ b/lyncs_quda/clover_field.py @@ -13,7 +13,12 @@ from .lib import lib, cupy from .lattice_field import LatticeField from .gauge_field import GaugeField -from .enums import QudaParity, QudaTwistFlavorType, QudaCloverFieldOrder, QudaFieldCreate +from .enums import ( + QudaParity, + QudaTwistFlavorType, + QudaCloverFieldOrder, + QudaFieldCreate, +) # TODO list # We want dimension of (cu/num)py array to reflect parity and order diff --git a/lyncs_quda/dirac.py b/lyncs_quda/dirac.py index a6c723d..b3ec06c 100644 --- a/lyncs_quda/dirac.py +++ b/lyncs_quda/dirac.py @@ -19,7 +19,7 @@ QudaMatPCType, QudaDagType, QudaParity, - ) +) @dataclass(frozen=True) diff --git a/lyncs_quda/enums.py b/lyncs_quda/enums.py index 88fd089..df82cb1 100644 --- a/lyncs_quda/enums.py +++ b/lyncs_quda/enums.py @@ -1,4 +1,3 @@ - "List of QUDA enumerations" # NOTE: This file is automathically generated by setup.py @@ -16,7 +15,7 @@ class qudaError_t(Enum): _prefix = "quda_" _suffix = "" - _values = {'success': 0, 'error': 1, 'error_uninitialized': 2} + _values = {"success": 0, "error": 1, "error_uninitialized": 2} class QudaMemoryType(Enum): @@ -29,7 +28,7 @@ class QudaMemoryType(Enum): _prefix = "quda_memory_" _suffix = "" - _values = {'device': 0, 'pinned': 1, 'mapped': 2, 'invalid': -2147483648} + _values = {"device": 0, "pinned": 1, "mapped": 2, "invalid": -2147483648} class QudaLinkType(Enum): @@ -50,7 +49,20 @@ class QudaLinkType(Enum): _prefix = "quda_" _suffix = "_links" - _values = {'su3': 0, 'general': 1, 'three': 2, 'momentum': 3, 'coarse': 4, 'smeared': 5, 'wilson': 0, 'asqtad_fat': 1, 'asqtad_long': 2, 'asqtad_mom': 3, 'asqtad_general': 1, 'invalid': -2147483648} + _values = { + "su3": 0, + "general": 1, + "three": 2, + "momentum": 3, + "coarse": 4, + "smeared": 5, + "wilson": 0, + "asqtad_fat": 1, + "asqtad_long": 2, + "asqtad_mom": 3, + "asqtad_general": 1, + "invalid": -2147483648, + } class QudaGaugeFieldOrder(Enum): @@ -73,7 +85,22 @@ class QudaGaugeFieldOrder(Enum): _prefix = "quda_" _suffix = "_gauge_order" - _values = {'float': 1, 'float2': 2, 'float4': 4, 'float8': 8, 'native': 9, 'qdp': 10, 'qdpjit': 11, 'cps_wilson': 12, 'milc': 13, 'milc_site': 14, 'bqcd': 15, 'tifr': 16, 'tifr_padded': 17, 'invalid': -2147483648} + _values = { + "float": 1, + "float2": 2, + "float4": 4, + "float8": 8, + "native": 9, + "qdp": 10, + "qdpjit": 11, + "cps_wilson": 12, + "milc": 13, + "milc_site": 14, + "bqcd": 15, + "tifr": 16, + "tifr_padded": 17, + "invalid": -2147483648, + } class QudaTboundary(Enum): @@ -85,7 +112,11 @@ class QudaTboundary(Enum): _prefix = "quda_" _suffix = "" - _values = {'anti_periodic_t': -1, 'periodic_t': 1, 'invalid_t_boundary': -2147483648} + _values = { + "anti_periodic_t": -1, + "periodic_t": 1, + "invalid_t_boundary": -2147483648, + } class QudaPrecision(Enum): @@ -99,7 +130,13 @@ class QudaPrecision(Enum): _prefix = "quda_" _suffix = "_precision" - _values = {'quarter': 1, 'half': 2, 'single': 4, 'double': 8, 'invalid': -2147483648} + _values = { + "quarter": 1, + "half": 2, + "single": 4, + "double": 8, + "invalid": -2147483648, + } class QudaReconstructType(Enum): @@ -115,7 +152,15 @@ class QudaReconstructType(Enum): _prefix = "quda_reconstruct_" _suffix = "" - _values = {'no': 18, '12': 12, '8': 8, '9': 9, '13': 13, '10': 10, 'invalid': -2147483648} + _values = { + "no": 18, + "12": 12, + "8": 8, + "9": 9, + "13": 13, + "10": 10, + "invalid": -2147483648, + } class QudaGaugeFixed(Enum): @@ -127,7 +172,7 @@ class QudaGaugeFixed(Enum): _prefix = "quda_gauge_fixed_" _suffix = "" - _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} + _values = {"no": 0, "yes": 1, "invalid": -2147483648} class QudaDslashType(Enum): @@ -150,7 +195,22 @@ class QudaDslashType(Enum): _prefix = "quda_" _suffix = "_dslash" - _values = {'wilson': 0, 'clover_wilson': 1, 'clover_hasenbusch_twist': 2, 'domain_wall': 3, 'domain_wall_4d': 4, 'mobius_dwf': 5, 'mobius_dwf_eofa': 6, 'staggered': 7, 'asqtad': 8, 'twisted_mass': 9, 'twisted_clover': 10, 'laplace': 11, 'covdev': 12, 'invalid': -2147483648} + _values = { + "wilson": 0, + "clover_wilson": 1, + "clover_hasenbusch_twist": 2, + "domain_wall": 3, + "domain_wall_4d": 4, + "mobius_dwf": 5, + "mobius_dwf_eofa": 6, + "staggered": 7, + "asqtad": 8, + "twisted_mass": 9, + "twisted_clover": 10, + "laplace": 11, + "covdev": 12, + "invalid": -2147483648, + } class QudaInverterType(Enum): @@ -183,7 +243,32 @@ class QudaInverterType(Enum): _prefix = "quda_" _suffix = "_inverter" - _values = {'cg': 0, 'bicgstab': 1, 'gcr': 2, 'mr': 3, 'sd': 4, 'pcg': 5, 'eigcg': 6, 'inc_eigcg': 7, 'gmresdr': 8, 'gmresdr_proj': 9, 'gmresdr_sh': 10, 'fgmresdr': 11, 'mg': 12, 'bicgstabl': 13, 'cgne': 14, 'cgnr': 15, 'cg3': 16, 'cg3ne': 17, 'cg3nr': 18, 'ca_cg': 19, 'ca_cgne': 20, 'ca_cgnr': 21, 'ca_gcr': 22, 'invalid': -2147483648} + _values = { + "cg": 0, + "bicgstab": 1, + "gcr": 2, + "mr": 3, + "sd": 4, + "pcg": 5, + "eigcg": 6, + "inc_eigcg": 7, + "gmresdr": 8, + "gmresdr_proj": 9, + "gmresdr_sh": 10, + "fgmresdr": 11, + "mg": 12, + "bicgstabl": 13, + "cgne": 14, + "cgnr": 15, + "cg3": 16, + "cg3ne": 17, + "cg3nr": 18, + "ca_cg": 19, + "ca_cgne": 20, + "ca_cgnr": 21, + "ca_gcr": 22, + "invalid": -2147483648, + } class QudaEigType(Enum): @@ -197,7 +282,13 @@ class QudaEigType(Enum): _prefix = "quda_eig_" _suffix = "" - _values = {'tr_lanczos': 0, 'blk_tr_lanczos': 1, 'ir_arnoldi': 2, 'blk_ir_arnoldi': 3, 'invalid': -2147483648} + _values = { + "tr_lanczos": 0, + "blk_tr_lanczos": 1, + "ir_arnoldi": 2, + "blk_ir_arnoldi": 3, + "invalid": -2147483648, + } class QudaEigSpectrumType(Enum): @@ -213,7 +304,15 @@ class QudaEigSpectrumType(Enum): _prefix = "quda_spectrum_" _suffix = "" - _values = {'lm_eig': 0, 'sm_eig': 1, 'lr_eig': 2, 'sr_eig': 3, 'li_eig': 4, 'si_eig': 5, 'invalid': -2147483648} + _values = { + "lm_eig": 0, + "sm_eig": 1, + "lr_eig": 2, + "sr_eig": 3, + "li_eig": 4, + "si_eig": 5, + "invalid": -2147483648, + } class QudaSolutionType(Enum): @@ -229,7 +328,15 @@ class QudaSolutionType(Enum): _prefix = "quda_" _suffix = "_solution" - _values = {'mat': 0, 'matdag_mat': 1, 'matpc': 2, 'matpc_dag': 3, 'matpcdag_matpc': 4, 'matpcdag_matpc_shift': 5, 'invalid': -2147483648} + _values = { + "mat": 0, + "matdag_mat": 1, + "matpc": 2, + "matpc_dag": 3, + "matpcdag_matpc": 4, + "matpcdag_matpc_shift": 5, + "invalid": -2147483648, + } class QudaSolveType(Enum): @@ -247,7 +354,17 @@ class QudaSolveType(Enum): _prefix = "quda_" _suffix = "_solve" - _values = {'direct': 0, 'normop': 1, 'direct_pc': 2, 'normop_pc': 3, 'normerr': 4, 'normerr_pc': 5, 'normeq': 1, 'normeq_pc': 3, 'invalid': -2147483648} + _values = { + "direct": 0, + "normop": 1, + "direct_pc": 2, + "normop_pc": 3, + "normerr": 4, + "normerr_pc": 5, + "normeq": 1, + "normeq_pc": 3, + "invalid": -2147483648, + } class QudaMultigridCycleType(Enum): @@ -261,7 +378,13 @@ class QudaMultigridCycleType(Enum): _prefix = "quda_mg_cycle_" _suffix = "" - _values = {'vcycle': 0, 'fcycle': 1, 'wcycle': 2, 'recursive': 3, 'invalid': -2147483648} + _values = { + "vcycle": 0, + "fcycle": 1, + "wcycle": 2, + "recursive": 3, + "invalid": -2147483648, + } class QudaSchwarzType(Enum): @@ -273,7 +396,7 @@ class QudaSchwarzType(Enum): _prefix = "quda_" _suffix = "_schwarz" - _values = {'additive': 0, 'multiplicative': 1, 'invalid': -2147483648} + _values = {"additive": 0, "multiplicative": 1, "invalid": -2147483648} class QudaAcceleratorType(Enum): @@ -284,7 +407,7 @@ class QudaAcceleratorType(Enum): _prefix = "quda_" _suffix = "_accelerator" - _values = {'madwf': 0, 'invalid': -2147483648} + _values = {"madwf": 0, "invalid": -2147483648} class QudaResidualType(Enum): @@ -297,7 +420,12 @@ class QudaResidualType(Enum): _prefix = "quda_" _suffix = "_residual" - _values = {'l2_relative': 1, 'l2_absolute': 2, 'heavy_quark': 4, 'invalid': -2147483648} + _values = { + "l2_relative": 1, + "l2_absolute": 2, + "heavy_quark": 4, + "invalid": -2147483648, + } class QudaCABasis(Enum): @@ -309,7 +437,7 @@ class QudaCABasis(Enum): _prefix = "quda_" _suffix = "_basis" - _values = {'power': 0, 'chebyshev': 1, 'invalid': -2147483648} + _values = {"power": 0, "chebyshev": 1, "invalid": -2147483648} class QudaMatPCType(Enum): @@ -323,7 +451,13 @@ class QudaMatPCType(Enum): _prefix = "quda_matpc_" _suffix = "" - _values = {'even_even': 0, 'odd_odd': 1, 'even_even_asymmetric': 2, 'odd_odd_asymmetric': 3, 'invalid': -2147483648} + _values = { + "even_even": 0, + "odd_odd": 1, + "even_even_asymmetric": 2, + "odd_odd_asymmetric": 3, + "invalid": -2147483648, + } class QudaDagType(Enum): @@ -335,7 +469,7 @@ class QudaDagType(Enum): _prefix = "quda_dag_" _suffix = "" - _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} + _values = {"no": 0, "yes": 1, "invalid": -2147483648} class QudaMassNormalization(Enum): @@ -348,7 +482,7 @@ class QudaMassNormalization(Enum): _prefix = "quda_" _suffix = "_normalization" - _values = {'kappa': 0, 'mass': 1, 'asymmetric_mass': 2, 'invalid': -2147483648} + _values = {"kappa": 0, "mass": 1, "asymmetric_mass": 2, "invalid": -2147483648} class QudaSolverNormalization(Enum): @@ -359,7 +493,7 @@ class QudaSolverNormalization(Enum): _prefix = "quda_" _suffix = "_normalization" - _values = {'default': 0, 'source': 1} + _values = {"default": 0, "source": 1} class QudaPreserveSource(Enum): @@ -371,7 +505,7 @@ class QudaPreserveSource(Enum): _prefix = "quda_preserve_source_" _suffix = "" - _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} + _values = {"no": 0, "yes": 1, "invalid": -2147483648} class QudaDiracFieldOrder(Enum): @@ -388,7 +522,16 @@ class QudaDiracFieldOrder(Enum): _prefix = "quda_" _suffix = "_dirac_order" - _values = {'internal': 0, '': 1, 'qdp': 2, 'qdpjit': 3, 'cps_wilson': 4, 'lex': 5, 'tifr_padded': 6, 'invalid': -2147483648} + _values = { + "internal": 0, + "": 1, + "qdp": 2, + "qdpjit": 3, + "cps_wilson": 4, + "lex": 5, + "tifr_padded": 6, + "invalid": -2147483648, + } class QudaCloverFieldOrder(Enum): @@ -405,7 +548,16 @@ class QudaCloverFieldOrder(Enum): _prefix = "quda_" _suffix = "_clover_order" - _values = {'float': 1, 'float2': 2, 'float4': 4, 'float8': 8, 'packed': 9, 'qdpjit': 10, 'bqcd': 11, 'invalid': -2147483648} + _values = { + "float": 1, + "float2": 2, + "float4": 4, + "float8": 8, + "packed": 9, + "qdpjit": 10, + "bqcd": 11, + "invalid": -2147483648, + } class QudaVerbosity(Enum): @@ -419,7 +571,13 @@ class QudaVerbosity(Enum): _prefix = "quda_" _suffix = "" - _values = {'silent': 0, 'summarize': 1, 'verbose': 2, 'debug_verbose': 3, 'invalid_verbosity': -2147483648} + _values = { + "silent": 0, + "summarize": 1, + "verbose": 2, + "debug_verbose": 3, + "invalid_verbosity": -2147483648, + } class QudaTune(Enum): @@ -431,7 +589,7 @@ class QudaTune(Enum): _prefix = "quda_tune_" _suffix = "" - _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} + _values = {"no": 0, "yes": 1, "invalid": -2147483648} class QudaPreserveDirac(Enum): @@ -443,7 +601,7 @@ class QudaPreserveDirac(Enum): _prefix = "quda_preserve_dirac_" _suffix = "" - _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} + _values = {"no": 0, "yes": 1, "invalid": -2147483648} class QudaParity(Enum): @@ -455,7 +613,7 @@ class QudaParity(Enum): _prefix = "quda_" _suffix = "_parity" - _values = {'even': 0, 'odd': 1, 'invalid': -2147483648} + _values = {"even": 0, "odd": 1, "invalid": -2147483648} class QudaDiracType(Enum): @@ -494,7 +652,38 @@ class QudaDiracType(Enum): _prefix = "quda_" _suffix = "_dirac" - _values = {'wilson': 0, 'wilsonpc': 1, 'clover': 2, 'cloverpc': 3, 'clover_hasenbusch_twist': 4, 'clover_hasenbusch_twistpc': 5, 'domain_wall': 6, 'domain_wallpc': 7, 'domain_wall_4d': 8, 'domain_wall_4dpc': 9, 'mobius_domain_wall': 10, 'mobius_domain_wallpc': 11, 'mobius_domain_wall_eofa': 12, 'mobius_domain_wallpc_eofa': 13, 'staggered': 14, 'staggeredpc': 15, 'staggeredkd': 16, 'asqtad': 17, 'asqtadpc': 18, 'asqtadkd': 19, 'twisted_mass': 20, 'twisted_masspc': 21, 'twisted_clover': 22, 'twisted_cloverpc': 23, 'coarse': 24, 'coarsepc': 25, 'gauge_laplace': 26, 'gauge_laplacepc': 27, 'gauge_covdev': 28, 'invalid': -2147483648} + _values = { + "wilson": 0, + "wilsonpc": 1, + "clover": 2, + "cloverpc": 3, + "clover_hasenbusch_twist": 4, + "clover_hasenbusch_twistpc": 5, + "domain_wall": 6, + "domain_wallpc": 7, + "domain_wall_4d": 8, + "domain_wall_4dpc": 9, + "mobius_domain_wall": 10, + "mobius_domain_wallpc": 11, + "mobius_domain_wall_eofa": 12, + "mobius_domain_wallpc_eofa": 13, + "staggered": 14, + "staggeredpc": 15, + "staggeredkd": 16, + "asqtad": 17, + "asqtadpc": 18, + "asqtadkd": 19, + "twisted_mass": 20, + "twisted_masspc": 21, + "twisted_clover": 22, + "twisted_cloverpc": 23, + "coarse": 24, + "coarsepc": 25, + "gauge_laplace": 26, + "gauge_laplacepc": 27, + "gauge_covdev": 28, + "invalid": -2147483648, + } class QudaFieldLocation(Enum): @@ -506,7 +695,7 @@ class QudaFieldLocation(Enum): _prefix = "quda_" _suffix = "_field_location" - _values = {'cpu': 1, 'cuda': 2, 'invalid': -2147483648} + _values = {"cpu": 1, "cuda": 2, "invalid": -2147483648} class QudaSiteSubset(Enum): @@ -518,7 +707,7 @@ class QudaSiteSubset(Enum): _prefix = "quda_" _suffix = "_site_subset" - _values = {'parity': 1, 'full': 2, 'invalid': -2147483648} + _values = {"parity": 1, "full": 2, "invalid": -2147483648} class QudaSiteOrder(Enum): @@ -531,7 +720,7 @@ class QudaSiteOrder(Enum): _prefix = "quda_" _suffix = "_site_order" - _values = {'lexicographic': 0, 'even_odd': 1, 'odd_even': 2, 'invalid': -2147483648} + _values = {"lexicographic": 0, "even_odd": 1, "odd_even": 2, "invalid": -2147483648} class QudaFieldOrder(Enum): @@ -550,7 +739,18 @@ class QudaFieldOrder(Enum): _prefix = "quda_" _suffix = "_field_order" - _values = {'float': 1, 'float2': 2, 'float4': 4, 'float8': 8, 'space_spin_color': 9, 'space_color_spin': 10, 'qdpjit': 11, 'qop_domain_wall': 12, 'padded_space_spin_color': 13, 'invalid': -2147483648} + _values = { + "float": 1, + "float2": 2, + "float4": 4, + "float8": 8, + "space_spin_color": 9, + "space_color_spin": 10, + "qdpjit": 11, + "qop_domain_wall": 12, + "padded_space_spin_color": 13, + "invalid": -2147483648, + } class QudaFieldCreate(Enum): @@ -565,7 +765,14 @@ class QudaFieldCreate(Enum): _prefix = "quda_" _suffix = "_field_create" - _values = {'null': 0, 'zero': 1, 'copy': 2, 'reference': 3, 'ghost': 4, 'invalid': -2147483648} + _values = { + "null": 0, + "zero": 1, + "copy": 2, + "reference": 3, + "ghost": 4, + "invalid": -2147483648, + } class QudaGammaBasis(Enum): @@ -578,7 +785,7 @@ class QudaGammaBasis(Enum): _prefix = "quda_" _suffix = "_gamma_basis" - _values = {'degrand_rossi': 0, 'ukqcd': 1, 'chiral': 2, 'invalid': -2147483648} + _values = {"degrand_rossi": 0, "ukqcd": 1, "chiral": 2, "invalid": -2147483648} class QudaSourceType(Enum): @@ -593,7 +800,14 @@ class QudaSourceType(Enum): _prefix = "quda_" _suffix = "_source" - _values = {'point': 0, 'random': 1, 'constant': 2, 'sinusoidal': 3, 'corner': 4, 'invalid': -2147483648} + _values = { + "point": 0, + "random": 1, + "constant": 2, + "sinusoidal": 3, + "corner": 4, + "invalid": -2147483648, + } class QudaNoiseType(Enum): @@ -605,7 +819,7 @@ class QudaNoiseType(Enum): _prefix = "quda_noise_" _suffix = "" - _values = {'gauss': 0, 'uniform': 1, 'invalid': -2147483648} + _values = {"gauss": 0, "uniform": 1, "invalid": -2147483648} class QudaDilutionType(Enum): @@ -619,7 +833,13 @@ class QudaDilutionType(Enum): _prefix = "quda_dilution_" _suffix = "" - _values = {'spin': 0, 'color': 1, 'spin_color': 2, 'spin_color_even_odd': 3, 'invalid': -2147483648} + _values = { + "spin": 0, + "color": 1, + "spin_color": 2, + "spin_color_even_odd": 3, + "invalid": -2147483648, + } class QudaProjectionType(Enum): @@ -631,7 +851,7 @@ class QudaProjectionType(Enum): _prefix = "quda_" _suffix = "_projection" - _values = {'minres': 0, 'galerkin': 1, 'invalid': -2147483648} + _values = {"minres": 0, "galerkin": 1, "invalid": -2147483648} class QudaPCType(Enum): @@ -643,7 +863,7 @@ class QudaPCType(Enum): _prefix = "quda_" _suffix = "" - _values = {'4d_pc': 4, '5d_pc': 5, 'pc_invalid': -2147483648} + _values = {"4d_pc": 4, "5d_pc": 5, "pc_invalid": -2147483648} class QudaTwistFlavorType(Enum): @@ -656,7 +876,7 @@ class QudaTwistFlavorType(Enum): _prefix = "quda_twist_" _suffix = "" - _values = {'singlet': 1, 'nondeg_doublet': 2, 'no': 0, 'invalid': -2147483648} + _values = {"singlet": 1, "nondeg_doublet": 2, "no": 0, "invalid": -2147483648} class QudaTwistDslashType(Enum): @@ -670,7 +890,13 @@ class QudaTwistDslashType(Enum): _prefix = "quda_" _suffix = "" - _values = {'deg_twist_inv_dslash': 0, 'deg_dslash_twist_inv': 1, 'deg_dslash_twist_xpay': 2, 'nondeg_dslash': 3, 'dslash_invalid': -2147483648} + _values = { + "deg_twist_inv_dslash": 0, + "deg_dslash_twist_inv": 1, + "deg_dslash_twist_xpay": 2, + "nondeg_dslash": 3, + "dslash_invalid": -2147483648, + } class QudaTwistCloverDslashType(Enum): @@ -683,7 +909,12 @@ class QudaTwistCloverDslashType(Enum): _prefix = "quda_" _suffix = "" - _values = {'deg_clover_twist_inv_dslash': 0, 'deg_dslash_clover_twist_inv': 1, 'deg_dslash_clover_twist_xpay': 2, 'tc_dslash_invalid': -2147483648} + _values = { + "deg_clover_twist_inv_dslash": 0, + "deg_dslash_clover_twist_inv": 1, + "deg_dslash_clover_twist_xpay": 2, + "tc_dslash_invalid": -2147483648, + } class QudaTwistGamma5Type(Enum): @@ -695,7 +926,7 @@ class QudaTwistGamma5Type(Enum): _prefix = "quda_twist_gamma5_" _suffix = "" - _values = {'direct': 0, 'inverse': 1, 'invalid': -2147483648} + _values = {"direct": 0, "inverse": 1, "invalid": -2147483648} class QudaUseInitGuess(Enum): @@ -707,7 +938,7 @@ class QudaUseInitGuess(Enum): _prefix = "quda_use_init_guess_" _suffix = "" - _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} + _values = {"no": 0, "yes": 1, "invalid": -2147483648} class QudaDeflatedGuess(Enum): @@ -719,7 +950,7 @@ class QudaDeflatedGuess(Enum): _prefix = "quda_deflated_guess_" _suffix = "" - _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} + _values = {"no": 0, "yes": 1, "invalid": -2147483648} class QudaComputeNullVector(Enum): @@ -731,7 +962,7 @@ class QudaComputeNullVector(Enum): _prefix = "quda_compute_null_vector_" _suffix = "" - _values = {'no': 0, 'yes': 1, 'invalid': -2147483648} + _values = {"no": 0, "yes": 1, "invalid": -2147483648} class QudaSetupType(Enum): @@ -743,7 +974,11 @@ class QudaSetupType(Enum): _prefix = "quda_" _suffix = "" - _values = {'null_vector_setup': 0, 'test_vector_setup': 1, 'invalid_setup_type': -2147483648} + _values = { + "null_vector_setup": 0, + "test_vector_setup": 1, + "invalid_setup_type": -2147483648, + } class QudaTransferType(Enum): @@ -757,7 +992,13 @@ class QudaTransferType(Enum): _prefix = "quda_transfer_" _suffix = "" - _values = {'aggregate': 0, 'coarse_kd': 1, 'optimized_kd': 2, 'optimized_kd_drop_long': 3, 'invalid': -2147483648} + _values = { + "aggregate": 0, + "coarse_kd": 1, + "optimized_kd": 2, + "optimized_kd_drop_long": 3, + "invalid": -2147483648, + } class QudaBoolean(Enum): @@ -769,7 +1010,7 @@ class QudaBoolean(Enum): _prefix = "quda_boolean_" _suffix = "" - _values = {'false': 0, 'true': 1, 'invalid': -2147483648} + _values = {"false": 0, "true": 1, "invalid": -2147483648} class QudaBLASType(Enum): @@ -781,7 +1022,7 @@ class QudaBLASType(Enum): _prefix = "quda_blas_" _suffix = "" - _values = {'gemm': 0, 'lu_inv': 1, 'invalid': -2147483648} + _values = {"gemm": 0, "lu_inv": 1, "invalid": -2147483648} class QudaBLASOperation(Enum): @@ -794,7 +1035,7 @@ class QudaBLASOperation(Enum): _prefix = "quda_blas_op_" _suffix = "" - _values = {'n': 0, 't': 1, 'c': 2, 'invalid': -2147483648} + _values = {"n": 0, "t": 1, "c": 2, "invalid": -2147483648} class QudaBLASDataType(Enum): @@ -808,7 +1049,7 @@ class QudaBLASDataType(Enum): _prefix = "quda_blas_datatype_" _suffix = "" - _values = {'s': 0, 'd': 1, 'c': 2, 'z': 3, 'invalid': -2147483648} + _values = {"s": 0, "d": 1, "c": 2, "z": 3, "invalid": -2147483648} class QudaBLASDataOrder(Enum): @@ -820,7 +1061,7 @@ class QudaBLASDataOrder(Enum): _prefix = "quda_blas_dataorder_" _suffix = "" - _values = {'row': 0, 'col': 1, 'invalid': -2147483648} + _values = {"row": 0, "col": 1, "invalid": -2147483648} class QudaDirection(Enum): @@ -833,7 +1074,7 @@ class QudaDirection(Enum): _prefix = "quda_" _suffix = "" - _values = {'backwards': -1, 'in_place': 0, 'forwards': 1, 'both_dirs': 2} + _values = {"backwards": -1, "in_place": 0, "forwards": 1, "both_dirs": 2} class QudaLinkDirection(Enum): @@ -845,7 +1086,7 @@ class QudaLinkDirection(Enum): _prefix = "quda_link_" _suffix = "" - _values = {'backwards': 0, 'forwards': 1, 'bidirectional': 2} + _values = {"backwards": 0, "forwards": 1, "bidirectional": 2} class QudaFieldGeometry(Enum): @@ -860,7 +1101,14 @@ class QudaFieldGeometry(Enum): _prefix = "quda_" _suffix = "_geometry" - _values = {'scalar': 1, 'vector': 4, 'tensor': 6, 'coarse': 8, 'kdinverse': 16, 'invalid': -2147483648} + _values = { + "scalar": 1, + "vector": 4, + "tensor": 6, + "coarse": 8, + "kdinverse": 16, + "invalid": -2147483648, + } class QudaGhostExchange(Enum): @@ -873,7 +1121,7 @@ class QudaGhostExchange(Enum): _prefix = "quda_ghost_exchange_" _suffix = "" - _values = {'no': 0, 'pad': 1, 'extended': 2, 'invalid': -2147483648} + _values = {"no": 0, "pad": 1, "extended": 2, "invalid": -2147483648} class QudaStaggeredPhase(Enum): @@ -887,7 +1135,7 @@ class QudaStaggeredPhase(Enum): _prefix = "quda_staggered_phase_" _suffix = "" - _values = {'no': 0, 'milc': 1, 'cps': 2, 'tifr': 3, 'invalid': -2147483648} + _values = {"no": 0, "milc": 1, "cps": 2, "tifr": 3, "invalid": -2147483648} class QudaContractType(Enum): @@ -899,7 +1147,7 @@ class QudaContractType(Enum): _prefix = "quda_contract_type_" _suffix = "" - _values = {'open': 0, 'dr': 1, 'invalid': -2147483648} + _values = {"open": 0, "dr": 1, "invalid": -2147483648} class QudaContractGamma(Enum): @@ -925,7 +1173,25 @@ class QudaContractGamma(Enum): _prefix = "quda_contract_gamma_" _suffix = "" - _values = {'i': 0, 'g1': 1, 'g2': 2, 'g3': 3, 'g4': 4, 'g5': 5, 'g1g5': 6, 'g2g5': 7, 'g3g5': 8, 'g4g5': 9, 's12': 10, 's13': 11, 's14': 12, 's21': 13, 's23': 14, 's34': 15, 'invalid': -2147483648} + _values = { + "i": 0, + "g1": 1, + "g2": 2, + "g3": 3, + "g4": 4, + "g5": 5, + "g1g5": 6, + "g2g5": 7, + "g3g5": 8, + "g4g5": 9, + "s12": 10, + "s13": 11, + "s14": 12, + "s21": 13, + "s23": 14, + "s34": 15, + "invalid": -2147483648, + } class QudaGaugeSmearType(Enum): @@ -940,7 +1206,14 @@ class QudaGaugeSmearType(Enum): _prefix = "quda_gauge_smear_" _suffix = "" - _values = {'ape': 0, 'stout': 1, 'ovrimp_stout': 2, 'wilson_flow': 3, 'symanzik_flow': 4, 'invalid': -2147483648} + _values = { + "ape": 0, + "stout": 1, + "ovrimp_stout": 2, + "wilson_flow": 3, + "symanzik_flow": 4, + "invalid": -2147483648, + } class QudaExtLibType(Enum): @@ -952,4 +1225,4 @@ class QudaExtLibType(Enum): _prefix = "quda_" _suffix = "" - _values = {'cusolve_extlib': 0, 'eigen_extlib': 1, 'extlib_invalid': -2147483648} + _values = {"cusolve_extlib": 0, "eigen_extlib": 1, "extlib_invalid": -2147483648} diff --git a/lyncs_quda/spinor_field.py b/lyncs_quda/spinor_field.py index befd590..bc95c03 100644 --- a/lyncs_quda/spinor_field.py +++ b/lyncs_quda/spinor_field.py @@ -22,7 +22,7 @@ QudaPCType, QudaFieldCreate, QudaNoiseType, - ) +) """ NOTE: diff --git a/lyncs_quda/structs.py b/lyncs_quda/structs.py index 09fe839..2f92eef 100644 --- a/lyncs_quda/structs.py +++ b/lyncs_quda/structs.py @@ -1,4 +1,3 @@ - "List of QUDA parameter structures" # NOTE: This file is automathically generated by setup.py @@ -54,7 +53,49 @@ class QudaGaugeParam(Struct): - site_size : Size of MILC site struct (only if gauge_order=MILC_SITE_GAUGE_ORDER) """ - _types = {'struct_size': 'size_t', 'location': 'QudaFieldLocation', 'X': 'int [ 4 ]', 'anisotropy': 'double', 'tadpole_coeff': 'double', 'scale': 'double', 'type': 'QudaLinkType', 'gauge_order': 'QudaGaugeFieldOrder', 't_boundary': 'QudaTboundary', 'cpu_prec': 'QudaPrecision', 'cuda_prec': 'QudaPrecision', 'reconstruct': 'QudaReconstructType', 'cuda_prec_sloppy': 'QudaPrecision', 'reconstruct_sloppy': 'QudaReconstructType', 'cuda_prec_refinement_sloppy': 'QudaPrecision', 'reconstruct_refinement_sloppy': 'QudaReconstructType', 'cuda_prec_precondition': 'QudaPrecision', 'reconstruct_precondition': 'QudaReconstructType', 'cuda_prec_eigensolver': 'QudaPrecision', 'reconstruct_eigensolver': 'QudaReconstructType', 'gauge_fix': 'QudaGaugeFixed', 'ga_pad': 'int', 'site_ga_pad': 'int', 'staple_pad': 'int', 'llfat_ga_pad': 'int', 'mom_ga_pad': 'int', 'staggered_phase_type': 'QudaStaggeredPhase', 'staggered_phase_applied': 'int', 'i_mu': 'double', 'overlap': 'int', 'overwrite_gauge': 'int', 'overwrite_mom': 'int', 'use_resident_gauge': 'int', 'use_resident_mom': 'int', 'make_resident_gauge': 'int', 'make_resident_mom': 'int', 'return_result_gauge': 'int', 'return_result_mom': 'int', 'gauge_offset': 'size_t', 'mom_offset': 'size_t', 'site_size': 'size_t'} + _types = { + "struct_size": "size_t", + "location": "QudaFieldLocation", + "X": "int [ 4 ]", + "anisotropy": "double", + "tadpole_coeff": "double", + "scale": "double", + "type": "QudaLinkType", + "gauge_order": "QudaGaugeFieldOrder", + "t_boundary": "QudaTboundary", + "cpu_prec": "QudaPrecision", + "cuda_prec": "QudaPrecision", + "reconstruct": "QudaReconstructType", + "cuda_prec_sloppy": "QudaPrecision", + "reconstruct_sloppy": "QudaReconstructType", + "cuda_prec_refinement_sloppy": "QudaPrecision", + "reconstruct_refinement_sloppy": "QudaReconstructType", + "cuda_prec_precondition": "QudaPrecision", + "reconstruct_precondition": "QudaReconstructType", + "cuda_prec_eigensolver": "QudaPrecision", + "reconstruct_eigensolver": "QudaReconstructType", + "gauge_fix": "QudaGaugeFixed", + "ga_pad": "int", + "site_ga_pad": "int", + "staple_pad": "int", + "llfat_ga_pad": "int", + "mom_ga_pad": "int", + "staggered_phase_type": "QudaStaggeredPhase", + "staggered_phase_applied": "int", + "i_mu": "double", + "overlap": "int", + "overwrite_gauge": "int", + "overwrite_mom": "int", + "use_resident_gauge": "int", + "use_resident_mom": "int", + "make_resident_gauge": "int", + "make_resident_mom": "int", + "return_result_gauge": "int", + "return_result_mom": "int", + "gauge_offset": "size_t", + "mom_offset": "size_t", + "site_size": "size_t", + } class QudaInvertParam(Struct): @@ -76,10 +117,10 @@ class QudaInvertParam(Struct): * eofa_pm: plus or minus for the EOFA operator * mq1, mq2, mq3 are the three masses corresponds to Hasenbusch mass spliting. * As far as I know mq1 is always the same as "mass" but it's here just for consistence. - - eofa_pm : - - mq1 : - - mq2 : - - mq3 : + - eofa_pm : + - mq1 : + - mq2 : + - mq3 : - mu : Twisted mass parameter - tm_rho : Hasenbusch mass shift applied like twisted mass to diagonal (but not inverse) - epsilon : Twisted mass parameter @@ -240,7 +281,150 @@ class QudaInvertParam(Struct): - use_mobius_fused_kernel : Whether to use fused kernels for mobius """ - _types = {'struct_size': 'size_t', 'input_location': 'QudaFieldLocation', 'output_location': 'QudaFieldLocation', 'dslash_type': 'QudaDslashType', 'inv_type': 'QudaInverterType', 'mass': 'double', 'kappa': 'double', 'm5': 'double', 'Ls': 'int', 'b_5': 'double_complex [ QUDA_MAX_DWF_LS ]', 'c_5': 'double_complex [ QUDA_MAX_DWF_LS ]', 'eofa_shift': 'double', 'eofa_pm': 'int', 'mq1': 'double', 'mq2': 'double', 'mq3': 'double', 'mu': 'double', 'tm_rho': 'double', 'epsilon': 'double', 'twist_flavor': 'QudaTwistFlavorType', 'laplace3D': 'int', 'tol': 'double', 'tol_restart': 'double', 'tol_hq': 'double', 'compute_true_res': 'int', 'true_res': 'double', 'true_res_hq': 'double', 'maxiter': 'int', 'reliable_delta': 'double', 'reliable_delta_refinement': 'double', 'use_alternative_reliable': 'int', 'use_sloppy_partial_accumulator': 'int', 'solution_accumulator_pipeline': 'int', 'max_res_increase': 'int', 'max_res_increase_total': 'int', 'max_hq_res_increase': 'int', 'max_hq_res_restart_total': 'int', 'heavy_quark_check': 'int', 'pipeline': 'int', 'num_offset': 'int', 'num_src': 'int', 'num_src_per_sub_partition': 'int', 'split_grid': 'int [ QUDA_MAX_DIM ]', 'overlap': 'int', 'offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'tol_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'tol_hq_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'true_res_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'iter_res_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'true_res_hq_offset': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'residue': 'double [ QUDA_MAX_MULTI_SHIFT ]', 'compute_action': 'int', 'action': 'double [ 2 ]', 'solution_type': 'QudaSolutionType', 'solve_type': 'QudaSolveType', 'matpc_type': 'QudaMatPCType', 'dagger': 'QudaDagType', 'mass_normalization': 'QudaMassNormalization', 'solver_normalization': 'QudaSolverNormalization', 'preserve_source': 'QudaPreserveSource', 'cpu_prec': 'QudaPrecision', 'cuda_prec': 'QudaPrecision', 'cuda_prec_sloppy': 'QudaPrecision', 'cuda_prec_refinement_sloppy': 'QudaPrecision', 'cuda_prec_precondition': 'QudaPrecision', 'cuda_prec_eigensolver': 'QudaPrecision', 'dirac_order': 'QudaDiracFieldOrder', 'gamma_basis': 'QudaGammaBasis', 'clover_location': 'QudaFieldLocation', 'clover_cpu_prec': 'QudaPrecision', 'clover_cuda_prec': 'QudaPrecision', 'clover_cuda_prec_sloppy': 'QudaPrecision', 'clover_cuda_prec_refinement_sloppy': 'QudaPrecision', 'clover_cuda_prec_precondition': 'QudaPrecision', 'clover_cuda_prec_eigensolver': 'QudaPrecision', 'clover_order': 'QudaCloverFieldOrder', 'use_init_guess': 'QudaUseInitGuess', 'clover_csw': 'double', 'clover_coeff': 'double', 'clover_rho': 'double', 'compute_clover_trlog': 'int', 'trlogA': 'double [ 2 ]', 'compute_clover': 'int', 'compute_clover_inverse': 'int', 'return_clover': 'int', 'return_clover_inverse': 'int', 'verbosity': 'QudaVerbosity', 'iter': 'int', 'gflops': 'double', 'secs': 'double', 'tune': 'QudaTune', 'Nsteps': 'int', 'gcrNkrylov': 'int', 'inv_type_precondition': 'QudaInverterType', 'preconditioner': 'void *', 'deflation_op': 'void *', 'eig_param': 'void *', 'deflate': 'QudaBoolean', 'dslash_type_precondition': 'QudaDslashType', 'verbosity_precondition': 'QudaVerbosity', 'tol_precondition': 'double', 'maxiter_precondition': 'int', 'omega': 'double', 'ca_basis': 'QudaCABasis', 'ca_lambda_min': 'double', 'ca_lambda_max': 'double', 'ca_basis_precondition': 'QudaCABasis', 'ca_lambda_min_precondition': 'double', 'ca_lambda_max_precondition': 'double', 'precondition_cycle': 'int', 'schwarz_type': 'QudaSchwarzType', 'accelerator_type_precondition': 'QudaAcceleratorType', 'madwf_diagonal_suppressor': 'double', 'madwf_ls': 'int', 'madwf_null_miniter': 'int', 'madwf_null_tol': 'double', 'madwf_train_maxiter': 'int', 'madwf_param_load': 'QudaBoolean', 'madwf_param_save': 'QudaBoolean', 'madwf_param_infile': 'char [ 256 ]', 'madwf_param_outfile': 'char [ 256 ]', 'residual_type': 'QudaResidualType', 'cuda_prec_ritz': 'QudaPrecision', 'n_ev': 'int', 'max_search_dim': 'int', 'rhs_idx': 'int', 'deflation_grid': 'int', 'eigenval_tol': 'double', 'eigcg_max_restarts': 'int', 'max_restart_num': 'int', 'inc_tol': 'double', 'make_resident_solution': 'int', 'use_resident_solution': 'int', 'chrono_make_resident': 'int', 'chrono_replace_last': 'int', 'chrono_use_resident': 'int', 'chrono_max_dim': 'int', 'chrono_index': 'int', 'chrono_precision': 'QudaPrecision', 'extlib_type': 'QudaExtLibType', 'native_blas_lapack': 'QudaBoolean', 'use_mobius_fused_kernel': 'QudaBoolean'} + _types = { + "struct_size": "size_t", + "input_location": "QudaFieldLocation", + "output_location": "QudaFieldLocation", + "dslash_type": "QudaDslashType", + "inv_type": "QudaInverterType", + "mass": "double", + "kappa": "double", + "m5": "double", + "Ls": "int", + "b_5": "double_complex [ QUDA_MAX_DWF_LS ]", + "c_5": "double_complex [ QUDA_MAX_DWF_LS ]", + "eofa_shift": "double", + "eofa_pm": "int", + "mq1": "double", + "mq2": "double", + "mq3": "double", + "mu": "double", + "tm_rho": "double", + "epsilon": "double", + "twist_flavor": "QudaTwistFlavorType", + "laplace3D": "int", + "tol": "double", + "tol_restart": "double", + "tol_hq": "double", + "compute_true_res": "int", + "true_res": "double", + "true_res_hq": "double", + "maxiter": "int", + "reliable_delta": "double", + "reliable_delta_refinement": "double", + "use_alternative_reliable": "int", + "use_sloppy_partial_accumulator": "int", + "solution_accumulator_pipeline": "int", + "max_res_increase": "int", + "max_res_increase_total": "int", + "max_hq_res_increase": "int", + "max_hq_res_restart_total": "int", + "heavy_quark_check": "int", + "pipeline": "int", + "num_offset": "int", + "num_src": "int", + "num_src_per_sub_partition": "int", + "split_grid": "int [ QUDA_MAX_DIM ]", + "overlap": "int", + "offset": "double [ QUDA_MAX_MULTI_SHIFT ]", + "tol_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", + "tol_hq_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", + "true_res_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", + "iter_res_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", + "true_res_hq_offset": "double [ QUDA_MAX_MULTI_SHIFT ]", + "residue": "double [ QUDA_MAX_MULTI_SHIFT ]", + "compute_action": "int", + "action": "double [ 2 ]", + "solution_type": "QudaSolutionType", + "solve_type": "QudaSolveType", + "matpc_type": "QudaMatPCType", + "dagger": "QudaDagType", + "mass_normalization": "QudaMassNormalization", + "solver_normalization": "QudaSolverNormalization", + "preserve_source": "QudaPreserveSource", + "cpu_prec": "QudaPrecision", + "cuda_prec": "QudaPrecision", + "cuda_prec_sloppy": "QudaPrecision", + "cuda_prec_refinement_sloppy": "QudaPrecision", + "cuda_prec_precondition": "QudaPrecision", + "cuda_prec_eigensolver": "QudaPrecision", + "dirac_order": "QudaDiracFieldOrder", + "gamma_basis": "QudaGammaBasis", + "clover_location": "QudaFieldLocation", + "clover_cpu_prec": "QudaPrecision", + "clover_cuda_prec": "QudaPrecision", + "clover_cuda_prec_sloppy": "QudaPrecision", + "clover_cuda_prec_refinement_sloppy": "QudaPrecision", + "clover_cuda_prec_precondition": "QudaPrecision", + "clover_cuda_prec_eigensolver": "QudaPrecision", + "clover_order": "QudaCloverFieldOrder", + "use_init_guess": "QudaUseInitGuess", + "clover_csw": "double", + "clover_coeff": "double", + "clover_rho": "double", + "compute_clover_trlog": "int", + "trlogA": "double [ 2 ]", + "compute_clover": "int", + "compute_clover_inverse": "int", + "return_clover": "int", + "return_clover_inverse": "int", + "verbosity": "QudaVerbosity", + "iter": "int", + "gflops": "double", + "secs": "double", + "tune": "QudaTune", + "Nsteps": "int", + "gcrNkrylov": "int", + "inv_type_precondition": "QudaInverterType", + "preconditioner": "void *", + "deflation_op": "void *", + "eig_param": "void *", + "deflate": "QudaBoolean", + "dslash_type_precondition": "QudaDslashType", + "verbosity_precondition": "QudaVerbosity", + "tol_precondition": "double", + "maxiter_precondition": "int", + "omega": "double", + "ca_basis": "QudaCABasis", + "ca_lambda_min": "double", + "ca_lambda_max": "double", + "ca_basis_precondition": "QudaCABasis", + "ca_lambda_min_precondition": "double", + "ca_lambda_max_precondition": "double", + "precondition_cycle": "int", + "schwarz_type": "QudaSchwarzType", + "accelerator_type_precondition": "QudaAcceleratorType", + "madwf_diagonal_suppressor": "double", + "madwf_ls": "int", + "madwf_null_miniter": "int", + "madwf_null_tol": "double", + "madwf_train_maxiter": "int", + "madwf_param_load": "QudaBoolean", + "madwf_param_save": "QudaBoolean", + "madwf_param_infile": "char [ 256 ]", + "madwf_param_outfile": "char [ 256 ]", + "residual_type": "QudaResidualType", + "cuda_prec_ritz": "QudaPrecision", + "n_ev": "int", + "max_search_dim": "int", + "rhs_idx": "int", + "deflation_grid": "int", + "eigenval_tol": "double", + "eigcg_max_restarts": "int", + "max_restart_num": "int", + "inc_tol": "double", + "make_resident_solution": "int", + "use_resident_solution": "int", + "chrono_make_resident": "int", + "chrono_replace_last": "int", + "chrono_use_resident": "int", + "chrono_max_dim": "int", + "chrono_index": "int", + "chrono_precision": "QudaPrecision", + "extlib_type": "QudaExtLibType", + "native_blas_lapack": "QudaBoolean", + "use_mobius_fused_kernel": "QudaBoolean", + } class QudaEigParam(Struct): @@ -252,7 +436,7 @@ class QudaEigParam(Struct): - use_poly_acc : Use Polynomial Acceleration - poly_deg : Degree of the Chebysev polynomial - a_min : Range used in polynomial acceleration - - a_max : + - a_max : - preserve_deflation : Whether to preserve the deflation space between solves. If true, the space will be stored in an instance of the deflation_space struct, pointed to by preserve_deflation_space @@ -264,8 +448,8 @@ class QudaEigParam(Struct): than the one used to generate the space, then this should be false, but preserve_deflation would be true - use_dagger : What type of Dirac operator we are using **/* If !(use_norm_op) && !(use_dagger) use M. **/* If use_dagger, use Mdag **/* If use_norm_op, use MdagM **/* If use_norm_op && use_dagger use MMdag. **/* If use_pc for any, then use the even-odd pc version - - use_norm_op : - - use_pc : + - use_norm_op : + - use_pc : - use_eigen_qr : Use Eigen routines to eigensolve the upper Hessenberg via QR - compute_svd : Performs an MdagM solve, then constructs the left and right SVD. - compute_gamma5 : Performs the \gamma_5 OP solve by Post multipling the eignvectors with @@ -287,7 +471,7 @@ class QudaEigParam(Struct): - arpack_logfile : For Arpack cross check, name of the Arpack logfile - QUDA_logfile : Name of the QUDA logfile (residua, upper Hessenberg/tridiag matrix updates) - nk : EIG-CG PARAMS - - np : + - np : - import_vectors : Whether to load eigenvectors - cuda_prec_ritz : The precision of the Ritz vectors - mem_type_ritz : The memory type used to keep the Ritz vectors @@ -304,15 +488,62 @@ class QudaEigParam(Struct): - extlib_type : Which external library to use in the deflation operations (Eigen) """ - _types = {'struct_size': 'size_t', 'invert_param': 'QudaInvertParam *', 'eig_type': 'QudaEigType', 'use_poly_acc': 'QudaBoolean', 'poly_deg': 'int', 'a_min': 'double', 'a_max': 'double', 'preserve_deflation': 'QudaBoolean', 'preserve_deflation_space': 'void *', 'preserve_evals': 'QudaBoolean', 'use_dagger': 'QudaBoolean', 'use_norm_op': 'QudaBoolean', 'use_pc': 'QudaBoolean', 'use_eigen_qr': 'QudaBoolean', 'compute_svd': 'QudaBoolean', 'compute_gamma5': 'QudaBoolean', 'require_convergence': 'QudaBoolean', 'spectrum': 'QudaEigSpectrumType', 'n_ev': 'int', 'n_kr': 'int', 'nLockedMax': 'int', 'n_conv': 'int', 'n_ev_deflate': 'int', 'tol': 'double', 'qr_tol': 'double', 'check_interval': 'int', 'max_restarts': 'int', 'batched_rotate': 'int', 'block_size': 'int', 'arpack_check': 'QudaBoolean', 'arpack_logfile': 'char [ 512 ]', 'QUDA_logfile': 'char [ 512 ]', 'nk': 'int', 'np': 'int', 'import_vectors': 'QudaBoolean', 'cuda_prec_ritz': 'QudaPrecision', 'mem_type_ritz': 'QudaMemoryType', 'location': 'QudaFieldLocation', 'run_verify': 'QudaBoolean', 'vec_infile': 'char [ 256 ]', 'vec_outfile': 'char [ 256 ]', 'save_prec': 'QudaPrecision', 'io_parity_inflate': 'QudaBoolean', 'gflops': 'double', 'secs': 'double', 'extlib_type': 'QudaExtLibType'} + _types = { + "struct_size": "size_t", + "invert_param": "QudaInvertParam *", + "eig_type": "QudaEigType", + "use_poly_acc": "QudaBoolean", + "poly_deg": "int", + "a_min": "double", + "a_max": "double", + "preserve_deflation": "QudaBoolean", + "preserve_deflation_space": "void *", + "preserve_evals": "QudaBoolean", + "use_dagger": "QudaBoolean", + "use_norm_op": "QudaBoolean", + "use_pc": "QudaBoolean", + "use_eigen_qr": "QudaBoolean", + "compute_svd": "QudaBoolean", + "compute_gamma5": "QudaBoolean", + "require_convergence": "QudaBoolean", + "spectrum": "QudaEigSpectrumType", + "n_ev": "int", + "n_kr": "int", + "nLockedMax": "int", + "n_conv": "int", + "n_ev_deflate": "int", + "tol": "double", + "qr_tol": "double", + "check_interval": "int", + "max_restarts": "int", + "batched_rotate": "int", + "block_size": "int", + "arpack_check": "QudaBoolean", + "arpack_logfile": "char [ 512 ]", + "QUDA_logfile": "char [ 512 ]", + "nk": "int", + "np": "int", + "import_vectors": "QudaBoolean", + "cuda_prec_ritz": "QudaPrecision", + "mem_type_ritz": "QudaMemoryType", + "location": "QudaFieldLocation", + "run_verify": "QudaBoolean", + "vec_infile": "char [ 256 ]", + "vec_outfile": "char [ 256 ]", + "save_prec": "QudaPrecision", + "io_parity_inflate": "QudaBoolean", + "gflops": "double", + "secs": "double", + "extlib_type": "QudaExtLibType", + } class QudaMultigridParam(Struct): """ QudaMultigridParam struct: - struct_size : Size of this struct in bytes. Used to ensure that the host application and QUDA see the same struct size - - invert_param : - - eig_param : + - invert_param : + - eig_param : - n_level : Number of multigrid levels - geo_block_size : Geometric block sizes to use on each level - spin_block_size : Spin block sizes to use on each level @@ -383,7 +614,76 @@ class QudaMultigridParam(Struct): - thin_update_only : Whether to do a full (false) or thin (true) update in the context of updateMultigridQuda """ - _types = {'struct_size': 'size_t', 'invert_param': 'QudaInvertParam *', 'eig_param': 'QudaEigParam * [ QUDA_MAX_MG_LEVEL ]', 'n_level': 'int', 'geo_block_size': 'int [ QUDA_MAX_MG_LEVEL ] [ QUDA_MAX_DIM ]', 'spin_block_size': 'int [ QUDA_MAX_MG_LEVEL ]', 'n_vec': 'int [ QUDA_MAX_MG_LEVEL ]', 'precision_null': 'QudaPrecision [ QUDA_MAX_MG_LEVEL ]', 'n_block_ortho': 'int [ QUDA_MAX_MG_LEVEL ]', 'block_ortho_two_pass': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'verbosity': 'QudaVerbosity [ QUDA_MAX_MG_LEVEL ]', 'setup_inv_type': 'QudaInverterType [ QUDA_MAX_MG_LEVEL ]', 'num_setup_iter': 'int [ QUDA_MAX_MG_LEVEL ]', 'setup_tol': 'double [ QUDA_MAX_MG_LEVEL ]', 'setup_maxiter': 'int [ QUDA_MAX_MG_LEVEL ]', 'setup_maxiter_refresh': 'int [ QUDA_MAX_MG_LEVEL ]', 'setup_ca_basis': 'QudaCABasis [ QUDA_MAX_MG_LEVEL ]', 'setup_ca_basis_size': 'int [ QUDA_MAX_MG_LEVEL ]', 'setup_ca_lambda_min': 'double [ QUDA_MAX_MG_LEVEL ]', 'setup_ca_lambda_max': 'double [ QUDA_MAX_MG_LEVEL ]', 'setup_type': 'QudaSetupType', 'pre_orthonormalize': 'QudaBoolean', 'post_orthonormalize': 'QudaBoolean', 'coarse_solver': 'QudaInverterType [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_tol': 'double [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_maxiter': 'int [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_ca_basis': 'QudaCABasis [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_ca_basis_size': 'int [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_ca_lambda_min': 'double [ QUDA_MAX_MG_LEVEL ]', 'coarse_solver_ca_lambda_max': 'double [ QUDA_MAX_MG_LEVEL ]', 'smoother': 'QudaInverterType [ QUDA_MAX_MG_LEVEL ]', 'smoother_tol': 'double [ QUDA_MAX_MG_LEVEL ]', 'nu_pre': 'int [ QUDA_MAX_MG_LEVEL ]', 'nu_post': 'int [ QUDA_MAX_MG_LEVEL ]', 'smoother_solver_ca_basis': 'QudaCABasis [ QUDA_MAX_MG_LEVEL ]', 'smoother_solver_ca_lambda_min': 'double [ QUDA_MAX_MG_LEVEL ]', 'smoother_solver_ca_lambda_max': 'double [ QUDA_MAX_MG_LEVEL ]', 'omega': 'double [ QUDA_MAX_MG_LEVEL ]', 'smoother_halo_precision': 'QudaPrecision [ QUDA_MAX_MG_LEVEL ]', 'smoother_schwarz_type': 'QudaSchwarzType [ QUDA_MAX_MG_LEVEL ]', 'smoother_schwarz_cycle': 'int [ QUDA_MAX_MG_LEVEL ]', 'coarse_grid_solution_type': 'QudaSolutionType [ QUDA_MAX_MG_LEVEL ]', 'smoother_solve_type': 'QudaSolveType [ QUDA_MAX_MG_LEVEL ]', 'cycle_type': 'QudaMultigridCycleType [ QUDA_MAX_MG_LEVEL ]', 'global_reduction': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'location': 'QudaFieldLocation [ QUDA_MAX_MG_LEVEL ]', 'setup_location': 'QudaFieldLocation [ QUDA_MAX_MG_LEVEL ]', 'use_eig_solver': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'setup_minimize_memory': 'QudaBoolean', 'compute_null_vector': 'QudaComputeNullVector', 'generate_all_levels': 'QudaBoolean', 'run_verify': 'QudaBoolean', 'run_low_mode_check': 'QudaBoolean', 'run_oblique_proj_check': 'QudaBoolean', 'vec_load': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'vec_infile': 'char [ QUDA_MAX_MG_LEVEL ] [ 256 ]', 'vec_store': 'QudaBoolean [ QUDA_MAX_MG_LEVEL ]', 'vec_outfile': 'char [ QUDA_MAX_MG_LEVEL ] [ 256 ]', 'coarse_guess': 'QudaBoolean', 'preserve_deflation': 'QudaBoolean', 'gflops': 'double', 'secs': 'double', 'mu_factor': 'double [ QUDA_MAX_MG_LEVEL ]', 'transfer_type': 'QudaTransferType [ QUDA_MAX_MG_LEVEL ]', 'allow_truncation': 'QudaBoolean', 'staggered_kd_dagger_approximation': 'QudaBoolean', 'use_mma': 'QudaBoolean', 'thin_update_only': 'QudaBoolean'} + _types = { + "struct_size": "size_t", + "invert_param": "QudaInvertParam *", + "eig_param": "QudaEigParam * [ QUDA_MAX_MG_LEVEL ]", + "n_level": "int", + "geo_block_size": "int [ QUDA_MAX_MG_LEVEL ] [ QUDA_MAX_DIM ]", + "spin_block_size": "int [ QUDA_MAX_MG_LEVEL ]", + "n_vec": "int [ QUDA_MAX_MG_LEVEL ]", + "precision_null": "QudaPrecision [ QUDA_MAX_MG_LEVEL ]", + "n_block_ortho": "int [ QUDA_MAX_MG_LEVEL ]", + "block_ortho_two_pass": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", + "verbosity": "QudaVerbosity [ QUDA_MAX_MG_LEVEL ]", + "setup_inv_type": "QudaInverterType [ QUDA_MAX_MG_LEVEL ]", + "num_setup_iter": "int [ QUDA_MAX_MG_LEVEL ]", + "setup_tol": "double [ QUDA_MAX_MG_LEVEL ]", + "setup_maxiter": "int [ QUDA_MAX_MG_LEVEL ]", + "setup_maxiter_refresh": "int [ QUDA_MAX_MG_LEVEL ]", + "setup_ca_basis": "QudaCABasis [ QUDA_MAX_MG_LEVEL ]", + "setup_ca_basis_size": "int [ QUDA_MAX_MG_LEVEL ]", + "setup_ca_lambda_min": "double [ QUDA_MAX_MG_LEVEL ]", + "setup_ca_lambda_max": "double [ QUDA_MAX_MG_LEVEL ]", + "setup_type": "QudaSetupType", + "pre_orthonormalize": "QudaBoolean", + "post_orthonormalize": "QudaBoolean", + "coarse_solver": "QudaInverterType [ QUDA_MAX_MG_LEVEL ]", + "coarse_solver_tol": "double [ QUDA_MAX_MG_LEVEL ]", + "coarse_solver_maxiter": "int [ QUDA_MAX_MG_LEVEL ]", + "coarse_solver_ca_basis": "QudaCABasis [ QUDA_MAX_MG_LEVEL ]", + "coarse_solver_ca_basis_size": "int [ QUDA_MAX_MG_LEVEL ]", + "coarse_solver_ca_lambda_min": "double [ QUDA_MAX_MG_LEVEL ]", + "coarse_solver_ca_lambda_max": "double [ QUDA_MAX_MG_LEVEL ]", + "smoother": "QudaInverterType [ QUDA_MAX_MG_LEVEL ]", + "smoother_tol": "double [ QUDA_MAX_MG_LEVEL ]", + "nu_pre": "int [ QUDA_MAX_MG_LEVEL ]", + "nu_post": "int [ QUDA_MAX_MG_LEVEL ]", + "smoother_solver_ca_basis": "QudaCABasis [ QUDA_MAX_MG_LEVEL ]", + "smoother_solver_ca_lambda_min": "double [ QUDA_MAX_MG_LEVEL ]", + "smoother_solver_ca_lambda_max": "double [ QUDA_MAX_MG_LEVEL ]", + "omega": "double [ QUDA_MAX_MG_LEVEL ]", + "smoother_halo_precision": "QudaPrecision [ QUDA_MAX_MG_LEVEL ]", + "smoother_schwarz_type": "QudaSchwarzType [ QUDA_MAX_MG_LEVEL ]", + "smoother_schwarz_cycle": "int [ QUDA_MAX_MG_LEVEL ]", + "coarse_grid_solution_type": "QudaSolutionType [ QUDA_MAX_MG_LEVEL ]", + "smoother_solve_type": "QudaSolveType [ QUDA_MAX_MG_LEVEL ]", + "cycle_type": "QudaMultigridCycleType [ QUDA_MAX_MG_LEVEL ]", + "global_reduction": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", + "location": "QudaFieldLocation [ QUDA_MAX_MG_LEVEL ]", + "setup_location": "QudaFieldLocation [ QUDA_MAX_MG_LEVEL ]", + "use_eig_solver": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", + "setup_minimize_memory": "QudaBoolean", + "compute_null_vector": "QudaComputeNullVector", + "generate_all_levels": "QudaBoolean", + "run_verify": "QudaBoolean", + "run_low_mode_check": "QudaBoolean", + "run_oblique_proj_check": "QudaBoolean", + "vec_load": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", + "vec_infile": "char [ QUDA_MAX_MG_LEVEL ] [ 256 ]", + "vec_store": "QudaBoolean [ QUDA_MAX_MG_LEVEL ]", + "vec_outfile": "char [ QUDA_MAX_MG_LEVEL ] [ 256 ]", + "coarse_guess": "QudaBoolean", + "preserve_deflation": "QudaBoolean", + "gflops": "double", + "secs": "double", + "mu_factor": "double [ QUDA_MAX_MG_LEVEL ]", + "transfer_type": "QudaTransferType [ QUDA_MAX_MG_LEVEL ]", + "allow_truncation": "QudaBoolean", + "staggered_kd_dagger_approximation": "QudaBoolean", + "use_mma": "QudaBoolean", + "thin_update_only": "QudaBoolean", + } class QudaGaugeObservableParam(Struct): @@ -411,7 +711,28 @@ class QudaGaugeObservableParam(Struct): - remove_staggered_phase : Whether or not the resident gauge field has staggered phases applied and if they should """ - _types = {'struct_size': 'size_t', 'su_project': 'QudaBoolean', 'compute_plaquette': 'QudaBoolean', 'plaquette': 'double [ 3 ]', 'compute_polyakov_loop': 'QudaBoolean', 'ploop': 'double [ 2 ]', 'compute_gauge_loop_trace': 'QudaBoolean', 'traces': 'double_complex *', 'input_path_buff': 'int * *', 'path_length': 'int *', 'loop_coeff': 'double *', 'num_paths': 'int', 'max_length': 'int', 'factor': 'double', 'compute_qcharge': 'QudaBoolean', 'qcharge': 'double', 'energy': 'double [ 3 ]', 'compute_qcharge_density': 'QudaBoolean', 'qcharge_density': 'void *', 'remove_staggered_phase': ''} + _types = { + "struct_size": "size_t", + "su_project": "QudaBoolean", + "compute_plaquette": "QudaBoolean", + "plaquette": "double [ 3 ]", + "compute_polyakov_loop": "QudaBoolean", + "ploop": "double [ 2 ]", + "compute_gauge_loop_trace": "QudaBoolean", + "traces": "double_complex *", + "input_path_buff": "int * *", + "path_length": "int *", + "loop_coeff": "double *", + "num_paths": "int", + "max_length": "int", + "factor": "double", + "compute_qcharge": "QudaBoolean", + "qcharge": "double", + "energy": "double [ 3 ]", + "compute_qcharge_density": "QudaBoolean", + "qcharge_density": "void *", + "remove_staggered_phase": "", + } class QudaGaugeSmearParam(Struct): @@ -426,7 +747,15 @@ class QudaGaugeSmearParam(Struct): - smear_type : The smearing type to perform """ - _types = {'struct_size': 'size_t', 'n_steps': 'unsigned int', 'epsilon': 'double', 'alpha': 'double', 'rho': 'double', 'meas_interval': 'unsigned int', 'smear_type': 'QudaGaugeSmearType'} + _types = { + "struct_size": "size_t", + "n_steps": "unsigned int", + "epsilon": "double", + "alpha": "double", + "rho": "double", + "meas_interval": "unsigned int", + "smear_type": "QudaGaugeSmearType", + } class QudaBLASParam(Struct): @@ -456,4 +785,27 @@ class QudaBLASParam(Struct): - data_order : Specifies if using Row or Column major """ - _types = {'struct_size': 'size_t', 'blas_type': 'QudaBLASType', 'trans_a': 'QudaBLASOperation', 'trans_b': 'QudaBLASOperation', 'm': 'int', 'n': 'int', 'k': 'int', 'lda': 'int', 'ldb': 'int', 'ldc': 'int', 'a_offset': 'int', 'b_offset': 'int', 'c_offset': 'int', 'a_stride': 'int', 'b_stride': 'int', 'c_stride': 'int', 'alpha': 'double_complex', 'beta': 'double_complex', 'inv_mat_size': 'int', 'batch_count': 'int', 'data_type': 'QudaBLASDataType', 'data_order': 'QudaBLASDataOrder'} + _types = { + "struct_size": "size_t", + "blas_type": "QudaBLASType", + "trans_a": "QudaBLASOperation", + "trans_b": "QudaBLASOperation", + "m": "int", + "n": "int", + "k": "int", + "lda": "int", + "ldb": "int", + "ldc": "int", + "a_offset": "int", + "b_offset": "int", + "c_offset": "int", + "a_stride": "int", + "b_stride": "int", + "c_stride": "int", + "alpha": "double_complex", + "beta": "double_complex", + "inv_mat_size": "int", + "batch_count": "int", + "data_type": "QudaBLASDataType", + "data_order": "QudaBLASDataOrder", + } diff --git a/test/test_error.py b/test/test_error.py index 82355d7..42aa5b5 100644 --- a/test/test_error.py +++ b/test/test_error.py @@ -4,7 +4,7 @@ from lyncs_quda.testing import ( fixlib as lib, lattice_loop, - ) +) @lattice_loop diff --git a/test/test_evenodd.py b/test/test_evenodd.py index 8759091..3505249 100644 --- a/test/test_evenodd.py +++ b/test/test_evenodd.py @@ -4,6 +4,7 @@ from lyncs_quda.lib import fixlib as lib import numpy as np + @pytest.fixture(params=[(4,), (4, 8), (4, 4, 8), (4, 6, 8, 2)]) def shape(request): return request.param @@ -18,6 +19,7 @@ def inner(request): def outer(request): return request.param + def test_evenodd(lib, shape, inner, outer): tile = np.array([1, -1]) for i in range(1, len(shape)): From b3cb8bae268498cc7fb87b3f6e62fa5172508ecc Mon Sep 17 00:00:00 2001 From: Simone Bacchio Date: Tue, 28 Mar 2023 16:43:55 +0000 Subject: [PATCH 7/7] Updating pylint score (from Github Action) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d730bb7..5c87580 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![build & test](https://img.shields.io/github/workflow/status/Lyncs-API/lyncs.quda/build%20&%20test?logo=github&logoColor=white)](https://github.com/Lyncs-API/lyncs.quda/actions) --> [![license](https://img.shields.io/github/license/Lyncs-API/lyncs.quda?logo=github&logoColor=white)](https://github.com/Lyncs-API/lyncs.quda/blob/master/LICENSE) -[![pylint](https://img.shields.io/badge/pylint%20score-8.5%2F10-yellowgreen?logo=python&logoColor=white)](http://pylint.pycqa.org/) +[![pylint](https://img.shields.io/badge/pylint%20score-7.9%2F10-yellow?logo=python&logoColor=white)](http://pylint.pycqa.org/) [![black](https://img.shields.io/badge/code%20style-black-000000.svg?logo=codefactor&logoColor=white)](https://github.com/ambv/black) [QUDA](http://lattice.github.io/quda/) is a library for performing calculations in lattice QCD on GPUs.