QUDA  0.9.0
Public Member Functions | Private Attributes | List of all members
quda::ShiftUpdate Class Reference
Inheritance diagram for quda::ShiftUpdate:
Inheritance graph
[legend]
Collaboration diagram for quda::ShiftUpdate:
Collaboration graph
[legend]

Public Member Functions

 ShiftUpdate (ColorSpinorField *r, std::vector< ColorSpinorField *> p, std::vector< ColorSpinorField *> x, double *alpha, double *beta, double *zeta, double *zeta_old, int j_low, int n_shift)
 
virtual ~ShiftUpdate ()
 
void updateNshift (int new_n_shift)
 
void updateNupdate (int new_n_update)
 
void apply (const cudaStream_t &stream)
 
- Public Member Functions inherited from quda::Worker
 Worker ()
 
virtual ~Worker ()
 

Private Attributes

ColorSpinorFieldr
 
std::vector< ColorSpinorField * > p
 
std::vector< ColorSpinorField * > x
 
doublealpha
 
doublebeta
 
doublezeta
 
doublezeta_old
 
const int j_low
 
int n_shift
 
int n_update
 

Detailed Description

This worker class is used to update the shifted p and x vectors. These updates take place in the subsequent dslash application in the next iteration, while we're waiting on communication to complete. This results in improved strong scaling of the multi-shift solver.

Since the matrix-vector consists of multiple dslash applications, we partition the shifts between these successive dslash applications for optimal communications hiding.

In general, when using a Worker class to hide communication in the dslash, one must be aware whether auto-tuning on the dslash policy that envelops the dslash will occur. If so, then the Worker class instance will be called multiple times during this tuning, potentially rendering the results wrong. This isn't a problem in the multi-shift solve, since we are guaranteed to not run the worker class on the first iteration (when the dslash policy tuning will take place), but this is something that will need to be addressed in the future as the Worker idea to applied elsewhere.

Definition at line 48 of file inv_multi_cg_quda.cpp.

Constructor & Destructor Documentation

◆ ShiftUpdate()

quda::ShiftUpdate::ShiftUpdate ( ColorSpinorField r,
std::vector< ColorSpinorField *>  p,
std::vector< ColorSpinorField *>  x,
double alpha,
double beta,
double zeta,
double zeta_old,
int  j_low,
int  n_shift 
)
inline

Definition at line 71 of file inv_multi_cg_quda.cpp.

◆ ~ShiftUpdate()

virtual quda::ShiftUpdate::~ShiftUpdate ( )
inlinevirtual

Definition at line 77 of file inv_multi_cg_quda.cpp.

Member Function Documentation

◆ apply()

void quda::ShiftUpdate::apply ( const cudaStream_t &  stream)
inlinevirtual

Implements quda::Worker.

Definition at line 84 of file inv_multi_cg_quda.cpp.

References alpha, quda::blas::axpyBzpcx(), beta, quda::count, j_low, n_shift, n_update, p, r, x, X, quda::zero(), zeta, and zeta_old.

Referenced by quda::MultiShiftCG::operator()().

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

◆ updateNshift()

void quda::ShiftUpdate::updateNshift ( int  new_n_shift)
inline

Definition at line 79 of file inv_multi_cg_quda.cpp.

References n_shift.

Referenced by quda::MultiShiftCG::operator()().

Here is the caller graph for this function:

◆ updateNupdate()

void quda::ShiftUpdate::updateNupdate ( int  new_n_update)
inline

Definition at line 80 of file inv_multi_cg_quda.cpp.

References n_update.

Referenced by quda::MultiShiftCG::operator()().

Here is the caller graph for this function:

Member Data Documentation

◆ alpha

double* quda::ShiftUpdate::alpha
private

Definition at line 54 of file inv_multi_cg_quda.cpp.

Referenced by apply().

◆ beta

double* quda::ShiftUpdate::beta
private

Definition at line 55 of file inv_multi_cg_quda.cpp.

Referenced by apply().

◆ j_low

const int quda::ShiftUpdate::j_low
private

Definition at line 59 of file inv_multi_cg_quda.cpp.

Referenced by apply().

◆ n_shift

int quda::ShiftUpdate::n_shift
private

Definition at line 60 of file inv_multi_cg_quda.cpp.

Referenced by apply(), and updateNshift().

◆ n_update

int quda::ShiftUpdate::n_update
private

How much to partition the shifted update. Assuming the operator is (M^ M), this means four applications of dslash for Wilson type operators and two applications for staggered

Definition at line 68 of file inv_multi_cg_quda.cpp.

Referenced by apply(), and updateNupdate().

◆ p

std::vector<ColorSpinorField*> quda::ShiftUpdate::p
private

Definition at line 51 of file inv_multi_cg_quda.cpp.

Referenced by apply().

◆ r

ColorSpinorField* quda::ShiftUpdate::r
private

Definition at line 50 of file inv_multi_cg_quda.cpp.

Referenced by apply().

◆ x

std::vector<ColorSpinorField*> quda::ShiftUpdate::x
private

Definition at line 52 of file inv_multi_cg_quda.cpp.

Referenced by apply().

◆ zeta

double* quda::ShiftUpdate::zeta
private

Definition at line 56 of file inv_multi_cg_quda.cpp.

Referenced by apply().

◆ zeta_old

double* quda::ShiftUpdate::zeta_old
private

Definition at line 57 of file inv_multi_cg_quda.cpp.

Referenced by apply().


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