QUDA  v1.1.0
A library for QCD on GPUs
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
quda::cpuColorSpinorField Class Reference

#include <color_spinor_field.h>

+ Inheritance diagram for quda::cpuColorSpinorField:

Public Member Functions

 cpuColorSpinorField (const cpuColorSpinorField &)
 
 cpuColorSpinorField (const ColorSpinorField &)
 
 cpuColorSpinorField (const ColorSpinorField &, const ColorSpinorParam &)
 
 cpuColorSpinorField (const ColorSpinorParam &)
 
virtual ~cpuColorSpinorField ()
 
ColorSpinorFieldoperator= (const ColorSpinorField &)
 
cpuColorSpinorFieldoperator= (const cpuColorSpinorField &)
 
cpuColorSpinorFieldoperator= (const cudaColorSpinorField &)
 
void Source (const QudaSourceType sourceType, const int st=0, const int s=0, const int c=0)
 
void PrintVector (unsigned int x) const
 
void allocateGhostBuffer (int nFace) const
 Allocate the ghost buffers. More...
 
void packGhost (void **ghost, const QudaParity parity, const int nFace, const int dagger) const
 
void unpackGhost (void *ghost_spinor, const int dim, const QudaDirection dir, const int dagger)
 
void copy (const cpuColorSpinorField &)
 
void zero ()
 
virtual void copy_to_buffer (void *buffer) const
 Copy all contents of the field to a host buffer. More...
 
virtual void copy_from_buffer (void *buffer)
 Copy all contents of the field from a host buffer to this field. More...
 
void exchangeGhost (QudaParity parity, int nFace, int dagger, const MemoryLocation *pack_destination=nullptr, const MemoryLocation *halo_location=nullptr, bool gdr_send=false, bool gdr_recv=false, QudaPrecision ghost_precision=QUDA_INVALID_PRECISION) const
 This is a unified ghost exchange function for doing a complete halo exchange regardless of the type of field. All dimensions are exchanged and no spin projection is done in the case of Wilson fermions. More...
 
void backup () const
 Backs up the cpuColorSpinorField. More...
 
void restore () const
 Restores the cpuColorSpinorField. More...
 
- Public Member Functions inherited from quda::ColorSpinorField
 ColorSpinorField (const ColorSpinorField &)
 
 ColorSpinorField (const ColorSpinorParam &)
 
virtual ~ColorSpinorField ()
 
int Ncolor () const
 
int Nspin () const
 
int Nvec () const
 
QudaTwistFlavorType TwistFlavor () const
 
int Ndim () const
 
const int * X () const
 
int X (int d) const
 
size_t RealLength () const
 
size_t Length () const
 
size_t Stride () const
 
size_t Volume () const
 
size_t VolumeCB () const
 
int Pad () const
 
size_t Bytes () const
 
size_t NormBytes () const
 
size_t TotalBytes () const
 
size_t GhostBytes () const
 
size_t GhostFaceBytes (int i) const
 
size_t GhostNormBytes () const
 
void PrintDims () const
 
void * V ()
 
const void * V () const
 
void * Norm ()
 
const void * Norm () const
 
virtual const void * Ghost2 () const
 
virtual int full_dim (int d) const
 
void exchange (void **ghost, void **sendbuf, int nFace=1) const
 
bool isNative () const
 
bool IsComposite () const
 
bool IsComponent () const
 
int CompositeDim () const
 
int ComponentId () const
 
int ComponentVolume () const
 
int ComponentVolumeCB () const
 
int ComponentStride () const
 
size_t ComponentLength () const
 
size_t ComponentRealLength () const
 
size_t ComponentBytes () const
 
size_t ComponentNormBytes () const
 
QudaPCType PCType () const
 
QudaParity SuggestedParity () const
 
void setSuggestedParity (QudaParity suggested_parity)
 
QudaSiteSubset SiteSubset () const
 
QudaSiteOrder SiteOrder () const
 
QudaFieldOrder FieldOrder () const
 
QudaGammaBasis GammaBasis () const
 
const int * GhostFace () const
 
const int * GhostFaceCB () const
 
