QUDA  v0.5.0
A library for QCD on GPUs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Typedefs | Functions
quda.h File Reference

Main header file for the QUDA library. More...

#include <enum_quda.h>
#include <stdio.h>
#include <quda_fortran.h>

Go to the source code of this file.

Classes

struct  QudaGaugeParam_s
 
struct  QudaInvertParam_s
 

Macros

#define QUDA_VERSION_MAJOR   0
 
#define QUDA_VERSION_MINOR   5
 
#define QUDA_VERSION_SUBMINOR   0
 
#define QUDA_VERSION   ((QUDA_VERSION_MAJOR<<16) | (QUDA_VERSION_MINOR<<8) | QUDA_VERSION_SUBMINOR)
 This macro is deprecated. Use QUDA_VERSION_MAJOR, etc., instead.
 
#define QUDA_MAX_DIM   5
 Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5.
 
#define QUDA_MAX_MULTI_SHIFT   32
 Maximum number of shifts supported by the multi-shift solver. This number may be changed if need be.
 

Typedefs

typedef struct QudaGaugeParam_s QudaGaugeParam
 
typedef struct QudaInvertParam_s QudaInvertParam
 
typedef int(* QudaCommsMap )(const int *coords, void *fdata)
 

Functions

void setVerbosityQuda (QudaVerbosity verbosity, const char prefix[], FILE *outfile)
 
void initCommsGridQuda (int nDim, const int *dims, QudaCommsMap func, void *fdata)
 
void initQuda (int device)
 
void endQuda (void)
 
QudaGaugeParam newQudaGaugeParam (void)
 
QudaInvertParam newQudaInvertParam (void)
 
void printQudaGaugeParam (QudaGaugeParam *param)
 
void printQudaInvertParam (QudaInvertParam *param)
 
void loadGaugeQuda (void *h_gauge, QudaGaugeParam *param)
 
void freeGaugeQuda (void)
 
void saveGaugeQuda (void *h_gauge, QudaGaugeParam *param)
 
void loadCloverQuda (void *h_clover, void *h_clovinv, QudaInvertParam *inv_param)
 
void freeCloverQuda (void)
 
void invertQuda (void *h_x, void *h_b, QudaInvertParam *param)
 
void invertMultiShiftQuda (void **_hp_x, void *_hp_b, QudaInvertParam *param)
 
void dslashQuda (void *h_out, void *h_in, QudaInvertParam *inv_param, QudaParity parity)
 
void cloverQuda (void *h_out, void *h_in, QudaInvertParam *inv_param, QudaParity *parity, int inverse)
 
void MatQuda (void *h_out, void *h_in, QudaInvertParam *inv_param)
 
void MatDagMatQuda (void *h_out, void *h_in, QudaInvertParam *inv_param)
 
void set_dim (int *)
 
void pack_ghost (void **cpuLink, void **cpuGhost, int nFace, QudaPrecision precision)
 
void setFatLinkPadding (QudaComputeFatMethod method, QudaGaugeParam *param)
 
int computeFatLinkQuda (void *fatlink, void **sitelink, double *act_path_coeff, QudaGaugeParam *param, QudaComputeFatMethod method)
 
int computeGaugeForceQuda (void *mom, void *sitelink, int ***input_path_buf, int *path_length, void *loop_coeff, int num_paths, int max_length, double eb3, QudaGaugeParam *qudaGaugeParam, double *timeinfo)
 

Detailed Description

Main header file for the QUDA library.

Note to QUDA developers: When adding new members to QudaGaugeParam and QudaInvertParam, be sure to update lib/check_params.h

Definition in file quda.h.

Macro Definition Documentation

#define QUDA_MAX_DIM   5

Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5.

Definition at line 31 of file quda.h.

#define QUDA_MAX_MULTI_SHIFT   32

Maximum number of shifts supported by the multi-shift solver. This number may be changed if need be.

Definition at line 38 of file quda.h.

#define QUDA_VERSION   ((QUDA_VERSION_MAJOR<<16) | (QUDA_VERSION_MINOR<<8) | QUDA_VERSION_SUBMINOR)

This macro is deprecated. Use QUDA_VERSION_MAJOR, etc., instead.

Definition at line 23 of file quda.h.

#define QUDA_VERSION_MAJOR   0

Definition at line 15 of file quda.h.

#define QUDA_VERSION_MINOR   5

