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

#include <gauge_field.h>

+ Inheritance diagram for quda::cpuGaugeField:

Public Member Functions

 cpuGaugeField (const GaugeFieldParam &param)
 Constructor for cpuGaugeField from a GaugeFieldParam. More...
 
virtual ~cpuGaugeField ()
 
void exchangeGhost (QudaLinkDirection link_direction=QUDA_LINK_BACKWARDS)
 Exchange the ghost and store store in the padded region. More...
 
void injectGhost (QudaLinkDirection link_direction=QUDA_LINK_BACKWARDS)
 The opposite of exchangeGhost: take the ghost zone on x, send to node x-1, and inject back into the field. More...
 
void exchangeExtendedGhost (const int *R, bool no_comms_fill=false)
 This does routine will populate the border / halo region of a gauge field that has been created using copyExtendedGauge. More...
 
void exchangeExtendedGhost (const int *R, TimeProfile &profile, bool no_comms_fill=false)
 This does 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 copy (const GaugeField &src)
 
void * Gauge_p ()
 
const void * Gauge_p () const
 
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 setGauge (void **_gauge)
 
void zero ()
 
void backup () const
 Backs up the cpuGaugeField. More...
 
void restore () const
 Restores the cpuGaugeField. More...
 
- Public Member Functions inherited from quda::GaugeField
 GaugeField (const GaugeFieldParam &param)
 
virtual ~GaugeField ()
 
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
 
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 * Even_p ()
 
virtual void * Odd_p ()
 
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
 
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 &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 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 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 ()
 

Friends

void cudaGaugeField::copy (const GaugeField &cpu)
 
void cudaGaugeField::loadCPUField (const cpuGaugeField &cpu)
 
void cudaGaugeField::saveCPUField (cpuGaugeField &cpu) const
 

Additional Inherited Members

- Public Types inherited from quda::GaugeField
using param_type = GaugeFieldParam
 
- Static Public Member Functions inherited from quda::GaugeField
static GaugeFieldCreate (const GaugeFieldParam &param)
 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)
 
- Static Public Attributes inherited from quda::LatticeField
static int bufferIndex = 0
 
static bool ghost_field_reset = false
 
- Protected Member Functions inherited from quda::GaugeField
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 ()
 
- Protected Attributes inherited from quda::GaugeField
size_t bytes
 
size_t phase_offset
 
size_t phase_bytes
 
size_t length
 
size_t real_length
 
int nColor
 
int nFace
 
QudaFieldGeometry geometry
 
QudaReconstructType reconstruct
 
int nInternal
 
QudaGaugeFieldOrder order
 
QudaGaugeFixed fixed
 
QudaLinkType link_type
 
QudaTboundary t_boundary
 
double anisotropy
 
double tadpole
 
double fat_link_max
 
QudaFieldCreate create
 
void * ghost [2 *QUDA_MAX_DIM]
 
int ghostFace [QUDA_MAX_DIM]
 
QudaStaggeredPhase staggeredPhaseType
 
bool staggeredPhaseApplied
 
double i_mu
 
size_t site_offset
 
size_t site_size
 
- 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 626 of file gauge_field.h.

Constructor & Destructor Documentation

◆ cpuGaugeField()

quda::cpuGaugeField::cpuGaugeField ( const GaugeFieldParam param)

Constructor for cpuGaugeField from a GaugeFieldParam.

Parameters
[in,out]paramParameter struct - note that in the case that we are wrapping host-side extended fields, this param is modified for subsequent creation of fields that are not extended.

Definition at line 9 of file cpu_gauge_field.cpp.

◆ ~cpuGaugeField()

quda::cpuGaugeField::~cpuGaugeField ( )
virtual

Definition at line 102 of file cpu_gauge_field.cpp.

Member Function Documentation

◆ backup()

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

Backs up the cpuGaugeField.

Reimplemented from quda::LatticeField.

Definition at line 341 of file cpu_gauge_field.cpp.

◆ copy()

void quda::cpuGaugeField::copy ( const GaugeField src)
virtual

Generic gauge field copy

Parameters
[in]srcSource from which we are copying

Implements quda::GaugeField.

Definition at line 261 of file cpu_gauge_field.cpp.

◆ copy_from_buffer()

void quda::cpuGaugeField::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 406 of file cpu_gauge_field.cpp.

◆ copy_to_buffer()

void quda::cpuGaugeField::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 386 of file cpu_gauge_field.cpp.

◆ exchangeExtendedGhost() [1/2]

void quda::cpuGaugeField::exchangeExtendedGhost ( const int *  R,
bool  no_comms_fill = false 
)
virtual

This does routine will populate the border / halo region of a gauge field that has been created using copyExtendedGauge.

Parameters
RThe thickness of the extended region in each dimension
no_comms_fillDo local exchange to fill out the extended region in non-partitioned dimenions

Implements quda::GaugeField.

Definition at line 188 of file cpu_gauge_field.cpp.

◆ exchangeExtendedGhost() [2/2]

void quda::cpuGaugeField::exchangeExtendedGhost ( const int *  R,
TimeProfile profile,
bool  no_comms_fill = false 
)
virtual

This does 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.

Parameters
RThe thickness of the extended region in each dimension
profileTimeProfile intance which will record the time taken
no_comms_fillDo local exchange to fill out the extended region in non-partitioned dimensions

Implements quda::GaugeField.

Definition at line 249 of file cpu_gauge_field.cpp.

◆ exchangeGhost()

void quda::cpuGaugeField::exchangeGhost ( QudaLinkDirection  link_direction = QUDA_LINK_BACKWARDS)
virtual

Exchange the ghost and store store in the padded region.

Parameters
[in]link_directionWhich links are we extracting: this flag only applies to bi-directional coarse-link fields

Implements quda::GaugeField.

Definition at line 136 of file cpu_gauge_field.cpp.

◆ Gauge_p() [1/2]

void* quda::cpuGaugeField::Gauge_p ( )
inlinevirtual

Reimplemented from quda::GaugeField.

Definition at line 688 of file gauge_field.h.

◆ Gauge_p() [2/2]

const void* quda::cpuGaugeField::Gauge_p ( ) const
inlinevirtual

Reimplemented from quda::GaugeField.

Definition at line 689 of file gauge_field.h.

◆ injectGhost()

void quda::cpuGaugeField::injectGhost ( QudaLinkDirection  link_direction = QUDA_LINK_BACKWARDS)
virtual

The opposite of exchangeGhost: take the ghost zone on x, send to node x-1, and inject back into the field.

Parameters
[in]link_directionWhich links are we injecting: this flag only applies to bi-directional coarse-link fields

Implements quda::GaugeField.

Definition at line 169 of file cpu_gauge_field.cpp.

◆ restore()

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

Restores the cpuGaugeField.

Reimplemented from quda::LatticeField.

Definition at line 359 of file cpu_gauge_field.cpp.

◆ setGauge()

void quda::cpuGaugeField::setGauge ( void **  _gauge)

Definition at line 332 of file cpu_gauge_field.cpp.

◆ zero()

void quda::cpuGaugeField::zero ( )
virtual

Set all field elements to zero

Implements quda::GaugeField.

Definition at line 378 of file cpu_gauge_field.cpp.

Friends And Related Function Documentation

◆ cudaGaugeField::copy

void cudaGaugeField::copy ( const GaugeField cpu)
friend

◆ cudaGaugeField::loadCPUField

void cudaGaugeField::loadCPUField ( const cpuGaugeField cpu)
friend

◆ cudaGaugeField::saveCPUField

void cudaGaugeField::saveCPUField ( cpuGaugeField cpu) const
friend

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