size_t GhostOffset (const int dim, const int dir) const
 
void * Ghost (const int i)
 
const void * Ghost (const int i) const
 
void * GhostNorm (const int i)
 
const void * GhostNorm (const int i) const
 
void *const * Ghost () const
 
const DslashConstantgetDslashConstant () const
 Get the dslash_constant structure from this field. More...
 
const ColorSpinorFieldEven () const
 
const ColorSpinorFieldOdd () const
 
ColorSpinorFieldEven ()
 
ColorSpinorFieldOdd ()
 
ColorSpinorFieldComponent (const int idx) const
 
ColorSpinorFieldComponent (const int idx)
 
CompositeColorSpinorFieldComponents ()
 
void PrintVector (unsigned int x_cb, unsigned int parity) const
 Thin wrapper around PrintVector that takes in a checkerboard index and a parity instead of a full index. More...
 
void LatticeIndex (int *y, int i) const
 
void OffsetIndex (int &i, int *y) const
 
ColorSpinorFieldCreateAlias (const ColorSpinorParam &param)
 Create a field that aliases this field's storage. The alias field can use a different precision than this field, though it cannot be greater. This functionality is useful for the case where we have multiple temporaries in different precisions, but do not need them simultaneously. Use this functionality with caution. More...
 
ColorSpinorFieldCreateCoarse (const int *geoBlockSize, int spinBlockSize, int Nvec, QudaPrecision precision=QUDA_INVALID_PRECISION, QudaFieldLocation location=QUDA_INVALID_FIELD_LOCATION, QudaMemoryType mem_Type=QUDA_MEMORY_INVALID)
 Create a coarse color-spinor field, using this field to set the meta data. More...
 
ColorSpinorFieldCreateFine (const int *geoblockSize, int spinBlockSize, int Nvec, QudaPrecision precision=QUDA_INVALID_PRECISION, QudaFieldLocation location=QUDA_INVALID_FIELD_LOCATION, QudaMemoryType mem_type=QUDA_MEMORY_INVALID)
 Create a fine color-spinor field, using this field to set the meta data. More...
 
- Public Member Functions inherited from quda::LatticeField
 LatticeField (const LatticeFieldParam &param)
 
 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 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 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...
 
- Public Member Functions inherited from quda::Object
 Object ()
 
virtual ~Object ()
 

Static Public Member Functions

static int Compare (const cpuColorSpinorField &a, const cpuColorSpinorField &b, const int resolution=1)
 Perform a component by component comparison of two color-spinor fields. In doing we normalize with respect to the first colorspinor field, e.g., we compare || a_i - b_i || / || a ||. More...
 
static void freeGhostBuffer (void)
 
- Static Public Member Functions inherited from quda::ColorSpinorField
static ColorSpinorFieldCreate (const ColorSpinorParam &param)
 
static ColorSpinorFieldCreate (const ColorSpinorField &src, const ColorSpinorParam &param)
 
- 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)
 

Static Public Attributes

static void * fwdGhostFaceBuffer [QUDA_MAX_DIM]
 
static void * backGhostFaceBuffer [QUDA_MAX_DIM]
 
static void * fwdGhostFaceSendBuffer [QUDA_MAX_DIM]
 
static void * backGhostFaceSendBuffer [QUDA_MAX_DIM]
 
static int initGhostFaceBuffer =0
 
static size_t ghostFaceBytes [QUDA_MAX_DIM] = { }
 
- Static Public Attributes inherited from quda::LatticeField
static int bufferIndex = 0
 
static bool ghost_field_reset = false
 

Friends

class cudaColorSpinorField
 

Additional Inherited Members

- Public Types inherited from quda::ColorSpinorField
using param_type = ColorSpinorParam
 
- Protected Member Functions inherited from quda::ColorSpinorField
void createGhostZone (int nFace, bool spin_project=true) const
 
void reset (const ColorSpinorParam &)
 
void fill (ColorSpinorParam &) const
 
void setTuningString ()
 Set the vol_string and aux_string for use in tuning. More...
 
- Protected Member Functions inherited from quda::LatticeField
void precisionCheck ()
 