Definition at line 16 of file quda.h.

#define QUDA_VERSION_SUBMINOR   0

Definition at line 17 of file quda.h.

Typedef Documentation

typedef int(* QudaCommsMap)(const int *coords, void *fdata)

initCommsGridQuda() takes an optional "rank_from_coords" argument that should be a pointer to a user-defined function with this prototype.

Parameters
coordsNode coordinates
fdataAny auxiliary data needed by the function
Returns
MPI rank or QMP node ID cooresponding to the node coordinates
See Also
initCommsGridQuda

Definition at line 262 of file quda.h.

Parameters having to do with the gauge field or the interpretation of the gauge field by various Dirac operators

Parameters relating to the solver and the choice of Dirac operator.

Function Documentation

void cloverQuda ( void *  h_out,
void *  h_in,
QudaInvertParam inv_param,
QudaParity parity,
int  inverse 
)

Apply the clover operator or its inverse.

Parameters
h_outResult spinor field
h_inInput spinor field
paramContains all metadata regarding host and device storage
parityThe source and destination parity of the field
inverseWhether to apply the inverse of the clover term
int computeFatLinkQuda ( void *  fatlink,
void **  sitelink,
double *  act_path_coeff,
QudaGaugeParam param,
QudaComputeFatMethod  method 
)
int computeGaugeForceQuda ( void *  mom,
void *  sitelink,
int ***  input_path_buf,
int *  path_length,
void *  loop_coeff,
int  num_paths,
int  max_length,
double  eb3,
QudaGaugeParam qudaGaugeParam,
double *  timeinfo 
)

Compute the gauge force.

void dslashQuda ( void *  h_out,
void *  h_in,
QudaInvertParam inv_param,
QudaParity  parity 
)

Apply the Dslash operator (D_{eo} or D_{oe}).

Parameters
h_outResult spinor field
h_inInput spinor field
paramContains all metadata regarding host and device storage
parityThe destination parity of the field

Definition at line 819 of file interface_quda.cpp.

void endQuda ( void  )

Finalize the library.

Definition at line 552 of file interface_quda.cpp.

void freeCloverQuda ( void  )

Free QUDA's internal copy of the clover term and/or clover inverse.

Definition at line 539 of file interface_quda.cpp.

void freeGaugeQuda ( void  )

Free QUDA's internal copy of the gauge field.

Definition at line 510 of file interface_quda.cpp.

void initCommsGridQuda ( int  nDim,
const int *  dims,
QudaCommsMap  func,
void *  fdata 
)

Declare the grid mapping ("logical topology" in QMP parlance) used for communications in a multi-GPU grid. This function should be called prior to initQuda(). The only case in which it's optional is when QMP is used for communication and the logical topology has already been declared by the application.

Parameters
nDimNumber of grid dimensions. "4" is the only supported value currently.
dimsArray of grid dimensions. dims[0]*dims[1]*dims[2]*dims[3] must equal the total number of MPI ranks or QMP nodes.
funcPointer to a user-supplied function that maps coordinates in the communication grid to MPI ranks (or QMP node IDs). If the pointer is NULL, the default mapping depends on whether QMP or MPI is being used for communication. With QMP, the existing logical topology is used if it's been declared. With MPI or as a fallback with QMP, the default ordering is lexicographical with the fourth ("t") index varying fastest.
fdataPointer to any data required by "func" (may be NULL)
See Also
QudaCommsMap

Definition at line 151 of file interface_quda.cpp.

void initQuda ( int  device)

Initialize the library.

Parameters
deviceCUDA device number to use. In a multi-GPU build, this parameter may either be set explicitly on a per-process basis or set to -1 to enable a default allocation of devices to processes.

Definition at line 194 of file interface_quda.cpp.

void invertMultiShiftQuda ( void **  _hp_x,
void *  _hp_b,
QudaInvertParam param 
)

Solve for multiple shifts (e.g., masses).

Parameters
_hp_xArray of solution spinor fields
_hp_bArray of source spinor fields
paramContains all metadata regarding host and device storage and solver parameters

Generic version of the multi-shift solver. Should work for most fermions. Note that offset[0] is not folded into the mass parameter.

At present, the solution_type must be MATDAG_MAT or MATPCDAG_MATPC, and solve_type must be NORMOP or NORMOP_PC. The solution and solve preconditioning have to match.

