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

#include <dirac_quda.h>

+ Inheritance diagram for quda::DiracCoarse:

Public Member Functions

double Mass () const
 accessor for Mass (in case of a factor of 2 for staggered) More...
 
double Mu () const
 accessor for twist parameter – overrride can return better value More...
 
double MuFactor () const
 accessor for mu factoo for MG/ – override can return a better value More...
 
 DiracCoarse (const DiracParam &param, bool gpu_setup=true, bool mapped=false)
 
 DiracCoarse (const DiracParam &param, cpuGaugeField *Y_h, cpuGaugeField *X_h, cpuGaugeField *Xinv_h, cpuGaugeField *Yhat_h, cudaGaugeField *Y_d=0, cudaGaugeField *X_d=0, cudaGaugeField *Xinv_d=0, cudaGaugeField *Yhat_d=0)
 
 DiracCoarse (const DiracCoarse &dirac, const DiracParam &param)
 
virtual ~DiracCoarse ()
 
virtual bool isCoarse () const
 Whether the Dirac object is the DiracCoarse. More...
 
void Clover (ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
 Apply the coarse clover operator. More...
 
void CloverInv (ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
 Apply the inverse coarse clover operator. More...
 
virtual void Dslash (ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
 Apply DslashXpay out = (D * in) More...
 
virtual void DslashXpay (ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
 Apply DslashXpay out = (D * in + A * x) More...
 
virtual void M (ColorSpinorField &out, const ColorSpinorField &in) const
 Apply the full operator. More...
 
virtual void MdagM (ColorSpinorField &out, const ColorSpinorField &in) const
 Apply MdagM operator which may be optimized. More...
 
virtual void prepare (ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
 
virtual void reconstruct (ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
 
virtual QudaDiracType getDiracType () const
 returns the Dirac type More...
 
virtual void updateFields (cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in, cudaCloverField *clover_in)
 Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate. These are pointers as opposed to references to support passing in nullptr. More...
 
void createCoarseOp (GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu, double mu_factor=0.) const
 Create the coarse operator from this coarse operator. More...
 
void createPreconditionedCoarseOp (GaugeField &Yhat, GaugeField &Xinv, const GaugeField &Y, const GaugeField &X)
 Create the precondtioned coarse operator. More...
 
virtual void prefetch (QudaFieldLocation mem_space, qudaStream_t stream=0) const
 If managed memory and prefetch is enabled, prefetch all relevant memory fields (X, Y) to the CPU or GPU as requested. More...
 
- Public Member Functions inherited from quda::Dirac
 Dirac (const DiracParam &param)
 
 Dirac (const Dirac &dirac)
 
virtual ~Dirac ()
 
Diracoperator= (const Dirac &dirac)
 
void setCommDim (const int commDim_[QUDA_MAX_DIM]) const
 Enable / disable communications for the Dirac operator. More...
 
virtual void checkParitySpinor (const ColorSpinorField &, const ColorSpinorField &) const
 Check parity spinors are usable (check geometry ?) More...
 
virtual void checkFullSpinor (const ColorSpinorField &, const ColorSpinorField &) const
 check full spinors are compatible (check geometry ?) More...
 
void checkSpinorAlias (const ColorSpinorField &, const ColorSpinorField &) const
 check spinors do not alias More...
 
virtual bool hasDslash () const
 Whether or not the operator has a single-parity Dslash. More...
 
virtual void MdagMLocal (ColorSpinorField &out, const ColorSpinorField &in) const
 Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on each rank. Depending on the number of stencil steps of the fermion type, this may require additional effort to include the terms that hop out of the boundary and then hop back. More...
 
virtual void Dslash4 (ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
 Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on each rank. Depending on the number of stencil steps of the fermion type, this may require additional effort to include the terms that hop out of the boundary and then hop back. More...
 
void Mdag (ColorSpinorField &out, const ColorSpinorField &in) const
 Apply Mdag (daggered operator of M. More...
 
void MMdag (ColorSpinorField &out, const ColorSpinorField &in) const
 Apply Normal Operator. More...
 
virtual void prepareSpecialMG (ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType solType) const
 
virtual void reconstructSpecialMG (ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType solType) const
 
virtual bool hasSpecialMG () const
 specifies whether or not there's a specialized prepare/reconstruct used before/after transfering to/from the coarse level in MG More...
 
void setMass (double mass)
 
double Kappa () const
 accessor for Kappa (mass parameter) More...
 
unsigned long long Flops () const
 returns and then zeroes flopcount More...
 
QudaMatPCType getMatPCType () const
 returns preconditioning type More...
 
int getStencilSteps () const
 I have no idea what this does. More...
 
void Dagger (QudaDagType dag) const
 sets whether operator is daggered or not More...
 
void flipDagger () const
 Flips value of daggered. More...
 
virtual bool hermitian () const
 is operator hermitian More...
 
QudaPrecision HaloPrecision () const
 
void setHaloPrecision (QudaPrecision halo_precision_) const
 
- Public Member Functions inherited from quda::Object
 Object ()
 
virtual ~Object ()
 

Protected Member Functions

void initializeCoarse ()
 Initialize the coarse gauge fields. Location is determined by gpu_setup variable. More...
 
void initializeLazy (QudaFieldLocation location) const
 Create the CPU or GPU coarse gauge fields on demand (requires that the fields have been created in the other memory space) More...
 
void createY (bool gpu=true, bool mapped=false) const
 Allocate the Y and X fields. More...
 
void createYhat (bool gpu=true) const
 Allocate the Yhat and Xinv fields. More...
 
- Protected Member Functions inherited from quda::Dirac
bool newTmp (ColorSpinorField **, const ColorSpinorField &) const
 
void deleteTmp (ColorSpinorField **, const bool &reset) const
 

Protected Attributes

double mass
 
double mu
 
double mu_factor
 
const Transfertransfer
 
const Diracdirac
 
const bool need_bidirectional
 
const bool use_mma
 
cpuGaugeFieldY_h
 
cpuGaugeFieldX_h
 
cpuGaugeFieldXinv_h
 
cpuGaugeFieldYhat_h
 
cudaGaugeFieldY_d
 
cudaGaugeFieldX_d
 
cudaGaugeFieldXinv_d
 
cudaGaugeFieldYhat_d
 
bool enable_gpu
 
bool enable_cpu
 
const bool gpu_setup
 
bool init_gpu
 
bool init_cpu
 
const bool mapped
 
- Protected Attributes inherited from quda::Dirac
cudaGaugeFieldgauge
 
double kappa
 
double mass
 
int laplace3D
 
QudaMatPCType matpcType
 
QudaDagType dagger
 
unsigned long long flops
 
ColorSpinorFieldtmp1
 
ColorSpinorFieldtmp2
 
QudaDiracType type
 
QudaPrecision halo_precision
 
int commDim [QUDA_MAX_DIM]
 
TimeProfile profile
 

Additional Inherited Members

- Static Public Member Functions inherited from quda::Dirac
static Diraccreate (const DiracParam &param)
 Creates a subclass from parameters. More...
 
- 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)
 

Detailed Description

This class serves as a front-end to the coarse Dslash operator, similar to the other dslash operators.

Definition at line 1559 of file dirac_quda.h.

Constructor & Destructor Documentation

◆ DiracCoarse() [1/3]

quda::DiracCoarse::DiracCoarse ( const DiracParam param,
bool  gpu_setup = true,
bool  mapped = false 
)
Parameters
[in]paramParameters defining this operator
[in]gpu_setupWhether to do the setup on GPU or CPU
[in]mappedSet to true to put Y and X fields in mapped memory

Definition at line 7 of file dirac_coarse.cpp.

◆ DiracCoarse() [2/3]

quda::DiracCoarse::DiracCoarse ( const DiracParam param,
cpuGaugeField Y_h,
cpuGaugeField X_h,
cpuGaugeField Xinv_h,
cpuGaugeField Yhat_h,
cudaGaugeField Y_d = 0,
cudaGaugeField X_d = 0,
cudaGaugeField Xinv_d = 0,
cudaGaugeField Yhat_d = 0 
)
Parameters
[in]paramParameters defining this operator
[in]Y_hCPU coarse link field
[in]X_hCPU coarse clover field
[in]Xinv_hCPU coarse inverse clover field
[in]Yhat_hCPU coarse preconditioned link field
[in]Y_dGPU coarse link field
[in]X_dGPU coarse clover field
[in]Xinv_dGPU coarse inverse clover field
[in]Yhat_dGPU coarse preconditioned link field

Definition at line 35 of file dirac_coarse.cpp.

◆ DiracCoarse() [3/3]

quda::DiracCoarse::DiracCoarse ( const DiracCoarse dirac,
const DiracParam param 
)
Parameters
[in]diracAnother operator instance to clone from (shallow copy)
[in]paramParameters defining this operator

Definition at line 66 of file dirac_coarse.cpp.

◆ ~DiracCoarse()

quda::DiracCoarse::~DiracCoarse ( )
virtual

Definition at line 92 of file dirac_coarse.cpp.

Member Function Documentation

◆ Clover()

void quda::DiracCoarse::Clover ( ColorSpinorField out,
const ColorSpinorField in,
const QudaParity  parity 
) const

Apply the coarse clover operator.

Parameters
[out]outOutput field
[in]inInput field
[paraity]parity Parity which we are applying the operator to

Definition at line 323 of file dirac_coarse.cpp.

◆ CloverInv()

void quda::DiracCoarse::CloverInv ( ColorSpinorField out,
const ColorSpinorField in,
const QudaParity  parity 
) const

Apply the inverse coarse clover operator.

Parameters
[out]outOutput field
[in]inInput field
[paraity]parity Parity which we are applying the operator to

Definition at line 337 of file dirac_coarse.cpp.

◆ createCoarseOp()

void quda::DiracCoarse::createCoarseOp ( GaugeField Y,
GaugeField X,
const Transfer T,
double  kappa,
double  mass,
double  mu,
double  mu_factor = 0. 
) const
virtual

Create the coarse operator from this coarse operator.

Parameters
T[in]Transfer operator defining the coarse grid
Y[out]Coarse link field
X[out]Coarse clover field
kappaKappa parameter for the coarse operator
massMass parameter (assumed to be zero, staggered mass gets built into clover)
muTM mu parameter for the coarse operator
mu_factormultiplicative factor for the mu parameter

Reimplemented from quda::Dirac.

Reimplemented in quda::DiracCoarsePC.

Definition at line 425 of file dirac_coarse.cpp.

◆ createPreconditionedCoarseOp()

void quda::DiracCoarse::createPreconditionedCoarseOp ( GaugeField Yhat,
GaugeField Xinv,
const GaugeField Y,
const GaugeField X 
)

Create the precondtioned coarse operator.

Parameters
Yhat[out]Preconditioned coarse link field
Xinv[out]Coarse clover inversefield
Y[in]Coarse link field
X[in]Coarse clover inverse field

Definition at line 319 of file dirac_coarse.cpp.

◆ createY()

void quda::DiracCoarse::createY ( bool  gpu = true,
bool  mapped = false 
) const
protected

Allocate the Y and X fields.

Whether we allocate Y and X GPU fields in mapped memory or not

Parameters
[in]gpuWhether to allocate on gpu (true) or cpu (false)
[in]mappedwhether to put gpu allocations into mapped memory

Definition at line 108 of file dirac_coarse.cpp.

◆ createYhat()

void quda::DiracCoarse::createYhat ( bool  gpu = true) const
protected

Allocate the Yhat and Xinv fields.

Parameters
[in]gpuWhether to allocate on gpu (true) or cpu (false)

Definition at line 151 of file dirac_coarse.cpp.

◆ Dslash()

void quda::DiracCoarse::Dslash ( ColorSpinorField out,
const ColorSpinorField in,
const QudaParity  parity 
) const
virtual

Apply DslashXpay out = (D * in)

Parameters
[out]outOutput field
[in]inInput field
[paraity]parity Parity which we are applying the operator to

Implements quda::Dirac.

Reimplemented in quda::DiracCoarsePC.

Definition at line 351 of file dirac_coarse.cpp.

◆ DslashXpay()

void quda::DiracCoarse::DslashXpay ( ColorSpinorField out,
const ColorSpinorField in,
const QudaParity  parity,
const ColorSpinorField x,
const double &  k 
) const
virtual

Apply DslashXpay out = (D * in + A * x)

Parameters
[out]outOutput field
[in]inInput field
[paraity]parity Parity which we are applying the operator to

Implements quda::Dirac.

Reimplemented in quda::DiracCoarsePC.

Definition at line 365 of file dirac_coarse.cpp.

◆ getDiracType()

virtual QudaDiracType quda::DiracCoarse::getDiracType ( ) const
inlinevirtual

returns the Dirac type

Returns
Dirac type

Implements quda::Dirac.

Reimplemented in quda::DiracCoarsePC.

Definition at line 1697 of file dirac_quda.h.

◆ initializeCoarse()

void quda::DiracCoarse::initializeCoarse ( )
protected

Initialize the coarse gauge fields. Location is determined by gpu_setup variable.

GPU copy of the preconditioned coarse link field

Definition at line 193 of file dirac_coarse.cpp.

◆ initializeLazy()

void quda::DiracCoarse::initializeLazy ( QudaFieldLocation  location) const
protected

Create the CPU or GPU coarse gauge fields on demand (requires that the fields have been created in the other memory space)

Definition at line 288 of file dirac_coarse.cpp.

◆ isCoarse()

virtual bool quda::DiracCoarse::isCoarse ( ) const
inlinevirtual

Whether the Dirac object is the DiracCoarse.

Reimplemented from quda::Dirac.

Definition at line 1647 of file dirac_quda.h.

◆ M()

void quda::DiracCoarse::M ( ColorSpinorField out,
const ColorSpinorField in 
) const
virtual

Apply the full operator.

Parameters
[out]outoutput vector, out = M * in
[in]ininput vector

Implements quda::Dirac.

Reimplemented in quda::DiracCoarsePC.

Definition at line 382 of file dirac_coarse.cpp.

◆ Mass()

double quda::DiracCoarse::Mass ( ) const
inlinevirtual

accessor for Mass (in case of a factor of 2 for staggered)

Reimplemented from quda::Dirac.

Definition at line 1614 of file dirac_quda.h.

◆ MdagM()

void quda::DiracCoarse::MdagM ( ColorSpinorField out,
const ColorSpinorField in 
) const
virtual

Apply MdagM operator which may be optimized.

Implements quda::Dirac.

Reimplemented in quda::DiracCoarsePC.

Definition at line 395 of file dirac_coarse.cpp.

◆ Mu()

double quda::DiracCoarse::Mu ( ) const
inlinevirtual

accessor for twist parameter – overrride can return better value

Reimplemented from quda::Dirac.

Definition at line 1615 of file dirac_quda.h.

◆ MuFactor()

double quda::DiracCoarse::MuFactor ( ) const
inlinevirtual

accessor for mu factoo for MG/ – override can return a better value

Reimplemented from quda::Dirac.

Definition at line 1616 of file dirac_quda.h.

◆ prefetch()

void quda::DiracCoarse::prefetch ( QudaFieldLocation  mem_space,
qudaStream_t  stream = 0 
) const
virtual

If managed memory and prefetch is enabled, prefetch all relevant memory fields (X, Y) to the CPU or GPU as requested.

Parameters
[in]mem_spaceMemory space we are prefetching to
[in]streamWhich stream to run the prefetch in (default 0)

Reimplemented from quda::Dirac.

Reimplemented in quda::DiracCoarsePC.

Definition at line 442 of file dirac_coarse.cpp.

◆ prepare()

void quda::DiracCoarse::prepare ( ColorSpinorField *&  src,
ColorSpinorField *&  sol,
ColorSpinorField x,
ColorSpinorField b,
const QudaSolutionType  solType 
) const
virtual

Implements quda::Dirac.

Reimplemented in quda::DiracCoarsePC.

Definition at line 406 of file dirac_coarse.cpp.

◆ reconstruct()

void quda::DiracCoarse::reconstruct ( ColorSpinorField x,
const ColorSpinorField b,
const QudaSolutionType  solType 
) const
virtual

Implements quda::Dirac.

Reimplemented in quda::DiracCoarsePC.

Definition at line 418 of file dirac_coarse.cpp.

◆ updateFields()

virtual void quda::DiracCoarse::updateFields ( cudaGaugeField gauge_in,
cudaGaugeField fat_gauge_in,
cudaGaugeField long_gauge_in,
cudaCloverField clover_in 
)
inlinevirtual

Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate. These are pointers as opposed to references to support passing in nullptr.

Parameters
gauge_inUpdated gauge field
fat_gauge_inUpdated fat links
long_gauge_inUpdated long links
clover_inUpdated clover field

Reimplemented from quda::Dirac.

Definition at line 1699 of file dirac_quda.h.

Member Data Documentation

◆ dirac

const Dirac* quda::DiracCoarse::dirac
protected

restrictor / prolongator defined here

Definition at line 1566 of file dirac_quda.h.

◆ enable_cpu

bool quda::DiracCoarse::enable_cpu
mutableprotected

Whether the GPU links have been constructed

Definition at line 1594 of file dirac_quda.h.

◆ enable_gpu

bool quda::DiracCoarse::enable_gpu
mutableprotected

Definition at line 1593 of file dirac_quda.h.

◆ gpu_setup

const bool quda::DiracCoarse::gpu_setup
protected

Whether the CPU links have been constructed

Definition at line 1595 of file dirac_quda.h.

◆ init_cpu

bool quda::DiracCoarse::init_cpu
mutableprotected

Whether this instance did the GPU allocation or not

Definition at line 1597 of file dirac_quda.h.

◆ init_gpu

bool quda::DiracCoarse::init_gpu
mutableprotected

Where to do the coarse-operator construction

Definition at line 1596 of file dirac_quda.h.

◆ mapped

const bool quda::DiracCoarse::mapped
protected

Whether this instance did the CPU allocation or not

Definition at line 1598 of file dirac_quda.h.

◆ mass

double quda::DiracCoarse::mass
protected

Definition at line 1562 of file dirac_quda.h.

◆ mu

double quda::DiracCoarse::mu
protected

Definition at line 1563 of file dirac_quda.h.

◆ mu_factor

double quda::DiracCoarse::mu_factor
protected

Definition at line 1564 of file dirac_quda.h.

◆ need_bidirectional

const bool quda::DiracCoarse::need_bidirectional
protected

Parent Dirac operator

Definition at line 1567 of file dirac_quda.h.

◆ transfer

const Transfer* quda::DiracCoarse::transfer
protected

Definition at line 1565 of file dirac_quda.h.

◆ use_mma

const bool quda::DiracCoarse::use_mma
protected

Whether or not to force a bi-directional build

Definition at line 1568 of file dirac_quda.h.

◆ X_d

cudaGaugeField* quda::DiracCoarse::X_d
mutableprotected

GPU copy of the coarse link field

Definition at line 1576 of file dirac_quda.h.

◆ X_h

cpuGaugeField* quda::DiracCoarse::X_h
mutableprotected

CPU copy of the coarse link field

Definition at line 1571 of file dirac_quda.h.

◆ Xinv_d

cudaGaugeField* quda::DiracCoarse::Xinv_d
mutableprotected

GPU copy of the coarse clover term

Definition at line 1577 of file dirac_quda.h.

◆ Xinv_h

cpuGaugeField* quda::DiracCoarse::Xinv_h
mutableprotected

CPU copy of the coarse clover term

Definition at line 1572 of file dirac_quda.h.

◆ Y_d

cudaGaugeField* quda::DiracCoarse::Y_d
mutableprotected

CPU copy of the preconditioned coarse link field

Definition at line 1575 of file dirac_quda.h.

◆ Y_h

cpuGaugeField* quda::DiracCoarse::Y_h
mutableprotected

Whether to use tensor cores or not

Definition at line 1570 of file dirac_quda.h.

◆ Yhat_d

cudaGaugeField* quda::DiracCoarse::Yhat_d
mutableprotected

GPU copy of inverse coarse clover term

Definition at line 1578 of file dirac_quda.h.

◆ Yhat_h

cpuGaugeField* quda::DiracCoarse::Yhat_h
mutableprotected

CPU copy of the inverse coarse clover term

Definition at line 1573 of file dirac_quda.h.


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