- Static Protected Member Functions inherited from quda::ColorSpinorField
static void checkField (const ColorSpinorField &, const ColorSpinorField &)
 
- Protected Attributes inherited from quda::ColorSpinorField
bool init
 
QudaPrecision ghost_precision_allocated
 
int nColor
 
int nSpin
 
int nVec
 
int nDim
 
int x [QUDA_MAX_DIM]
 
size_t volume
 
size_t volumeCB
 
size_t pad
 
size_t stride
 
QudaTwistFlavorType twistFlavor
 
QudaPCType pc_type
 
QudaParity suggested_parity
 
size_t real_length
 
size_t length
 
void * v
 
void * norm
 
void * v_h
 
void * norm_h
 
void * ghost [2][QUDA_MAX_DIM]
 
void * ghostNorm [2][QUDA_MAX_DIM]
 
int ghostFace [QUDA_MAX_DIM]
 
int ghostFaceCB [QUDA_MAX_DIM]
 
void * ghost_buf [2 *QUDA_MAX_DIM]
 
DslashConstant dslash_constant
 
size_t bytes
 
size_t norm_bytes
 
QudaSiteSubset siteSubset
 
QudaSiteOrder siteOrder
 
QudaFieldOrder fieldOrder
 
QudaGammaBasis gammaBasis
 
ColorSpinorFieldeven
 
ColorSpinorFieldodd
 
CompositeColorSpinorFieldDescriptor composite_descr
 used for deflation eigenvector sets etc.: More...
 
CompositeColorSpinorField components
 
- Protected Attributes inherited from quda::LatticeField
size_t volume
 
size_t volumeCB
 
size_t localVolume
 
size_t localVolumeCB
 
size_t stride
 
int pad
 
size_t total_bytes
 
int nDim
 
int x [QUDA_MAX_DIM]
 
int surface [QUDA_MAX_DIM]
 
int surfaceCB [QUDA_MAX_DIM]
 
int r [QUDA_MAX_DIM]
 
QudaPrecision precision
 
QudaPrecision ghost_precision
 
bool ghost_precision_reset
 
double scale
 
QudaSiteSubset siteSubset
 
QudaGhostExchange ghostExchange
 
int nDimComms
 
size_t ghost_bytes
 
size_t ghost_bytes_old
 
size_t ghost_face_bytes [QUDA_MAX_DIM]
 
size_t ghost_face_bytes_aligned [QUDA_MAX_DIM]
 
size_t ghost_offset [QUDA_MAX_DIM][2]
 
void * my_face_h [2]
 
void * my_face_hd [2]
 
void * my_face_d [2]
 
void * my_face_dim_dir_h [2][QUDA_MAX_DIM][2]
 
void * my_face_dim_dir_hd [2][QUDA_MAX_DIM][2]
 
void * my_face_dim_dir_d [2][QUDA_MAX_DIM][2]
 
void * from_face_h [2]
 
void * from_face_hd [2]
 
void * from_face_d [2]
 
void * from_face_dim_dir_h [2][QUDA_MAX_DIM][2]
 
void * from_face_dim_dir_hd [2][QUDA_MAX_DIM][2]
 
void * from_face_dim_dir_d [2][QUDA_MAX_DIM][2]
 
MsgHandlemh_recv_fwd [2][QUDA_MAX_DIM]
 
MsgHandlemh_recv_back [2][QUDA_MAX_DIM]
 
MsgHandlemh_send_fwd [2][QUDA_MAX_DIM]
 
MsgHandlemh_send_back [2][QUDA_MAX_DIM]
 
MsgHandlemh_recv_rdma_fwd [2][QUDA_MAX_DIM]
 
MsgHandlemh_recv_rdma_back [2][QUDA_MAX_DIM]
 
MsgHandlemh_send_rdma_fwd [2][QUDA_MAX_DIM]
 
MsgHandlemh_send_rdma_back [2][QUDA_MAX_DIM]
 
bool initComms
 
char vol_string [TuneKey::volume_n]
 
char aux_string [TuneKey::aux_n]
 
QudaMemoryType mem_type
 
