QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Functions
quda_milc_interface.h File Reference
#include <enum_quda.h>
#include <quda.h>
Include dependency graph for quda_milc_interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  QudaMILCSiteArg_t
 
struct  QudaInvertArgs_t
 
struct  QudaEigArgs_t
 
struct  QudaLayout_t
 
struct  QudaInitArgs_t
 
struct  QudaHisqParams_t
 
struct  QudaFatLinkArgs_t
 

Functions

void qudaSetMPICommHandle (void *mycomm)
 
void qudaInit (QudaInitArgs_t input)
 
void qudaSetLayout (QudaLayout_t layout)
 
void qudaFinalize ()
 
void * qudaAllocatePinned (size_t bytes)
 
void qudaFreePinned (void *ptr)
 
void qudaHisqParamsInit (QudaHisqParams_t hisq_params)
 
void qudaLoadKSLink (int precision, QudaFatLinkArgs_t fatlink_args, const double act_path_coeff[6], void *inlink, void *fatlink, void *longlink)
 
void qudaLoadUnitarizedLink (int precision, QudaFatLinkArgs_t fatlink_args, const double path_coeff[6], void *inlink, void *fatlink, void *ulink)
 
void qudaDslash (int external_precision, int quda_precision, QudaInvertArgs_t inv_args, const void *const milc_fatlink, const void *const milc_longlink, void *source, void *solution, int *num_iters)
 
void qudaDDInvert (int external_precision, int quda_precision, double mass, QudaInvertArgs_t inv_args, double target_residual, double target_fermilab_residual, const int *const domain_overlap, const void *const fatlink, const void *const longlink, void *source, void *solution, double *const final_residual, double *const final_fermilab_residual, int *num_iters)
 
void qudaInvert (int external_precision, int quda_precision, double mass, QudaInvertArgs_t inv_args, double target_residual, double target_fermilab_residual, const void *const milc_fatlink, const void *const milc_longlink, void *source, void *solution, double *const final_resid, double *const final_rel_resid, int *num_iters)
 
void qudaInvertMsrc (int external_precision, int quda_precision, double mass, QudaInvertArgs_t inv_args, double target_residual, double target_fermilab_residual, const void *const fatlink, const void *const longlink, void **sourceArray, void **solutionArray, double *const final_residual, double *const final_fermilab_residual, int *num_iters, int num_src)
 
void qudaMultishiftInvert (int external_precision, int precision, int num_offsets, double *const offset, QudaInvertArgs_t inv_args, const double *target_residual, const double *target_fermilab_residual, const void *const milc_fatlink, const void *const milc_longlink, void *source, void **solutionArray, double *const final_residual, double *const final_fermilab_residual, int *num_iters)
 
void qudaEigCGInvert (int external_precision, int quda_precision, double mass, QudaInvertArgs_t inv_args, double target_residual, double target_fermilab_residual, const void *const fatlink, const void *const longlink, void *source, void *solution, QudaEigArgs_t eig_args, const int rhs_idx, const int last_rhs_flag, double *const final_residual, double *const final_fermilab_residual, int *num_iters)
 
void qudaCloverInvert (int external_precision, int quda_precision, double kappa, double clover_coeff, QudaInvertArgs_t inv_args, double target_residual, double target_fermilab_residual, const void *milc_link, void *milc_clover, void *milc_clover_inv, void *source, void *solution, double *const final_residual, double *const final_fermilab_residual, int *num_iters)
 
void qudaEigCGCloverInvert (int external_precision, int quda_precision, double kappa, double clover_coeff, QudaInvertArgs_t inv_args, double target_residual, double target_fermilab_residual, const void *milc_link, void *milc_clover, void *milc_clover_inv, void *source, void *solution, QudaEigArgs_t eig_args, const int rhs_idx, const int last_rhs_flag, double *const final_residual, double *const final_fermilab_residual, int *num_iters)
 
void qudaLoadGaugeField (int external_precision, int quda_precision, QudaInvertArgs_t inv_args, const void *milc_link)
 
void qudaFreeGaugeField ()
 
