QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Macros | Enumerations | Functions | Variables
face_gauge.cpp File Reference
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <sys/time.h>
#include <assert.h>
#include <quda_internal.h>
#include <comm_quda.h>
#include <test_util.h>
#include "gauge_field.h"
Include dependency graph for face_gauge.cpp:

Go to the source code of this file.

Macros

#define gaugeSiteSize   18
 
#define MEMCOPY_GAUGE_FIELDS_GRID_TO_BUF(ghost_buf, dst_idx, sitelink, src_idx, num, dir, geom)
 
#define MEMCOPY_GAUGE_FIELDS_BUF_TO_GRID(sitelink, dst_idx, ghost_buf, src_idx, num, dir, geom)
 
#define MEMCOPY_GAUGE_FIELDS_BUF_TO_GRID_T(sitelink, ghost_buf, dst_face, src_face, dir, geom)
 

Enumerations

enum  {
  XUP = 0, YUP = 1, ZUP = 2, TUP = 3,
  TDOWN = 4, ZDOWN = 5, YDOWN = 6, XDOWN = 7
}
 

Functions

void setup_dims_in_gauge (int *XX)
 
static void setup_dims (int *X)
 
template<typename Float >
void packGhostAllStaples (Float *cpuStaple, Float **cpuGhostBack, Float **cpuGhostFwd, int nFace, int *X)
 
void pack_ghost_all_staples_cpu (void *staple, void **cpuGhostStapleBack, void **cpuGhostStapleFwd, int nFace, QudaPrecision precision, int *X)
 
void pack_gauge_diag (void *buf, int *X, void **sitelink, int nu, int mu, int dir1, int dir2, QudaPrecision prec)
 
template<typename Float >
void packGhostAllLinks (Float **cpuLink, Float **cpuGhostBack, Float **cpuGhostFwd, int dir, int nFace, int *X)
 
void pack_ghost_all_links (void **cpuLink, void **cpuGhostBack, void **cpuGhostFwd, int dir, int nFace, QudaPrecision precision, int *X)
 
void exchange_llfat_init (QudaPrecision prec)
 
template<typename Float >
void exchange_sitelink_diag (int *X, Float **sitelink, Float **ghost_sitelink_diag, int optflag)
 
template<typename Float >
void exchange_sitelink (int *X, Float **sitelink, Float **ghost_sitelink, Float **ghost_sitelink_diag, Float **sitelink_fwd_sendbuf, Float **sitelink_back_sendbuf, int optflag)
 
void exchange_cpu_sitelink (int *X, void **sitelink, void **ghost_sitelink, void **ghost_sitelink_diag, QudaPrecision gPrecision, QudaGaugeParam *param, int optflag)
 
void exchange_cpu_sitelink_ex (int *X, int *R, void **sitelink, QudaGaugeFieldOrder cpu_order, QudaPrecision gPrecision, int optflag, int geometry)
 
template<typename Float >
void do_exchange_cpu_staple (Float *staple, Float **ghost_staple, Float **staple_fwd_sendbuf, Float **staple_back_sendbuf, int *X)
 
void exchange_cpu_staple (int *X, void *staple, void **ghost_staple, QudaPrecision gPrecision)
 
void exchange_llfat_cleanup (void)
 

Variables

cudaStream_t * stream
 
static void * fwd_nbr_staple [4]
 
static void * back_nbr_staple [4]
 
static void * fwd_nbr_staple_sendbuf [4]
 
static void * back_nbr_staple_sendbuf [4]
 
static int dims [4]
 
static int X1
 
static int X2
 
static int X3
 
static int X4
 
static int volumeCB
 
static int Vs [4]
 
static int Vsh [4]
 

Macro Definition Documentation

◆ gaugeSiteSize

#define gaugeSiteSize   18

◆ MEMCOPY_GAUGE_FIELDS_BUF_TO_GRID

#define MEMCOPY_GAUGE_FIELDS_BUF_TO_GRID (   sitelink,
  dst_idx,
  ghost_buf,
  src_idx,
  num,
  dir,
  geom 
)

Definition at line 561 of file face_gauge.cpp.

Referenced by exchange_cpu_sitelink_ex().

◆ MEMCOPY_GAUGE_FIELDS_BUF_TO_GRID_T

#define MEMCOPY_GAUGE_FIELDS_BUF_TO_GRID_T (   sitelink,
  ghost_buf,
  dst_face,
  src_face,
  dir,
  geom 
)

Definition at line 594 of file face_gauge.cpp.

Referenced by exchange_cpu_sitelink_ex().

◆ MEMCOPY_GAUGE_FIELDS_GRID_TO_BUF