char * backup_h
 
char * backup_norm_h
 
bool backed_up
 
- 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 MsgHandlemh_send_p2p_fwd [2][QUDA_MAX_DIM] { }
 
static MsgHandlemh_send_p2p_back [2][QUDA_MAX_DIM] { }
 
static MsgHandlemh_recv_p2p_fwd [2][QUDA_MAX_DIM] { }
 
static MsgHandlemh_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
 

Detailed Description

Definition at line 976 of file color_spinor_field.h.

Constructor & Destructor Documentation

◆ cpuColorSpinorField() [1/4]

quda::cpuColorSpinorField::cpuColorSpinorField ( const cpuColorSpinorField src)

Definition at line 39 of file cpu_color_spinor_field.cpp.

◆ cpuColorSpinorField() [2/4]

quda::cpuColorSpinorField::cpuColorSpinorField ( const ColorSpinorField src)

Definition at line 45 of file cpu_color_spinor_field.cpp.

◆ cpuColorSpinorField() [3/4]

quda::cpuColorSpinorField::cpuColorSpinorField ( const ColorSpinorField src,
const ColorSpinorParam param 
)

Definition at line 60 of file cpu_color_spinor_field.cpp.

◆ cpuColorSpinorField() [4/4]

quda::cpuColorSpinorField::cpuColorSpinorField ( const ColorSpinorParam param)

Definition at line 19 of file cpu_color_spinor_field.cpp.

◆ ~cpuColorSpinorField()

quda::cpuColorSpinorField::~cpuColorSpinorField ( )
virtual

Definition at line 82 of file cpu_color_spinor_field.cpp.

Member Function Documentation

◆ allocateGhostBuffer()

void quda::cpuColorSpinorField::allocateGhostBuffer ( int  nFace) const

Allocate the ghost buffers.

Parameters
[in]nFaceDepth of each halo

Definition at line 258 of file cpu_color_spinor_field.cpp.

◆ backup()

void quda::cpuColorSpinorField::backup ( ) const
virtual

Backs up the cpuColorSpinorField.

Reimplemented from quda::LatticeField.

Definition at line 212 of file cpu_color_spinor_field.cpp.

◆ Compare()

int quda::cpuColorSpinorField::Compare ( const cpuColorSpinorField a,
const cpuColorSpinorField b,
const int  resolution = 1 
)
static

Perform a component by component comparison of two color-spinor fields. In doing we normalize with respect to the first colorspinor field, e.g., we compare || a_i - b_i || / || a ||.

Parameters
[in]aGround truth color spinor field
[in]bField we are checking
[in]resolutionHow many bins per order of magnitude to use. The default resolution=1 means that we have 16 bins covering the range [1e-15,1.0].

Definition at line 249 of file cpu_color_spinor_field.cpp.

◆ copy()

void quda::cpuColorSpinorField::copy ( const cpuColorSpinorField src)

Definition at line 200 of file cpu_color_spinor_field.cpp.

◆ copy_from_buffer()

void quda::cpuColorSpinorField::copy_from_buffer ( void *  buffer)
virtual

Copy all contents of the field from a host buffer to this field.

Parameters
[in]thehost buffer to copy from.

Implements quda::LatticeField.

Definition at line 339 of file cpu_color_spinor_field.cpp.

◆ copy_to_buffer()

void quda::cpuColorSpinorField::copy_to_buffer ( void *  buffer) const
virtual

Copy all contents of the field to a host buffer.

Parameters
[in]thehost buffer to copy to.

Implements quda::LatticeField.

Definition at line 333 of file cpu_color_spinor_field.cpp.

◆ exchangeGhost()

void quda::cpuColorSpinorField::exchangeGhost ( QudaParity  parity,
int  nFace,
int  dagger,
const MemoryLocation pack_destination = nullptr,
const MemoryLocation halo_location = nullptr,
bool  gdr_send = false,
bool  gdr_recv = false,
QudaPrecision  ghost_precision = QUDA_INVALID_PRECISION 
) const
virtual

This is a unified ghost exchange function for doing a complete halo exchange regardless of the type of field. All dimensions are exchanged and no spin projection is done in the case of Wilson fermions.