void qudaLoadCloverField (int external_precision, int quda_precision, QudaInvertArgs_t inv_args, void *milc_clover, void *milc_clover_inv, QudaSolutionType solution_type, QudaSolveType solve_type, double clover_coeff, int compute_trlog, double *trlog)
 
void qudaFreeCloverField ()
 
void qudaCloverMultishiftInvert (int external_precision, int quda_precision, int num_offsets, double *const offset, double kappa, double clover_coeff, QudaInvertArgs_t inv_args, const double *target_residual, const void *milc_link, void *milc_clover, void *milc_clover_inv, void *source, void **solutionArray, double *const final_residual, int *num_iters)
 
void qudaHisqForce (int precision, int num_terms, int num_naik_terms, double dt, double **coeff, void **quark_field, const double level2_coeff[6], const double fat7_coeff[6], const void *const w_link, const void *const v_link, const void *const u_link, void *const milc_momentum)
 
void qudaGaugeForce (int precision, int num_loop_types, double milc_loop_coeff[3], double eb3, QudaMILCSiteArg_t *arg)
 
void qudaUpdateU (int precision, double eps, QudaMILCSiteArg_t *arg)
 
double qudaMomAction (int precision, void *momentum)
 
void qudaRephase (int prec, void *gauge, int flag, double i_mu)
 
void qudaUnitarizeSU3 (int prec, double tol, QudaMILCSiteArg_t *arg)
 
void qudaCloverForce (void *mom, double dt, void **x, void **p, double *coeff, double kappa, double ck, int nvec, double multiplicity, void *gauge, int precision, QudaInvertArgs_t inv_args)
 
void qudaCloverTrace (void *out, void *dummy, int mu, int nu)
 
void qudaCloverDerivative (void *out, void *gauge, void *oprod, int mu, int nu, double coeff, int precision, int parity, int conjugate)
 
void * qudaCreateExtendedGaugeField (void *gauge, int geometry, int precision)
 
void * qudaResidentExtendedGaugeField (void *gauge, int geometry, int precision)
 
void * qudaCreateGaugeField (void *gauge, int geometry, int precision)
 
void qudaSaveGaugeField (void *gauge, void *inGauge)
 
void qudaDestroyGaugeField (void *gauge)
 
void qudaGaugeFixingOVR (const int precision, const unsigned int gauge_dir, const int Nsteps, const int verbose_interval, const double relax_boost, const double tolerance, const unsigned int reunit_interval, const unsigned int stopWtheta, void *milc_sitelink)
 Gauge fixing with overrelaxation with support for single and multi GPU. More...
 
void qudaGaugeFixingFFT (int precision, unsigned int gauge_dir, int Nsteps, int verbose_interval, double alpha, unsigned int autotune, double tolerance, unsigned int stopWtheta, void *milc_sitelink)
 Gauge fixing with Steepest descent method with FFTs with support for single GPU only. More...
 
void qudaAsqtadForce (int precision, const double act_path_coeff[6], const void *const one_link_src[4], const void *const naik_src[4], const void *const link, void *const milc_momentum)
 
void qudaComputeOprod (int precision, int num_terms, int num_naik_terms, double **coeff, double scale, void **quark_field, void *oprod[3])
 

Detailed Description

Description

The header file defines the milc interface to enable easy interfacing between QUDA and the MILC software packed.

Definition in file quda_milc_interface.h.

Function Documentation

◆ qudaAllocatePinned()

void* qudaAllocatePinned ( size_t  bytes)

Allocate pinned memory suitable for CPU-GPU transfers

Parameters
bytesThe size of the requested allocation
Returns
Pointer to allocated memory

◆ qudaAsqtadForce()

void qudaAsqtadForce ( int  precision,
const double  act_path_coeff[6],
const void *const  one_link_src[4],
const void *const  naik_src[4],
const void *const  link,
void *const  milc_momentum 
)

Note this interface function has been removed. This stub remains for compatibility only.

◆ qudaCloverDerivative()

void qudaCloverDerivative ( void *  out,
void *  gauge,
void *  oprod,
int  mu,
int  nu,
double  coeff,
int  precision,
int  parity,
int  conjugate 
)

Compute the derivative of the clover term (part of clover force computation). All the pointers here are for QUDA native device objects. The precisions of all fields must match.