#define MEMCOPY_GAUGE_FIELDS_GRID_TO_BUF (   ghost_buf,
  dst_idx,
  sitelink,
  src_idx,
  num,
  dir,
  geom 
)
Value:
if(src_oddness) src_idx += Vh_ex; \
if(dst_oddness) dst_idx += R[dir]*slice_3d[dir]/2; \
if(cpu_order == QUDA_QDP_GAUGE_ORDER) { \
for(int linkdir=0; linkdir < 4; linkdir++){ \
char* src = (char*) sitelink[linkdir] + (src_idx)*gaugebytes; \
char* dst = ((char*)ghost_buf[dir])+ linkdir*R[dir]*slice_3d[dir]*gaugebytes + (dst_idx)*gaugebytes; \
memcpy(dst, src, gaugebytes*(num)); \
} \
} else if (cpu_order == QUDA_MILC_GAUGE_ORDER) { \
char* src = ((char*)sitelink)+ (geom)*(src_idx)*gaugebytes; \
char* dst = ((char*)ghost_buf[dir]) + (geom)*(dst_idx)*gaugebytes; \
memcpy(dst, src, (geom)*gaugebytes*(num)); \
} else { \
errorQuda("Unsupported gauge order"); \
} \
static int R[4]
int Vh_ex
Definition: test_util.cpp:36

Definition at line 544 of file face_gauge.cpp.

Referenced by exchange_cpu_sitelink_ex().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
XUP 
YUP 
ZUP 
TUP 
TDOWN 
ZDOWN 
YDOWN 
XDOWN 

Definition at line 21 of file face_gauge.cpp.

Function Documentation

◆ do_exchange_cpu_staple()

template<typename Float >
void do_exchange_cpu_staple ( Float *  staple,
Float **  ghost_staple,
Float **  staple_fwd_sendbuf,
Float **  staple_back_sendbuf,
int *  X 
)

Definition at line 930 of file face_gauge.cpp.

References comm_declare_receive_relative, comm_declare_send_relative, comm_free(), comm_start(), comm_wait(), gaugeSiteSize, pack_ghost_all_staples_cpu(), Vsh, Vsh_t, Vsh_x, Vsh_y, and Vsh_z.

Referenced by exchange_cpu_staple().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exchange_cpu_sitelink()

void exchange_cpu_sitelink ( int *  X,
void **  sitelink,
void **  ghost_sitelink,
void **  ghost_sitelink_diag,
QudaPrecision  gPrecision,
QudaGaugeParam param,
int  optflag 
)

Definition at line 512 of file face_gauge.cpp.

References exchange_sitelink(), gaugeSiteSize, host_free, memset(), QUDA_DOUBLE_PRECISION, safe_malloc, setup_dims(), and Vs.

Referenced by computeHISQLinksCPU(), and llfat_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exchange_cpu_sitelink_ex()

void exchange_cpu_sitelink_ex ( int *  X,
int *  R,
void **  sitelink,
QudaGaugeFieldOrder  cpu_order,
QudaPrecision  gPrecision,
int  optflag,
int  geometry 
)

◆ exchange_cpu_staple()

void exchange_cpu_staple ( int *  X,
void *  staple,
void **  ghost_staple,
QudaPrecision  gPrecision 
)

Definition at line 980 of file face_gauge.cpp.

References do_exchange_cpu_staple(), gaugeSiteSize, host_free, QUDA_DOUBLE_PRECISION, safe_malloc, setup_dims(), Vs, Vs_t, Vs_x, Vs_y, and Vs_z.

Referenced by llfat_reference().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exchange_llfat_cleanup()

void exchange_llfat_cleanup ( void  )

Definition at line 1007 of file face_gauge.cpp.

References back_nbr_staple, back_nbr_staple_sendbuf, checkCudaError, fwd_nbr_staple, fwd_nbr_staple_sendbuf, and host_free.

Referenced by hisq_test(), llfat_test(), and unitarize_link_test().

Here is the caller graph for this function:

◆ exchange_llfat_init()

void exchange_llfat_init ( QudaPrecision  prec)

◆ exchange_sitelink()

template<typename Float >
void exchange_sitelink ( int *  X,
Float **  sitelink,
Float **  ghost_sitelink,
Float **  ghost_sitelink_diag,
Float **  sitelink_fwd_sendbuf,
Float **  sitelink_back_sendbuf,
int  optflag 
)

Definition at line 463 of file face_gauge.cpp.

References comm_declare_receive_relative, comm_declare_send_relative, comm_free(), comm_start(), comm_wait(), commDimPartitioned(), exchange_sitelink_diag(), gaugeSiteSize, pack_ghost_all_links(), and Vsh.