Definition at line 1327 of file interface_quda.cpp.

void invertQuda ( void *  h_x,
void *  h_b,
QudaInvertParam param 
)

Perform the solve, according to the parameters set in param. It is assumed that the gauge field has already been loaded via loadGaugeQuda().

Parameters
h_xSolution spinor field
h_bSource spinor field
paramContains all metadata regarding host and device storage and solver parameters

Definition at line 1119 of file interface_quda.cpp.

void loadCloverQuda ( void *  h_clover,
void *  h_clovinv,
QudaInvertParam inv_param 
)

Load the clover term and/or the clover inverse from the host. Either h_clover or h_clovinv may be set to NULL.

Parameters
h_cloverBase pointer to host clover field
h_cloverinvBase pointer to host clover inverse field
inv_paramContains all metadata regarding host and device storage

Definition at line 420 of file interface_quda.cpp.

void loadGaugeQuda ( void *  h_gauge,
QudaGaugeParam param 
)

Load the gauge field from the host.

Parameters
h_gaugeBase pointer to host gauge field (regardless of dimensionality)
paramContains all metadata regarding host and device storage

Definition at line 293 of file interface_quda.cpp.

void MatDagMatQuda ( void *  h_out,
void *  h_in,
QudaInvertParam inv_param 
)

Apply M^{}M, possibly even/odd preconditioned.

Parameters
h_outResult spinor field
h_inInput spinor field
paramContains all metadata regarding host and device storage

Definition at line 953 of file interface_quda.cpp.

void MatQuda ( void *  h_out,
void *  h_in,
QudaInvertParam inv_param 
)

Apply the full Dslash matrix, possibly even/odd preconditioned.

Parameters
h_outResult spinor field
h_inInput spinor field
paramContains all metadata regarding host and device storage

Definition at line 884 of file interface_quda.cpp.

QudaGaugeParam newQudaGaugeParam ( void  )

A new QudaGaugeParam should always be initialized immediately after it's defined (and prior to explicitly setting its members) using this function. Typical usage is as follows:

QudaGaugeParam gauge_param = newQudaGaugeParam();

QudaInvertParam newQudaInvertParam ( void  )

A new QudaInvertParam should always be initialized immediately after it's defined (and prior to explicitly setting its members) using this function. Typical usage is as follows:

QudaInvertParam invert_param = newQudaInvertParam();

void pack_ghost ( void **  cpuLink,
void **  cpuGhost,
int  nFace,
QudaPrecision  precision 
)
void printQudaGaugeParam ( QudaGaugeParam param)

Print the members of QudaGaugeParam.

Parameters
paramThe QudaGaugeParam whose elements we are to print.

Definition at line 40 of file check_params.h.

void printQudaInvertParam ( QudaInvertParam param)

Print the members of QudaGaugeParam.

Parameters
paramThe QudaGaugeParam whose elements we are to print.

< Number of offsets in the multi-shift solver

Definition at line 106 of file check_params.h.

void saveGaugeQuda ( void *  h_gauge,
QudaGaugeParam param 
)

Save the gauge field to the host.

Parameters
h_gaugeBase pointer to host gauge field (regardless of dimensionality)
paramContains all metadata regarding host and device storage

Definition at line 387 of file interface_quda.cpp.

void set_dim ( int *  )
void setFatLinkPadding ( QudaComputeFatMethod  method,
QudaGaugeParam param 
)
void setVerbosityQuda ( QudaVerbosity  verbosity,
const char  prefix[],
FILE *  outfile 
)

Set parameters related to status reporting.

In typical usage, this function will be called once (or not at all) just before the call to initQuda(), but it's valid to call it any number of times at any point during execution. Prior to the first time it's called, the parameters take default values as indicated below.

Parameters
verbosityDefault verbosity, ranging from QUDA_SILENT to QUDA_DEBUG_VERBOSE. Within a solver, this parameter is overridden by the "verbosity" member of QudaInvertParam. The default value is QUDA_SUMMARIZE.
prefixString to prepend to all messages from QUDA. This defaults to the empty string (""), but you may wish to specify something like "QUDA: " to distinguish QUDA's output from that of your application.
outfileFile pointer (such as stdout, stderr, or a handle returned by fopen()) where messages should be printed. The default is stdout.

Definition at line 111 of file interface_quda.cpp.