Parameters
outClover derivative field (QUDA device field, geometry = 1)
gaugeGauge field (extended QUDA device field, gemoetry = 4)
oprodMatrix field (outer product) which is multiplied by the derivative
mumu direction
nunu direction
coeffCoefficient of the clover derviative (including stepsize and clover coefficient)
precisionPrecision of the fields (2 = double, 1 = single)
parityParity for which we are computing
conjugateWhether to make the oprod field anti-hermitian prior to multiplication

◆ qudaCloverForce()

void qudaCloverForce ( void *  mom,
double  dt,
void **  x,
void **  p,
double *  coeff,
double  kappa,
double  ck,
int  nvec,
double  multiplicity,
void *  gauge,
int  precision,
QudaInvertArgs_t  inv_args 
)

Compute the clover force contributions in each dimension mu given the array solution fields, and compute the resulting momentum field.

Parameters
momMomentum matrix
dtIntegrating step size
xArray of solution vectors
pArray of intermediate vectors
coeffArray of residues for each contribution
kappakappa parameter
ck-clover_coefficient * kappa / 8
nvecNumber of vectors
multiplicityNumber of fermions represented by this bilinear
gaugeGauge Field
precisionPrecision of the fields
inv_argsStruct setting some solver metadata

◆ qudaCloverInvert()

void qudaCloverInvert ( int  external_precision,
int  quda_precision,
double  kappa,
double  clover_coeff,
QudaInvertArgs_t  inv_args,
double  target_residual,
double  target_fermilab_residual,
const void *  milc_link,
void *  milc_clover,
void *  milc_clover_inv,
void *  source,
void *  solution,
double *const  final_residual,
double *const  final_fermilab_residual,
int *  num_iters 
)

Solve Ax=b using a Wilson-Clover operator. All fields are fields passed and returned are host (CPU) field in MILC order. This function creates the gauge and clover field from the host fields. Reliable updates are used with a reliable_delta parameter of 0.1.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
quda_precisionPrecision for QUDA to use (2 - double, 1 - single)
kappaKappa value
clover_coeffClover coefficient
inv_argsStruct setting some solver metadata
target_residualTarget residual
milc_linkGauge field on the host
milc_cloverClover field on the host
milc_clover_invInverse clover on the host
clover_coeffClover coefficient
sourceRight-hand side source field
solutionSolution spinor field
final_residualTrue residual returned by the solver
final_residualTrue Fermilab residual returned by the solver
num_itersNumber of iterations taken

◆ qudaCloverMultishiftInvert()

void qudaCloverMultishiftInvert ( int  external_precision,
int  quda_precision,
int  num_offsets,
double *const  offset,
double  kappa,
double  clover_coeff,
QudaInvertArgs_t  inv_args,
const double *  target_residual,
const void *  milc_link,
void *  milc_clover,
void *  milc_clover_inv,
void *  source,
void **  solutionArray,
double *const  final_residual,
int *  num_iters 
)

Solve for multiple shifts (e.g., masses) using a Wilson-Clover operator with multi-shift CG. All fields are fields passed and returned are host (CPU) field in MILC order. This function requires that persistent gauge and clover fields have been created prior. When a pure double-precision solver is requested no reliable updates are used, else reliable updates are used with a reliable_delta parameter of 0.1.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
quda_precisionPrecision for QUDA to use (2 - double, 1 - single)
num_offsetsNumber of shifts to solve for
offsetArray of shift offset values
kappaKappa value
clover_coeffClover coefficient
inv_argsStruct setting some solver metadata
target_residualArray of target residuals per shift
milc_linkIgnored
milc_cloverIgnored
milc_clover_invIgnored
clover_coeffClover coefficient
sourceRight-hand side source field
solutionArrayArray of solution spinor fields
final_residualArray of true residuals
num_itersNumber of iterations taken

◆ qudaCloverTrace()

void qudaCloverTrace ( void *  out,
void *  dummy,
int  mu,
int  nu 
)

Compute the sigma trace field (part of clover force computation). All the pointers here are for QUDA native device objects. The precisions of all fields must match. This function requires that there is a persistent clover field.

Parameters
outSigma trace field (QUDA device field, geometry = 1)
dummy(not used)
mumu direction
nunu direction

◆ qudaComputeOprod()

void qudaComputeOprod ( int  precision,
int  num_terms,
int  num_naik_terms,
double **  coeff,
double  scale,
void **  quark_field,
void *  oprod[3] 
)

Note this interface function has been removed. This stub remains for compatibility only.

◆ qudaCreateExtendedGaugeField()

void* qudaCreateExtendedGaugeField ( void *  gauge,
int  geometry,
int  precision 
)

Take a gauge field on the host, load it onto the device and extend it. Return a pointer to the extended gauge field object.

Parameters
gaugeThe CPU gauge field (optional - if set to 0 then the gauge field zeroed)
geometryThe geometry of the matrix field to create (1 - scaler, 4 - vector, 6 - tensor)
precisionThe precision of the fields (2 - double, 1 - single)
Returns
Pointer to the gauge field (cast as a void*)

◆ qudaCreateGaugeField()

void* qudaCreateGaugeField ( void *  gauge,
int  geometry,
int  precision 
)

Allocate a gauge (matrix) field on the device and optionally download a host gauge field.

Parameters
gaugeThe host gauge field (optional - if set to 0 then the gauge field zeroed)
geometryThe geometry of the matrix field to create (1 - scaler, 4 - vector, 6 - tensor)
precisionThe precision of the field to be created (2 - double, 1 - single)
Returns
Pointer to the gauge field (cast as a void*)

◆ qudaDDInvert()

void qudaDDInvert ( int  external_precision,
int  quda_precision,
double  mass,
QudaInvertArgs_t  inv_args,
double  target_residual,
double  target_fermilab_residual,
const int *const  domain_overlap,
const void *const  fatlink,
const void *const  longlink,
void *  source,
void *  solution,
double *const  final_residual,
double *const  final_fermilab_residual,
int *  num_iters 
)

Solve Ax=b using an improved staggered operator with a domain-decomposition preconditioner. All fields are fields passed and returned are host (CPU) field in MILC order. This function requires that persistent gauge and clover fields have been created prior. This interface is experimental.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
precisionPrecision for QUDA to use (2 - double, 1 - single)
massFermion mass parameter
inv_argsStruct setting some solver metadata
target_residualTarget residual
target_relative_residualTarget Fermilab residual
domain_overlapArray specifying the overlap of the domains in each dimension
fatlinkFat-link field on the host
longlinkLong-link field on the host
sourceRight-hand side source field
solutionSolution spinor field
final_residualTrue residual
final_relative_residualTrue Fermilab residual
num_itersNumber of iterations taken

◆ qudaDestroyGaugeField()

void qudaDestroyGaugeField ( void *  gauge)

Reinterpret gauge as a pointer to cudaGaugeField and call destructor.

Parameters
gaugeGauge field to be freed

◆ qudaDslash()

void qudaDslash ( int  external_precision,
int  quda_precision,
QudaInvertArgs_t  inv_args,
const void *const  milc_fatlink,
const void *const  milc_longlink,
void *  source,
void *  solution,
int *  num_iters 
)

Apply the improved staggered operator to a field. All fields passed and returned are host (CPU) field in MILC order.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
quda_precisionPrecision for QUDA to use (2 - double, 1 - single)
inv_argsStruct setting some solver metadata
milc_fatlinkFat-link field on the host
milc_longlinkLong-link field on the host
sourceRight-hand side source field
solutionSolution spinor field

◆ qudaEigCGCloverInvert()

void qudaEigCGCloverInvert ( int  external_precision,
int  quda_precision,
double  kappa,
double  clover_coeff,
QudaInvertArgs_t  inv_args,
double  target_residual,
double  target_fermilab_residual,
const void *  milc_link,
void *  milc_clover,
void *  milc_clover_inv,
void *  source,
void *  solution,
QudaEigArgs_t  eig_args,
const int  rhs_idx,
const int  last_rhs_flag,
double *const  final_residual,
double *const  final_fermilab_residual,
int *  num_iters 
)