Referenced by exchange_cpu_sitelink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exchange_sitelink_diag()

template<typename Float >
void exchange_sitelink_diag ( int *  X,
Float **  sitelink,
Float **  ghost_sitelink_diag,
int  optflag 
)

Definition at line 394 of file face_gauge.cpp.

References comm_declare_receive_displaced(), comm_declare_send_displaced(), comm_free(), comm_start(), comm_wait(), commDimPartitioned(), errorQuda, gaugeSiteSize, host_free, mu, pack_gauge_diag(), safe_malloc, TUP, and XUP.

Referenced by exchange_sitelink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pack_gauge_diag()

void pack_gauge_diag ( void *  buf,
int *  X,
void **  sitelink,
int  nu,
int  mu,
int  dir1,
int  dir2,
QudaPrecision  prec 
)

Definition at line 193 of file face_gauge.cpp.

References errorQuda, gaugeSiteSize, and tmp.

Referenced by exchange_sitelink_diag().

Here is the caller graph for this function:

◆ pack_ghost_all_links()

void pack_ghost_all_links ( void **  cpuLink,
void **  cpuGhostBack,
void **  cpuGhostFwd,
int  dir,
int  nFace,
QudaPrecision  precision,
int *  X 
)

Definition at line 364 of file face_gauge.cpp.

References packGhostAllLinks(), and QUDA_DOUBLE_PRECISION.

Referenced by exchange_sitelink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pack_ghost_all_staples_cpu()

void pack_ghost_all_staples_cpu ( void *  staple,
void **  cpuGhostStapleBack,
void **  cpuGhostStapleFwd,
int  nFace,
QudaPrecision  precision,
int *  X 
)

Definition at line 184 of file face_gauge.cpp.

References packGhostAllStaples(), and QUDA_DOUBLE_PRECISION.

Referenced by do_exchange_cpu_staple().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ packGhostAllLinks()

template<typename Float >
void packGhostAllLinks ( Float **  cpuLink,
Float **  cpuGhostBack,
Float **  cpuGhostFwd,
int  dir,
int  nFace,
int *  X 
)

Definition at line 258 of file face_gauge.cpp.

References comm_dim(), gaugeSiteSize, index(), and volumeCB.

Referenced by pack_ghost_all_links().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ packGhostAllStaples()

template<typename Float >
void packGhostAllStaples ( Float *  cpuStaple,
Float **  cpuGhostBack,
Float **  cpuGhostFwd,
int  nFace,
int *  X 
)

Definition at line 76 of file face_gauge.cpp.

References comm_dim(), gaugeSiteSize, index(), and volumeCB.

Referenced by pack_ghost_all_staples_cpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_dims()

static void setup_dims ( int *  X)
static

Definition at line 50 of file face_gauge.cpp.

References dims, V, volumeCB, Vs, Vs_t, Vs_x, Vs_y, Vs_z, Vsh, Vsh_t, Vsh_x, Vsh_y, Vsh_z, X1, X2, X3, and X4.

Referenced by exchange_cpu_sitelink(), and exchange_cpu_staple().

Here is the caller graph for this function:

◆ setup_dims_in_gauge()

void setup_dims_in_gauge ( int *  XX)

Variable Documentation

◆ back_nbr_staple

void* back_nbr_staple[4]
static

Definition at line 37 of file face_gauge.cpp.

Referenced by exchange_llfat_cleanup(), and exchange_llfat_init().

◆ back_nbr_staple_sendbuf

void* back_nbr_staple_sendbuf[4]
static

Definition at line 39 of file face_gauge.cpp.

Referenced by exchange_llfat_cleanup(), and exchange_llfat_init().

◆ dims

int dims[4]
static

◆ fwd_nbr_staple

void* fwd_nbr_staple[4]
static

Definition at line 36 of file face_gauge.cpp.

Referenced by exchange_llfat_cleanup(), and exchange_llfat_init().

◆ fwd_nbr_staple_sendbuf

void* fwd_nbr_staple_sendbuf[4]
static

Definition at line 38 of file face_gauge.cpp.

Referenced by exchange_llfat_cleanup(), and exchange_llfat_init().

◆ stream

cudaStream_t* stream

◆ volumeCB

int volumeCB
static

◆ Vs

int Vs[4]
static

◆ Vsh

int Vsh[4]
static

Definition at line 44 of file face_gauge.cpp.

Referenced by do_exchange_cpu_staple(), exchange_sitelink(), and setup_dims().

◆ X1

int X1
static

◆ X2

int X2
static

◆ X3

int X3
static

◆ X4

int X4
static