|
QUDA
v0.5.0
A library for QCD on GPUs
|
#include <iostream>#include <stdio.h>#include <stdlib.h>#include <math.h>#include <string.h>#include <sys/time.h>#include <quda.h>#include <quda_internal.h>#include <comm_quda.h>#include <tune_quda.h>#include <blas_quda.h>#include <gauge_field.h>#include <dirac_quda.h>#include <dslash_quda.h>#include <invert_quda.h>#include <color_spinor_field.h>#include <clover_field.h>#include <llfat_quda.h>#include <fat_force_quda.h>#include <hisq_links_quda.h>#include <cuda.h>#include "check_params.h"#include "face_quda.h"Go to the source code of this file.
Classes | |
| struct | LexMapData |
Namespaces | |
| namespace | quda |
Macros | |
| #define | MAX(a, b) ((a)>(b)? (a):(b)) |
| #define | TDIFF(a, b) (b.tv_sec - a.tv_sec + 0.000001*(b.tv_usec - a.tv_usec)) |
| #define | spinorSiteSize 24 |
| #define | MAX_GPU_NUM_PER_NODE 16 |
| #define | INIT_PARAM |
| #define | CHECK_PARAM |
| #define | PRINT_PARAM |
Variables | |
| int | numa_affinity_enabled = 1 |
| cudaGaugeField * | gaugePrecise = NULL |
| cudaGaugeField * | gaugeSloppy = NULL |
| cudaGaugeField * | gaugePrecondition = NULL |
| cudaGaugeField *& | gaugeFatPrecise = gaugePrecise |
| cudaGaugeField *& | gaugeFatSloppy = gaugeSloppy |
| cudaGaugeField *& | gaugeFatPrecondition = gaugePrecondition |
| cudaGaugeField * | gaugeLongPrecise = NULL |
| cudaGaugeField * | gaugeLongSloppy = NULL |
| cudaGaugeField * | gaugeLongPrecondition = NULL |
| cudaCloverField * | cloverPrecise = NULL |
| cudaCloverField * | cloverSloppy = NULL |
| cudaCloverField * | cloverPrecondition = NULL |
| cudaDeviceProp | deviceProp |
| cudaStream_t * | streams |
| #define CHECK_PARAM |
Definition at line 51 of file interface_quda.cpp.
| #define INIT_PARAM |
Definition at line 46 of file interface_quda.cpp.
| #define MAX | ( | a, | |
| b | |||
| ) | ((a)>(b)? (a):(b)) |
Definition at line 38 of file interface_quda.cpp.
| #define MAX_GPU_NUM_PER_NODE 16 |
Definition at line 43 of file interface_quda.cpp.
| #define PRINT_PARAM |
Definition at line 56 of file interface_quda.cpp.
| #define spinorSiteSize 24 |
Definition at line 41 of file interface_quda.cpp.
| #define TDIFF | ( | a, | |
| b | |||
| ) | (b.tv_sec - a.tv_sec + 0.000001*(b.tv_usec - a.tv_usec)) |
Definition at line 39 of file interface_quda.cpp.
| quda::cudaGaugeField* checkGauge | ( | QudaInvertParam * | param | ) |
Definition at line 1027 of file interface_quda.cpp.
| void clover_quda_ | ( | void * | h_out, |
| void * | h_in, | ||
| QudaInvertParam * | inv_param, | ||
| QudaParity * | parity, | ||
| int * | inverse | ||
| ) |
Apply the clover operator or its inverse.
| h_out | Result spinor field |
| h_in | Input spinor field |
| param | Contains all metadata regarding host and device storage |
| parity | The source and destination parity of the field |
| inverse | Whether to apply the inverse of the clover term |
Definition at line 1976 of file interface_quda.cpp.
| void cloverQuda | ( | void * | h_out, |
| void * | h_in, | ||
| QudaInvertParam * | inv_param, | ||
| QudaParity | parity, | ||
| int | inverse | ||
| ) |
Definition at line 1048 of file interface_quda.cpp.
| void comm_set_gridsize_ | ( | int * | grid | ) |
Setter method for the comm grid size to all us to reuse BQCD's MPI topology. This is considered a temporary hack that will be fixed when an interface for setting the logical topology is created (issue 31 on github).
Definition at line 2006 of file interface_quda.cpp.
| void dslash_quda_ | ( | void * | h_out, |
| void * | h_in, | ||
| QudaInvertParam * | inv_param, | ||
| QudaParity * | parity | ||
| ) |
Apply the Dslash operator (D_{eo} or D_{oe}).
| h_out | Result spinor field |
| h_in | Input spinor field |
| param | Contains all metadata regarding host and device storage |
| parity | The destination parity of the field |
Definition at line 1974 of file interface_quda.cpp.
| void dslashQuda | ( | void * | h_out, |
| void * | h_in, | ||
| QudaInvertParam * | inv_param, | ||
| QudaParity | parity | ||
| ) |
Apply the Dslash operator (D_{eo} or D_{oe}).
| h_out | Result spinor field |
| h_in | Input spinor field |
| param | Contains all metadata regarding host and device storage |
| parity | The destination parity of the field |
Definition at line 819 of file interface_quda.cpp.
| void end_quda_ | ( | void | ) |
Finalize the library.
Definition at line 1968 of file interface_quda.cpp.
| void endQuda | ( | void | ) |
Finalize the library.
Definition at line 552 of file interface_quda.cpp.
| void free_clover_quda_ | ( | void | ) |
Free QUDA's internal copy of the clover term and/or clover inverse.
Definition at line 1973 of file interface_quda.cpp.
| void free_gauge_quda_ | ( | void | ) |
Free QUDA's internal copy of the gauge field.
Definition at line 1970 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 init_quda_ | ( | int * | device | ) |
Initialize the library.
| device | CUDA device number to use. In a multi-GPU build, this parameter may be either set explicitly on a per-process basis or set to -1 to enable a default allocation of devices to processes. |
Definition at line 1967 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.
| nDim | Number of grid dimensions. "4" is the only supported value currently. |
| dims | Array of grid dimensions. dims[0]*dims[1]*dims[2]*dims[3] must equal the total number of MPI ranks or QMP nodes. |
| func | Pointer 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. |
| fdata | Pointer to any data required by "func" (may be NULL) |
Definition at line 151 of file interface_quda.cpp.
| void initQuda | ( | int | device | ) |
Initialize the library.
| device | CUDA 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 invert_quda_ | ( | 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().
| h_x | Solution spinor field |
| h_b | Source spinor field |
| param | Contains all metadata regarding host and device storage and solver parameters |
Definition at line 1982 of file interface_quda.cpp.
| void invertMultiShiftQuda | ( | void ** | _hp_x, |
| void * | _hp_b, | ||
| QudaInvertParam * | param | ||
| ) |
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().
| h_x | Solution spinor field |
| h_b | Source spinor field |
| param | Contains all metadata regarding host and device storage and solver parameters |
Definition at line 1119 of file interface_quda.cpp.
| void load_clover_quda_ | ( | 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.
| h_clover | Base pointer to host clover field |
| h_cloverinv | Base pointer to host clover inverse field |
| inv_param | Contains all metadata regarding host and device storage |
Definition at line 1971 of file interface_quda.cpp.
| void load_gauge_quda_ | ( | void * | h_gauge, |
| QudaGaugeParam * | param | ||
| ) |
Load the gauge field from the host.
| h_gauge | Base pointer to host gauge field (regardless of dimensionality) |
| param | Contains all metadata regarding host and device storage |
Definition at line 1969 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.
| h_clover | Base pointer to host clover field |
| h_cloverinv | Base pointer to host clover inverse field |
| inv_param | Contains 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.
| h_gauge | Base pointer to host gauge field (regardless of dimensionality) |
| param | Contains all metadata regarding host and device storage |
Definition at line 293 of file interface_quda.cpp.
| void mat_dag_mat_quda_ | ( | void * | h_out, |
| void * | h_in, | ||
| QudaInvertParam * | inv_param | ||
| ) |
Apply M^{}M, possibly even/odd preconditioned.
| h_out | Result spinor field |
| h_in | Input spinor field |
| param | Contains all metadata regarding host and device storage |
Definition at line 1980 of file interface_quda.cpp.
| void mat_quda_ | ( | void * | h_out, |
| void * | h_in, | ||
| QudaInvertParam * | inv_param | ||
| ) |
Apply the full Dslash matrix, possibly even/odd preconditioned.
| h_out | Result spinor field |
| h_in | Input spinor field |
| param | Contains all metadata regarding host and device storage |
Definition at line 1978 of file interface_quda.cpp.
| void MatDagMatQuda | ( | void * | h_out, |
| void * | h_in, | ||
| QudaInvertParam * | inv_param | ||
| ) |
Apply M^{}M, possibly even/odd preconditioned.
| h_out | Result spinor field |
| h_in | Input spinor field |
| param | Contains 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.
| h_out | Result spinor field |
| h_in | Input spinor field |
| param | Contains all metadata regarding host and device storage |
Definition at line 884 of file interface_quda.cpp.
| void new_quda_gauge_param_ | ( | QudaGaugeParam * | param | ) |
Initializes the QudaGaugeParam with default entries.
| The | QudaGaugeParam to be initialized |
Definition at line 1984 of file interface_quda.cpp.
| void new_quda_invert_param_ | ( | QudaInvertParam * | param | ) |
Initializes the QudaInvertParam with default entries.
| The | QudaInvertParam to be initialized |
Definition at line 1987 of file interface_quda.cpp.
| void saveGaugeQuda | ( | void * | h_gauge, |
| QudaGaugeParam * | param | ||
| ) |
Save the gauge field to the host.
| h_gauge | Base pointer to host gauge field (regardless of dimensionality) |
| param | Contains all metadata regarding host and device storage |
Definition at line 387 of file interface_quda.cpp.
| 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.
| verbosity | Default 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. |
| prefix | String 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. |
| outfile | File 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.
| cudaCloverField* cloverPrecise = NULL |
Definition at line 79 of file interface_quda.cpp.
| cudaCloverField* cloverPrecondition = NULL |
Definition at line 81 of file interface_quda.cpp.
| cudaCloverField* cloverSloppy = NULL |
Definition at line 80 of file interface_quda.cpp.
| cudaDeviceProp deviceProp |
Definition at line 84 of file interface_quda.cpp.
| cudaGaugeField*& gaugeFatPrecise = gaugePrecise |
Definition at line 71 of file interface_quda.cpp.
| cudaGaugeField*& gaugeFatPrecondition = gaugePrecondition |
Definition at line 73 of file interface_quda.cpp.
| cudaGaugeField*& gaugeFatSloppy = gaugeSloppy |
Definition at line 72 of file interface_quda.cpp.
| cudaGaugeField* gaugeLongPrecise = NULL |
Definition at line 75 of file interface_quda.cpp.
| cudaGaugeField* gaugeLongPrecondition = NULL |
Definition at line 77 of file interface_quda.cpp.
| cudaGaugeField* gaugeLongSloppy = NULL |
Definition at line 76 of file interface_quda.cpp.
| cudaGaugeField* gaugePrecise = NULL |
Definition at line 66 of file interface_quda.cpp.
| cudaGaugeField* gaugePrecondition = NULL |
Definition at line 68 of file interface_quda.cpp.
| cudaGaugeField* gaugeSloppy = NULL |
Definition at line 67 of file interface_quda.cpp.
| int numa_affinity_enabled = 1 |
Definition at line 62 of file interface_quda.cpp.
| cudaStream_t* streams |
Definition at line 85 of file interface_quda.cpp.
1.8.2