Parameters
[in]parityField parity
[in]nFaceDepth of halo exchange
[in]daggerIs this for a dagger operator (only relevant for spin projected Wilson)
[in]pack_destinationDestination of the packing buffer
[in]halo_locationDestination of the halo reading buffer
[in]gdr_sendDummy for CPU
[in]gdr_recvDummy for GPU
[in]ghost_precisionThe precision used for the ghost exchange

Implements quda::ColorSpinorField.

Definition at line 311 of file cpu_color_spinor_field.cpp.

◆ freeGhostBuffer()

void quda::cpuColorSpinorField::freeGhostBuffer ( void  )
static

Definition at line 283 of file cpu_color_spinor_field.cpp.

◆ operator=() [1/3]

ColorSpinorField & quda::cpuColorSpinorField::operator= ( const ColorSpinorField src)
virtual

Reimplemented from quda::ColorSpinorField.

Definition at line 86 of file cpu_color_spinor_field.cpp.

◆ operator=() [2/3]

cpuColorSpinorField & quda::cpuColorSpinorField::operator= ( const cpuColorSpinorField src)

Definition at line 97 of file cpu_color_spinor_field.cpp.

◆ operator=() [3/3]

cpuColorSpinorField & quda::cpuColorSpinorField::operator= ( const cudaColorSpinorField src)

Definition at line 110 of file cpu_color_spinor_field.cpp.

◆ packGhost()

void quda::cpuColorSpinorField::packGhost ( void **  ghost,
const QudaParity  parity,
const int  nFace,
const int  dagger 
) const

Definition at line 297 of file cpu_color_spinor_field.cpp.

◆ PrintVector()

void quda::cpuColorSpinorField::PrintVector ( unsigned int  x) const
virtual

Implements quda::ColorSpinorField.

Definition at line 256 of file cpu_color_spinor_field.cpp.

◆ restore()

void quda::cpuColorSpinorField::restore ( ) const
virtual

Restores the cpuColorSpinorField.

Reimplemented from quda::LatticeField.

Definition at line 226 of file cpu_color_spinor_field.cpp.

◆ Source()

void quda::cpuColorSpinorField::Source ( const QudaSourceType  sourceType,
const int  st = 0,
const int  s = 0,
const int  c = 0 
)
virtual

Implements quda::ColorSpinorField.

Definition at line 245 of file cpu_color_spinor_field.cpp.

◆ unpackGhost()

void quda::cpuColorSpinorField::unpackGhost ( void *  ghost_spinor,
const int  dim,
const QudaDirection  dir,
const int  dagger 
)

Definition at line 303 of file cpu_color_spinor_field.cpp.

◆ zero()

void quda::cpuColorSpinorField::zero ( )

Definition at line 240 of file cpu_color_spinor_field.cpp.

Friends And Related Function Documentation

◆ cudaColorSpinorField

friend class cudaColorSpinorField
friend

Definition at line 978 of file color_spinor_field.h.

Member Data Documentation

◆ backGhostFaceBuffer

void * quda::cpuColorSpinorField::backGhostFaceBuffer
static

Definition at line 982 of file color_spinor_field.h.

◆ backGhostFaceSendBuffer

void * quda::cpuColorSpinorField::backGhostFaceSendBuffer
static

Definition at line 984 of file color_spinor_field.h.

◆ fwdGhostFaceBuffer

void * quda::cpuColorSpinorField::fwdGhostFaceBuffer
static

Definition at line 981 of file color_spinor_field.h.

◆ fwdGhostFaceSendBuffer

void * quda::cpuColorSpinorField::fwdGhostFaceSendBuffer
static

Definition at line 983 of file color_spinor_field.h.

◆ ghostFaceBytes

size_t quda::cpuColorSpinorField::ghostFaceBytes = { }
static

Definition at line 986 of file color_spinor_field.h.

◆ initGhostFaceBuffer

int quda::cpuColorSpinorField::initGhostFaceBuffer =0
static

Definition at line 985 of file color_spinor_field.h.


The documentation for this class was generated from the following files: