13 errorQuda(
"QDP ordering only supported for reference fields");
19 errorQuda(
"Field ordering %d presently disabled for this type",
order);
25 bool pad_check =
true;
26 for (
int i=0; i<
nDim; i++) {
29 if (
pad < minimum_pad) pad_check =
false;
31 errorQuda(
"cudaGaugeField being constructed with insufficient padding in dim %d (%d < %d)\n", i,
pad, minimum_pad);
58 for (
int i=0; i<
nDim; i++) {
70 odd =
static_cast<char*
>(gauge) +
bytes/2;
74 void cudaGaugeField::zeroPad() {
103 for (
int i=0; i<
nDim; i++) {
118 errorQuda(
"Cannot request exchange of forward links on non-coarse geometry");
123 const bool no_comms_fill =
true;
124 const bool bidir =
false;
129 for (
int link_dir = 0; link_dir<2; link_dir++) {
136 for (
int d=0; d<
nDim; d++) {
208 const bool no_comms_fill =
false;
209 const bool bidir =
false;
214 for (
int link_dir = 0; link_dir<2; link_dir++) {
221 for (
int d=0; d<
nDim; d++) {
353 stream_p ? *stream_p : 0);
439 for (
int dir=0; dir<2; dir++) {
454 for (
int dir = 0; dir < 2; dir++) {
486 errorQuda(
"Setting gauge pointer is only allowed when create="
487 "QUDA_REFERENCE_FIELD_CREATE type\n");
494 void **buffer =
new void*[geometry];
496 return ((
void*)buffer);
506 void **buffer =
new void*[geometry];
518 delete []((
void**)buffer);
532 if (
this == &src)
return;
586 errorQuda(
"Ghost copy not supported here");
660 errorQuda(
"Ghost copy not supported here");
741 for (
int i = 0; i <
nDim; i++) {
QudaFieldGeometry Geometry() const
QudaStaggeredPhase StaggeredPhase() const
void * ghost[2 *QUDA_MAX_DIM]
QudaGaugeFieldOrder order
bool staggeredPhaseApplied
QudaStaggeredPhase staggeredPhaseType
QudaGaugeFieldOrder Order() const
const double & LinkMax() const
double abs_max(int dim=-1, bool fixed=false) const
Compute the absolute maximum of the field (Linfinity norm)
void checkField(const LatticeField &) const
QudaFieldGeometry geometry
QudaReconstructType reconstruct
const void ** Ghost() const
bool StaggeredPhaseApplied() const
void createGhostZone(const int *R, bool no_comms_fill, bool bidir=true) const
QudaReconstructType Reconstruct() const
QudaGhostExchange ghostExchange
MsgHandle * mh_send_fwd[2][QUDA_MAX_DIM]
MsgHandle * mh_recv_rdma_back[2][QUDA_MAX_DIM]
MsgHandle * mh_send_rdma_fwd[2][QUDA_MAX_DIM]
void * from_face_dim_dir_d[2][QUDA_MAX_DIM][2]
static MsgHandle * mh_recv_p2p_back[2][QUDA_MAX_DIM]
MsgHandle * mh_send_rdma_back[2][QUDA_MAX_DIM]
void * my_face_dim_dir_h[2][QUDA_MAX_DIM][2]
void * from_face_dim_dir_h[2][QUDA_MAX_DIM][2]
static MsgHandle * mh_send_p2p_fwd[2][QUDA_MAX_DIM]
static MsgHandle * mh_recv_p2p_fwd[2][QUDA_MAX_DIM]
static void * ghost_pinned_recv_buffer_h[2]
size_t ghost_offset[QUDA_MAX_DIM][2]
QudaPrecision Precision() const
void * my_face_dim_dir_d[2][QUDA_MAX_DIM][2]
static void destroyIPCComms()
size_t ghost_face_bytes[QUDA_MAX_DIM]
static void * ghost_pinned_send_buffer_h[2]
static void * ghost_remote_send_buffer_d[2][QUDA_MAX_DIM][2]
static MsgHandle * mh_send_p2p_back[2][QUDA_MAX_DIM]
static bool ghost_field_reset
int surfaceCB[QUDA_MAX_DIM]
int surface[QUDA_MAX_DIM]
MsgHandle * mh_send_back[2][QUDA_MAX_DIM]
QudaGhostExchange GhostExchange() const
static cudaEvent_t ipcCopyEvent[2][2][QUDA_MAX_DIM]
static cudaEvent_t ipcRemoteCopyEvent[2][2][QUDA_MAX_DIM]
MsgHandle * mh_recv_fwd[2][QUDA_MAX_DIM]
void allocateGhostBuffer(size_t ghost_bytes) const
Allocate the static ghost buffers.
MsgHandle * mh_recv_rdma_fwd[2][QUDA_MAX_DIM]
size_t ghost_face_bytes_aligned[QUDA_MAX_DIM]
static void * ghost_recv_buffer_d[2]
MsgHandle * mh_recv_back[2][QUDA_MAX_DIM]
void createComms(bool no_comms_fill=false, bool bidir=true)
static void * ghost_send_buffer_d[2]
virtual void copy_from_buffer(void *buffer)
Copy all contents of the field from a host buffer to this field.
void setGauge(void *_gauge)
void copy(const GaugeField &src)
void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch the gauge field and buffers to the CPU or the GPU...
void exchangeGhost(QudaLinkDirection link_direction=QUDA_LINK_BACKWARDS)
Exchange the ghost and store store in the padded region.
void createComms(const int *R, bool no_comms_fill, bool bidir=true)
Create the communication handlers and buffers.
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 f...
void recvStart(int dim, int dir)
Start the receive communicators.
void sendStart(int dim, int dir, qudaStream_t *stream_p=nullptr)
Start the sending communicators.
void loadCPUField(const cpuGaugeField &cpu)
Download into this field from a CPU field.
void backup() const
Backs up the cudaGaugeField to CPU memory.
virtual ~cudaGaugeField()
void allocateGhostBuffer(const int *R, bool no_comms_fill, bool bidir=true) const
Allocate the ghost buffers.
void saveCPUField(cpuGaugeField &cpu) const
Upload from this field into a CPU field.
virtual void copy_to_buffer(void *buffer) const
Copy all contents of the field to a host buffer.
void restore() const
Restores the cudaGaugeField to CUDA memory.
cudaGaugeField(const GaugeFieldParam &)
void commsComplete(int dim, int dir)
Wait for communication to complete.
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...
void comm_start(MsgHandle *mh)
bool comm_gdr_enabled()
Query if GPU Direct RDMA communication is enabled (global setting)
bool comm_peer2peer_enabled(int dir, int dim)
int comm_dim_partitioned(int dim)
void comm_wait(MsgHandle *mh)
enum QudaLinkDirection_s QudaLinkDirection
@ QUDA_CUDA_FIELD_LOCATION
@ QUDA_CPU_FIELD_LOCATION
@ QUDA_LINK_BIDIRECTIONAL
enum QudaGaugeFieldOrder_s QudaGaugeFieldOrder
enum QudaFieldGeometry_s QudaFieldGeometry
enum QudaFieldLocation_s QudaFieldLocation
@ QUDA_GHOST_EXCHANGE_EXTENDED
@ QUDA_GHOST_EXCHANGE_PAD
@ QUDA_MILC_SITE_GAUGE_ORDER
@ QUDA_CPS_WILSON_GAUGE_ORDER
@ QUDA_TIFR_PADDED_GAUGE_ORDER
@ QUDA_QDPJIT_GAUGE_ORDER
@ QUDA_REFERENCE_FIELD_CREATE
#define pool_pinned_malloc(size)
#define pool_device_malloc(size)
#define pool_pinned_free(ptr)
#define pool_device_free(ptr)
#define get_mapped_device_pointer(ptr)
#define mapped_malloc(size)
void * create_gauge_buffer(size_t bytes, QudaGaugeFieldOrder order, QudaFieldGeometry geometry)
void ** create_ghost_buffer(size_t bytes[], QudaGaugeFieldOrder order, QudaFieldGeometry geometry)
void copyGenericGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out=0, void *In=0, void **ghostOut=0, void **ghostIn=0, int type=0)
void extractGaugeGhost(const GaugeField &u, void **ghost, bool extract=true, int offset=0)
void extractExtendedGaugeGhost(const GaugeField &u, int dim, const int *R, void **ghost, bool extract)
void free_gauge_buffer(void *buffer, QudaGaugeFieldOrder order, QudaFieldGeometry geometry)
void free_ghost_buffer(void **buffer, QudaGaugeFieldOrder order, QudaFieldGeometry geometry)
QudaFieldLocation reorder_location()
Return whether data is reordered on the CPU or GPU. This can set at QUDA initialization using the env...
void copyExtendedGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out=0, void *In=0)
bool is_prefetch_enabled()
#define qudaMemset2D(ptr, pitch, value, width, height)
#define qudaMemsetAsync(ptr, value, count, stream)
#define qudaMemPrefetchAsync(ptr, count, mem_space, stream)
#define qudaMemcpy(dst, src, count, kind)
#define qudaEventSynchronize(event)
#define qudaMemset(ptr, value, count)
#define qudaEventRecord(event, stream)
#define qudaMemcpyAsync(dst, src, count, kind, stream)
#define qudaStreamSynchronize(stream)
cudaStream_t qudaStream_t
#define qudaDeviceSynchronize()
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5.