Solve for a system with many RHS using using a Wilson-Clover operator. The solving procedure consists of two computation phases : 1) incremental pahse : call eigCG solver to accumulate low eigenmodes 2) deflation phase : use computed eigenmodes to deflate a regular CG All fields are fields passed and returned are host (CPU) field in MILC order. This function requires that persistent gauge and clover fields have been created prior.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
quda_precisionPrecision for QUDA to use (2 - double, 1 - single)
kappaKappa value
clover_coeffClover coefficient
inv_argsStruct setting some solver metadata
target_residualTarget residual
milc_linkGauge field on the host
milc_cloverClover field on the host
milc_clover_invInverse clover on the host
clover_coeffClover coefficient
sourceRight-hand side source field
solutionSolution spinor field
eig_argscontains info about deflation space
rhs_idxbookkeep current rhs
last_rhs_flagis this the last rhs to solve?
final_residualArray of true residuals
final_relative_residualArray of true Fermilab residuals
num_itersNumber of iterations taken

◆ qudaEigCGInvert()

void qudaEigCGInvert ( int  external_precision,
int  quda_precision,
double  mass,
QudaInvertArgs_t  inv_args,
double  target_residual,
double  target_fermilab_residual,
const void *const  fatlink,
const void *const  longlink,
void *  source,
void *  solution,
QudaEigArgs_t  eig_args,
const int  rhs_idx,
const int  last_rhs_flag,
double *const  final_residual,
double *const  final_fermilab_residual,
int *  num_iters 
)

Solve for a system with many RHS using an improved staggered operator. The solving procedure consists of two computation phases : 1) incremental pahse : call eigCG solver to accumulate low eigenmodes 2) deflation phase : use computed eigenmodes to deflate a regular CG All fields are fields passed and returned are host (CPU) field in MILC order. This function requires that persistent gauge and clover fields have been created prior.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
precisionPrecision for QUDA to use (2 - double, 1 - single)
num_offsetsNumber of shifts to solve for
offsetArray of shift offset values
inv_argsStruct setting some solver metadata
target_residualArray of target residuals per shift
target_relative_residualArray of target Fermilab residuals per shift
milc_fatlinkFat-link field on the host
milc_longlinkLong-link field on the host
sourceRight-hand side source field
solutionArray of solution spinor fields
eig_argscontains info about deflation space
rhs_idxbookkeep current rhs
last_rhs_flagis this the last rhs to solve?
final_residualArray of true residuals
final_relative_residualArray of true Fermilab residuals
num_itersNumber of iterations taken

◆ qudaFinalize()

void qudaFinalize ( )

Destroy the QUDA context.

◆ qudaFreeCloverField()

void qudaFreeCloverField ( )

Free the clover field allocated in QUDA.

◆ qudaFreeGaugeField()

void qudaFreeGaugeField ( )

Free the gauge field allocated in QUDA.

◆ qudaFreePinned()

void qudaFreePinned ( void *  ptr)

Free pinned memory

Parameters
ptrPointer to memory to be free

◆ qudaGaugeFixingFFT()

void qudaGaugeFixingFFT ( int  precision,
unsigned int  gauge_dir,
int  Nsteps,
int  verbose_interval,
double  alpha,
unsigned int  autotune,
double  tolerance,
unsigned int  stopWtheta,
void *  milc_sitelink 
)

Gauge fixing with Steepest descent method with FFTs with support for single GPU only.

Parameters
[in]precision,1for single precision else for double precision
[in]gauge_dir,3for Coulomb gauge fixing, other for Landau gauge fixing
[in]Nsteps,maximumnumber of steps to perform gauge fixing
[in]verbose_interval,printgauge fixing info when iteration count is a multiple of this
[in]alpha,gaugefixing parameter of the method, most common value is 0.08
[in]autotune,1to autotune the method, i.e., if the Fg inverts its tendency we decrease the alpha value
[in]tolerance,torelancevalue to stop the method, if this value is zero then the method stops when iteration reachs the maximum number of steps defined by Nsteps
[in]stopWtheta,0for MILC criterium and 1 to use the theta value
[in,out]milc_sitelink,MILCgauge field to be fixed

◆ qudaGaugeFixingOVR()

