QUDA
v1.1.0
A library for QCD on GPUs
|
#include <gauge_field.h>
Public Types | |
using | param_type = GaugeFieldParam |
Public Member Functions | |
GaugeField (const GaugeFieldParam ¶m) | |
virtual | ~GaugeField () |
virtual void | exchangeGhost (QudaLinkDirection=QUDA_LINK_BACKWARDS)=0 |
virtual void | injectGhost (QudaLinkDirection=QUDA_LINK_BACKWARDS)=0 |
size_t | Length () const |
int | Ncolor () const |
QudaReconstructType | Reconstruct () const |
QudaGaugeFieldOrder | Order () const |
double | Anisotropy () const |
double | Tadpole () const |
QudaTboundary | TBoundary () const |
QudaLinkType | LinkType () const |
QudaGaugeFixed | GaugeFixed () const |
QudaGaugeFieldOrder | FieldOrder () const |
QudaFieldGeometry | Geometry () const |
QudaStaggeredPhase | StaggeredPhase () const |
bool | StaggeredPhaseApplied () const |
void | applyStaggeredPhase (QudaStaggeredPhase phase=QUDA_STAGGERED_PHASE_INVALID) |
void | removeStaggeredPhase () |
double | iMu () const |
const double & | LinkMax () const |
int | Nface () const |
virtual void | exchangeExtendedGhost (const int *R, bool no_comms_fill=false)=0 |
This routine will populate the border / halo region of a gauge field that has been created using copyExtendedGauge. More... | |
virtual void | exchangeExtendedGhost (const int *R, TimeProfile &profile, bool no_comms_fill=false)=0 |
This routine will populate the border / halo region of a gauge field that has been created using copyExtendedGauge. Overloaded variant that will start and stop a comms profile. More... | |
void | checkField (const LatticeField &) const |
bool | isNative () const |
size_t | Bytes () const |
size_t | PhaseBytes () const |
size_t | PhaseOffset () const |
size_t | TotalBytes () const |
virtual void * | Gauge_p () |
virtual void * | Even_p () |
virtual void * | Odd_p () |
virtual const void * | Gauge_p () const |
virtual const void * | Even_p () const |
virtual const void * | Odd_p () const |
virtual int | full_dim (int d) const |
const void ** | Ghost () const |
void ** | Ghost () |
size_t | SiteOffset () const |
size_t | SiteSize () const |
virtual void | zero ()=0 |
virtual void | copy (const GaugeField &src)=0 |
double | norm1 (int dim=-1, bool fixed=false) const |
Compute the L1 norm of the field. More... | |
double | norm2 (int dim=-1, bool fixed=false) const |
Compute the L2 norm squared of the field. More... | |
double | abs_max (int dim=-1, bool fixed=false) const |
Compute the absolute maximum of the field (Linfinity norm) More... | |
double | abs_min (int dim=-1, bool fixed=false) const |
Compute the absolute minimum of the field. More... | |
uint64_t | checksum (bool mini=false) const |
Public Member Functions inherited from quda::LatticeField | |
LatticeField (const LatticeFieldParam ¶m) | |
LatticeField (const LatticeField &field) | |
virtual | ~LatticeField () |
void | allocateGhostBuffer (size_t ghost_bytes) const |
Allocate the static ghost buffers. More... | |
void | createComms (bool no_comms_fill=false, bool bidir=true) |
void | destroyComms () |
void | createIPCComms () |
bool | ipcCopyComplete (int dir, int dim) |
bool | ipcRemoteCopyComplete (int dir, int dim) |
const cudaEvent_t & | getIPCCopyEvent (int dir, int dim) const |
const cudaEvent_t & | getIPCRemoteCopyEvent (int dir, int dim) const |
int | Ndim () const |
const int * | X () const |
size_t | Volume () const |
size_t | VolumeCB () const |
size_t | LocalVolume () const |
size_t | LocalVolumeCB () const |
const int * | SurfaceCB () const |
int | SurfaceCB (const int i) const |
size_t | Stride () const |
int | Pad () const |
const int * | R () const |
QudaGhostExchange | GhostExchange () const |
QudaPrecision | Precision () const |
QudaPrecision | GhostPrecision () const |
double | Scale () const |
void | Scale (double scale_) |
Set the scale factor for a fixed-point field. More... | |
virtual QudaSiteSubset | SiteSubset () const |
virtual QudaMemoryType | MemType () const |
int | Nvec () const |
QudaFieldLocation | Location () const |
size_t | GBytes () const |
void | checkField (const LatticeField &a) const |
virtual void | read (char *filename) |
virtual void | write (char *filename) |
void * | myFace_h (int dir, int dim) const |
Return pointer to the local pinned my_face buffer in a given direction and dimension. More... | |
void * | myFace_hd (int dir, int dim) const |
Return pointer to the local mapped my_face buffer in a given direction and dimension. More... | |
void * | myFace_d (int dir, int dim) const |
Return pointer to the device send buffer in a given direction and dimension. More... | |
void * | remoteFace_d (int dir, int dim) const |
Return base pointer to a remote device buffer for direct sending in a given direction and dimension. Since this is a base pointer, one still needs to take care of offsetting to the correct point for each direction/dimension. More... | |
void * | remoteFace_r () const |
Return base pointer to the ghost recv buffer. Since this is a base pointer, one still needs to take care of offsetting to the correct point for each direction/dimension. More... | |
virtual void | gather (int nFace, int dagger, int dir, qudaStream_t *stream_p=NULL) |
virtual void | commsStart (int nFace, int dir, int dagger=0, qudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true) |
virtual int | commsQuery (int nFace, int dir, int dagger=0, qudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true) |
virtual void | commsWait (int nFace, int dir, int dagger=0, qudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true) |
virtual void | scatter (int nFace, int dagger, int dir) |
const char * | VolString () const |
const char * | AuxString () const |
virtual void | backup () const |
Backs up the LatticeField. More... | |
virtual void | restore () const |
Restores the LatticeField. More... | |
virtual void | prefetch (QudaFieldLocation mem_space, qudaStream_t stream=0) const |
If managed memory and prefetch is enabled, prefetch all relevant memory fields to the current device or to the CPU. More... | |
virtual void | copy_to_buffer (void *buffer) const =0 |
Copy all contents of the field to a host buffer. More... | |
virtual void | copy_from_buffer (void *buffer)=0 |
Copy all contents of the field from a host buffer to this field. More... | |
Public Member Functions inherited from quda::Object | |
Object () | |
virtual | ~Object () |
Static Public Member Functions | |
static GaugeField * | Create (const GaugeFieldParam ¶m) |
Create the gauge field, with meta data specified in the parameter struct. More... | |
Static Public Member Functions inherited from quda::LatticeField | |
static void | freeGhostBuffer (void) |
Free statically allocated ghost buffers. More... | |
static void | destroyIPCComms () |
Static Public Member Functions inherited from quda::Object | |
static void * | operator new (std::size_t size) |
static void | operator delete (void *p) |
static void * | operator new[] (std::size_t size) |
static void | operator delete[] (void *p) |
Protected Member Functions | |
void | exchange (void **recv, void **send, QudaDirection dir) const |
Exchange the buffers across all dimensions in a given direction. More... | |
void | createGhostZone (const int *R, bool no_comms_fill, bool bidir=true) const |
void | setTuningString () |
Set the vol_string and aux_string for use in tuning. More... | |
Protected Member Functions inherited from quda::LatticeField | |
void | precisionCheck () |
Additional Inherited Members | |
Static Public Attributes inherited from quda::LatticeField | |
static int | bufferIndex = 0 |
static bool | ghost_field_reset = false |
Static Protected Attributes inherited from quda::LatticeField | |
static void * | ghost_send_buffer_d [2] = {nullptr, nullptr} |
static void * | ghost_recv_buffer_d [2] = {nullptr, nullptr} |
static void * | ghost_pinned_send_buffer_h [2] = {nullptr, nullptr} |
static void * | ghost_pinned_recv_buffer_h [2] = {nullptr, nullptr} |
static void * | ghost_pinned_send_buffer_hd [2] = {nullptr, nullptr} |
static void * | ghost_pinned_recv_buffer_hd [2] = {nullptr, nullptr} |
static void * | ghost_remote_send_buffer_d [2][QUDA_MAX_DIM][2] |
static size_t | ghostFaceBytes = 0 |
static bool | initGhostFaceBuffer = false |
static MsgHandle * | mh_send_p2p_fwd [2][QUDA_MAX_DIM] { } |
static MsgHandle * | mh_send_p2p_back [2][QUDA_MAX_DIM] { } |
static MsgHandle * | mh_recv_p2p_fwd [2][QUDA_MAX_DIM] { } |
static MsgHandle * | mh_recv_p2p_back [2][QUDA_MAX_DIM] { } |
static int | buffer_send_p2p_fwd [2][QUDA_MAX_DIM] { } |
static int | buffer_recv_p2p_fwd [2][QUDA_MAX_DIM] { } |
static int | buffer_send_p2p_back [2][QUDA_MAX_DIM] { } |
static int | buffer_recv_p2p_back [2][QUDA_MAX_DIM] { } |
static cudaEvent_t | ipcCopyEvent [2][2][QUDA_MAX_DIM] |
static cudaEvent_t | ipcRemoteCopyEvent [2][2][QUDA_MAX_DIM] |
static bool | initIPCComms = false |
Definition at line 200 of file gauge_field.h.
Define the parameter type for this field.
Definition at line 301 of file gauge_field.h.
quda::GaugeField::GaugeField | ( | const GaugeFieldParam & | param | ) |
Definition at line 30 of file gauge_field.cpp.
|
virtual |
Definition at line 105 of file gauge_field.cpp.
double quda::GaugeField::abs_max | ( | int | dim = -1 , |
bool | fixed = false |
||
) | const |
Compute the absolute maximum of the field (Linfinity norm)
[in] | dim | Which dimension we are taking the norm of (dim=-1 mean all dimensions) |
double quda::GaugeField::abs_min | ( | int | dim = -1 , |
bool | fixed = false |
||
) | const |
Compute the absolute minimum of the field.
[in] | dim | Which dimension we are taking the norm of (dim=-1 mean all dimensions) |
|
inline |
Definition at line 288 of file gauge_field.h.
void quda::GaugeField::applyStaggeredPhase | ( | QudaStaggeredPhase | phase = QUDA_STAGGERED_PHASE_INVALID | ) |
Apply the staggered phase factors to the gauge field.
[in] | phase | The phase we will apply to the field. If this is QUDA_STAGGERED_PHASE_INVALID, the default value, then apply the phase set internal to the field. |
Definition at line 149 of file gauge_field.cpp.
|
inline |
Definition at line 352 of file gauge_field.h.
void quda::GaugeField::checkField | ( | const LatticeField & | l | ) | const |
Definition at line 257 of file gauge_field.cpp.
uint64_t quda::GaugeField::checksum | ( | bool | mini = false | ) | const |
Compute checksum of this gauge field: this uses a XOR-based checksum method
[in] | mini | Whether to compute a mini checksum or global checksum. A mini checksum only computes the checksum over a subset of the lattice sites and is to be used for online comparisons, e.g., checking a field has changed with a global update algorithm. |
Definition at line 345 of file gauge_field.cpp.
|
pure virtual |
Generic gauge field copy
[in] | src | Source from which we are copying |
Implemented in quda::cpuGaugeField, and quda::cudaGaugeField.
|
static |
Create the gauge field, with meta data specified in the parameter struct.
param | Parameter struct specifying the gauge field |
Definition at line 349 of file gauge_field.cpp.
|
protected |
Compute the required extended ghost zone sizes and offsets
[in] | R | Radius of the ghost zone |
[in] | no_comms_fill | If true we create a full halo regardless of partitioning |
[in] | bidir | Is this a bi-directional exchange - if not then we alias the fowards and backwards offsetss |
Definition at line 120 of file gauge_field.cpp.
|
inlinevirtual |
Reimplemented in quda::cudaGaugeField.
Definition at line 359 of file gauge_field.h.
|
inlinevirtual |
Reimplemented in quda::cudaGaugeField.
Definition at line 363 of file gauge_field.h.
|
protected |
Exchange the buffers across all dimensions in a given direction.
[out] | recv | Receive buffer |
[in] | send | Send buffer |
[in] | dir | Direction in which we are sending (forwards OR backwards only) |
Definition at line 177 of file gauge_field.cpp.
|
pure virtual |
This routine will populate the border / halo region of a gauge field that has been created using copyExtendedGauge.
R | The thickness of the extended region in each dimension |
no_comms_fill | Do local exchange to fill out the extended region in non-partitioned dimensions |
Implemented in quda::cpuGaugeField, and quda::cudaGaugeField.
|
pure virtual |
This routine will populate the border / halo region of a gauge field that has been created using copyExtendedGauge. Overloaded variant that will start and stop a comms profile.
R | The thickness of the extended region in each dimension |
profile | TimeProfile intance which will record the time taken |
no_comms_fill | Do local exchange to fill out the extended region in non-partitioned dimensions |
Implemented in quda::cpuGaugeField, and quda::cudaGaugeField.
|
pure virtual |
Implemented in quda::cpuGaugeField, and quda::cudaGaugeField.
|
inline |
Definition at line 293 of file gauge_field.h.
|
inlinevirtual |
Implements quda::LatticeField.
Definition at line 366 of file gauge_field.h.
|
inlinevirtual |
Reimplemented in quda::cpuGaugeField, and quda::cudaGaugeField.
Definition at line 358 of file gauge_field.h.
|
inlinevirtual |
Reimplemented in quda::cpuGaugeField, and quda::cudaGaugeField.
Definition at line 362 of file gauge_field.h.
|
inline |
Definition at line 292 of file gauge_field.h.
|
inline |
Definition at line 294 of file gauge_field.h.
|
inline |
Definition at line 373 of file gauge_field.h.
|
inline |
Definition at line 368 of file gauge_field.h.
|
inline |
Return the imaginary chemical potential applied to this field
Definition at line 319 of file gauge_field.h.
|
pure virtual |
Implemented in quda::cpuGaugeField, and quda::cudaGaugeField.
|
inlinevirtual |
This function returns true if the field is stored in an internal field order for the given precision.
Implements quda::LatticeField.
Definition at line 350 of file gauge_field.h.
|
inline |
Definition at line 284 of file gauge_field.h.
|
inline |
Definition at line 321 of file gauge_field.h.
|
inline |
Definition at line 291 of file gauge_field.h.
|
inline |
Definition at line 285 of file gauge_field.h.
|
inline |
Definition at line 322 of file gauge_field.h.
double quda::GaugeField::norm1 | ( | int | dim = -1 , |
bool | fixed = false |
||
) | const |
Compute the L1 norm of the field.
[in] | dim | Which dimension we are taking the norm of (dim=-1 mean all dimensions) |
double quda::GaugeField::norm2 | ( | int | dim = -1 , |
bool | fixed = false |
||
) | const |
Compute the L2 norm squared of the field.
[in] | dim | Which dimension we are taking the norm of (dim=-1 mean all dimensions) |
|
inlinevirtual |
Reimplemented in quda::cudaGaugeField.
Definition at line 360 of file gauge_field.h.
|
inlinevirtual |
Reimplemented in quda::cudaGaugeField.
Definition at line 364 of file gauge_field.h.
|
inline |
Definition at line 287 of file gauge_field.h.
|
inline |
Definition at line 353 of file gauge_field.h.
|
inline |
Definition at line 354 of file gauge_field.h.
|
inline |
Definition at line 286 of file gauge_field.h.
void quda::GaugeField::removeStaggeredPhase | ( | ) |
Remove the staggered phase factors from the gauge field.
Definition at line 164 of file gauge_field.cpp.
|
protectedvirtual |
Set the vol_string and aux_string for use in tuning.
Reimplemented from quda::LatticeField.
Definition at line 109 of file gauge_field.cpp.
|
inline |
Definition at line 382 of file gauge_field.h.
|
inline |
Definition at line 388 of file gauge_field.h.
|
inline |
Definition at line 295 of file gauge_field.h.
|
inline |
Definition at line 296 of file gauge_field.h.
|
inline |
Definition at line 289 of file gauge_field.h.
|
inline |
Definition at line 290 of file gauge_field.h.
|
inline |
Definition at line 356 of file gauge_field.h.
|
pure virtual |
Set all field elements to zero (virtual)
Implemented in quda::cpuGaugeField, and quda::cudaGaugeField.
|
protected |
Definition at line 219 of file gauge_field.h.
|
protected |
Definition at line 203 of file gauge_field.h.
|
protected |
Definition at line 223 of file gauge_field.h.
|
protected |
Definition at line 221 of file gauge_field.h.
|
protected |
Definition at line 215 of file gauge_field.h.
|
protected |
Definition at line 210 of file gauge_field.h.
|
mutableprotected |
Definition at line 225 of file gauge_field.h.
|
mutableprotected |
Definition at line 227 of file gauge_field.h.
|
protected |
Imaginary chemical potential
Definition at line 250 of file gauge_field.h.
|
protected |
Definition at line 206 of file gauge_field.h.
|
protected |
Definition at line 216 of file gauge_field.h.
|
protected |
Definition at line 208 of file gauge_field.h.
|
protected |
Definition at line 209 of file gauge_field.h.
|
protected |
Definition at line 213 of file gauge_field.h.
|
protected |
Definition at line 214 of file gauge_field.h.
|
protected |
Definition at line 205 of file gauge_field.h.
|
protected |
Definition at line 204 of file gauge_field.h.
|
protected |
Definition at line 207 of file gauge_field.h.
|
protected |
Definition at line 212 of file gauge_field.h.
|
protected |
Offset into MILC site struct to the desired matrix field (only if gauge_order=MILC_SITE_GAUGE_ORDER)
Definition at line 255 of file gauge_field.h.
|
protected |
Size of MILC site struct (only if gauge_order=MILC_SITE_GAUGE_ORDER)
Definition at line 260 of file gauge_field.h.
|
protected |
Whether the staggered phase factor has been applied
Definition at line 237 of file gauge_field.h.
|
protected |
The staggered phase convention to use
Definition at line 232 of file gauge_field.h.
|
protected |
Definition at line 217 of file gauge_field.h.
|
protected |
Definition at line 220 of file gauge_field.h.