void qudaGaugeFixingOVR ( const int  precision,
const unsigned int  gauge_dir,
const int  Nsteps,
const int  verbose_interval,
const double  relax_boost,
const double  tolerance,
const unsigned int  reunit_interval,
const unsigned int  stopWtheta,
void *  milc_sitelink 
)

Gauge fixing with overrelaxation with support for single and multi GPU.

Parameters
[in]precision,1for single precision else for double precision
[in]gauge_dir,3for Coulomb gauge fixing, other for Landau gauge fixing
[in]Nsteps,maximumnumber of steps to perform gauge fixing
[in]verbose_interval,printgauge fixing info when iteration count is a multiple of this
[in]relax_boost,gaugefixing parameter of the overrelaxation method, most common value is 1.5 or 1.7.
[in]tolerance,torelancevalue to stop the method, if this value is zero then the method stops when iteration reachs the maximum number of steps defined by Nsteps
[in]reunit_interval,reunitarizegauge field when iteration count is a multiple of this
[in]stopWtheta,0for MILC criterium and 1 to use the theta value
[in,out]milc_sitelink,MILCgauge field to be fixed

◆ qudaGaugeForce()

void qudaGaugeForce ( int  precision,
int  num_loop_types,
double  milc_loop_coeff[3],
double  eb3,
QudaMILCSiteArg_t arg 
)

Compute the gauge force and update the mometum field. All fields here are CPU fields in MILC order, and their precisions should match.

Parameters
precisionThe precision of the field (2 - double, 1 - single)
num_loop_types1, 2 or 3
milc_loop_coeffCoefficients of the different loops in the Symanzik action
eb3The integration step size (for MILC this is dt*beta/3)
argMetadata for MILC's internal site struct array

◆ qudaHisqForce()

void qudaHisqForce ( int  precision,
int  num_terms,
int  num_naik_terms,
double  dt,
double **  coeff,
void **  quark_field,
const double  level2_coeff[6],
const double  fat7_coeff[6],
const void *const  w_link,
const void *const  v_link,
const void *const  u_link,
void *const  milc_momentum 
)

Compute the fermion force for the HISQ quark action. All fields are host fields in MILC order, and the precision of these fields must match.

Parameters
precisionThe precision of the fields
num_termsThe number of quark fields
num_naik_termsThe number of naik contributions
dtIntegrating step size
coeffThe coefficients multiplying the fermion fields in the outer product
quark_fieldThe input fermion field.
level2_coeffThe coefficients for the second level of smearing in the quark action.
fat7_coeffThe coefficients for the first level of smearing (fat7) in the quark action.
w_linkUnitarized link variables obtained by applying fat7 smearing and unitarization to the original links.
v_linkFat7 link variables.
u_linkSU(3) think link variables.
milc_momentumThe momentum contribution from the quark action.

◆ qudaHisqParamsInit()

void qudaHisqParamsInit ( QudaHisqParams_t  hisq_params)

Set the algorithms to use for HISQ fermion calculations, e.g., SVD parameters for reunitarization.

Parameters
hisq_paramsMeta data desribing the algorithms to use for HISQ fermions

◆ qudaInit()

void qudaInit ( QudaInitArgs_t  input)

Initialize the QUDA context.

Parameters
inputMeta data for the QUDA context

◆ qudaInvert()

void qudaInvert ( int  external_precision,
int  quda_precision,
double  mass,
QudaInvertArgs_t  inv_args,
double  target_residual,
double  target_fermilab_residual,
const void *const  milc_fatlink,
const void *const  milc_longlink,
void *  source,
void *  solution,
double *const  final_resid,
double *const  final_rel_resid,
int *  num_iters 
)

Solve Ax=b for an improved staggered operator. All fields are fields passed and returned are host (CPU) field in MILC order. This function requires that persistent gauge and clover fields have been created prior. This interface is experimental.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
quda_precisionPrecision for QUDA to use (2 - double, 1 - single)
massFermion mass parameter
inv_argsStruct setting some solver metadata
target_residualTarget residual
target_relative_residualTarget Fermilab residual
milc_fatlinkFat-link field on the host
milc_longlinkLong-link field on the host
sourceRight-hand side source field
solutionSolution spinor field
final_residualTrue residual
final_relative_residualTrue Fermilab residual
num_itersNumber of iterations taken

◆ qudaInvertMsrc()

void qudaInvertMsrc ( int  external_precision,
int  quda_precision,
double  mass,
QudaInvertArgs_t  inv_args,
double  target_residual,
double  target_fermilab_residual,
const void *const  fatlink,
const void *const  longlink,
void **  sourceArray,
void **  solutionArray,
double *const  final_residual,
double *const  final_fermilab_residual,
int *  num_iters,
int  num_src 
)

Solve Ax=b for an improved staggered operator with many right hand sides. All fields are fields passed and returned are host (CPU) field in MILC order. This function requires that persistent gauge and clover fields have been created prior. This interface is experimental.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
quda_precisionPrecision for QUDA to use (2 - double, 1 - single)
massFermion mass parameter
inv_argsStruct setting some solver metadata
target_residualTarget residual
target_relative_residualTarget Fermilab residual
milc_fatlinkFat-link field on the host
milc_longlinkLong-link field on the host
sourcearray of right-hand side source fields
solutionarray of solution spinor fields
final_residualTrue residual
final_relative_residualTrue Fermilab residual
num_itersNumber of iterations taken
num_srcNumber of source fields

◆ qudaLoadCloverField()

void qudaLoadCloverField ( int  external_precision,
int  quda_precision,
QudaInvertArgs_t  inv_args,
void *  milc_clover,
void *  milc_clover_inv,
QudaSolutionType  solution_type,
QudaSolveType  solve_type,
double  clover_coeff,
int  compute_trlog,
double *  trlog 
)

Load the clover field and its inverse from the host. If null pointers are passed, the clover field and / or its inverse will be computed dynamically from the resident gauge field.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
quda_precisionPrecision for QUDA to use (2 - double, 1 - single)
inv_argsMeta data
milc_cloverPointer to host clover field. If 0 then the clover field is computed dynamically within QUDA.
milc_clover_invPointer to host inverse clover field. If 0 then the inverse if computed dynamically within QUDA.
solution_typeThe type of solution required (mat, matpc)
solve_typeThe solve type to use (normal/direct/preconditioning)
clover_coeffClover coefficient
compute_trlogWhether to compute the trlog of the clover field when inverting
Arrayfor storing the trlog (length two, one for each parity)

◆ qudaLoadGaugeField()

void qudaLoadGaugeField ( int  external_precision,
int  quda_precision,
QudaInvertArgs_t  inv_args,
const void *  milc_link 
)

Load the gauge field from the host.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
quda_precisionPrecision for QUDA to use (2 - double, 1 - single)
inv_argsMeta data
milc_linkBase pointer to host gauge field (regardless of dimensionality)

◆ qudaLoadKSLink()

void qudaLoadKSLink ( int  precision,
QudaFatLinkArgs_t  fatlink_args,
const double  act_path_coeff[6],
void *  inlink,
void *  fatlink,
void *  longlink 
)

Compute the fat and long links using the input gauge field. All fields passed here are host fields, that must be preallocated. The precision of all fields must match.

Parameters
precisionThe precision of the fields
fatlink_argsMeta data for the algorithms to deploy
act_path_coeffArray of coefficients for each path in the action
inlinkHost gauge field used for input
fatlinkHost fat-link field that is computed
longlinkHost long-link field that is computed

◆ qudaLoadUnitarizedLink()

void qudaLoadUnitarizedLink ( int  precision,
QudaFatLinkArgs_t  fatlink_args,
const double  path_coeff[6],
void *  inlink,
void *  fatlink,
void *  ulink 
)

Compute the fat links and unitzarize using the input gauge field. All fields passed here are host fields, that must be preallocated. The precision of all fields must match.

Parameters
precisionThe precision of the fields
fatlink_argsMeta data for the algorithms to deploy
path_coeffArray of coefficients for each path in the action
inlinkHost gauge field used for input
fatlinkHost fat-link field that is computed
ulinkHost unitarized field that is computed

◆ qudaMomAction()

double qudaMomAction ( int  precision,
void *  momentum 
)

Evaluate the momentum contribution to the Hybrid Monte Carlo action. The momentum field is assumed to be in MILC order. MILC convention is applied, subtracting 4.0 from each momentum matrix to increased stability.

Parameters
precisionPrecision of the field (2 - double, 1 - single)
momentumThe momentum field
Returns
momentum action

◆ qudaMultishiftInvert()

void qudaMultishiftInvert ( int  external_precision,
int  precision,
int  num_offsets,
double *const  offset,
QudaInvertArgs_t  inv_args,
const double *  target_residual,
const double *  target_fermilab_residual,
const void *const  milc_fatlink,
const void *const  milc_longlink,
void *  source,
void **  solutionArray,
double *const  final_residual,
double *const  final_fermilab_residual,
int *  num_iters 
)

Solve for multiple shifts (e.g., masses) using an improved staggered operator. All fields are fields passed and returned are host (CPU) field in MILC order. This function requires that persistent gauge and clover fields have been created prior. When a pure double-precision solver is requested no reliable updates are used, else reliable updates are used with a reliable_delta parameter of 0.1.

Parameters
external_precisionPrecision of host fields passed to QUDA (2 - double, 1 - single)
precisionPrecision for QUDA to use (2 - double, 1 - single)
num_offsetsNumber of shifts to solve for
offsetArray of shift offset values
inv_argsStruct setting some solver metadata
target_residualArray of target residuals per shift
target_relative_residualArray of target Fermilab residuals per shift
milc_fatlinkFat-link field on the host
milc_longlinkLong-link field on the host
sourceRight-hand side source field
solutionArrayArray of solution spinor fields
final_residualArray of true residuals
final_relative_residualArray of true Fermilab residuals
num_itersNumber of iterations taken

◆ qudaRephase()

void qudaRephase ( int  prec,
void *  gauge,
int  flag,
double  i_mu 
)

Apply the staggered phase factors to the gauge field. If the imaginary chemical potential is non-zero then the phase factor exp(imu/T) will be applied to the links in the temporal direction.

Parameters
precPrecision of the gauge field
gauge_hThe gauge field
flagWhether to apply to remove the staggered phase
i_muImaginary chemical potential

◆ qudaResidentExtendedGaugeField()

void* qudaResidentExtendedGaugeField ( void *  gauge,
int  geometry,
int  precision 
)

Take the QUDA resident gauge field and extend it. Return a pointer to the extended gauge field object.

Parameters
gaugeThe CPU gauge field (optional - if set to 0 then the gauge field zeroed)
geometryThe geometry of the matrix field to create (1 - scaler, 4 - vector, 6 - tensor)
precisionThe precision of the fields (2 - double, 1 - single)
Returns
Pointer to the gauge field (cast as a void*)

◆ qudaSaveGaugeField()

void qudaSaveGaugeField ( void *  gauge,
void *  inGauge 
)

Copy the QUDA gauge (matrix) field on the device to the CPU

Parameters
outGaugePointer to the host gauge field
inGaugePointer to the device gauge field (QUDA device field)

◆ qudaSetLayout()

void qudaSetLayout ( QudaLayout_t  layout)

Set set the local dimensions and machine topology for QUDA to use

Parameters
layoutStruct defining local dimensions and machine topology

◆ qudaSetMPICommHandle()

void qudaSetMPICommHandle ( void *  mycomm)

Optional: Set the MPI Comm Handle if it is not MPI_COMM_WORLD

Parameters
inputPointer to an MPI_Comm handle, static cast as a void *

◆ qudaUnitarizeSU3()

void qudaUnitarizeSU3 ( int  prec,
double  tol,
QudaMILCSiteArg_t arg 
)

Project the input field on the SU(3) group. If the target tolerance is not met, this routine will give a runtime error.

Parameters
precPrecision of the gauge field
tolThe tolerance to which we iterate
argMetadata for MILC's internal site struct array

◆ qudaUpdateU()

void qudaUpdateU ( int  precision,
double  eps,
QudaMILCSiteArg_t arg 
)

Evolve the gauge field by step size dt, using the momentum field I.e., Evalulate U(t+dt) = e(dt pi) U(t). All fields are CPU fields in MILC order.

Parameters
precisionPrecision of the field (2 - double, 1 - single)
dtThe integration step size step
argMetadata for MILC's internal site struct array