QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
 
double * alpha
 
double * beta
 
double * zeta
 
double * zeta_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 49 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 72 of file inv_multi_cg_quda.cpp.

◆ ~ShiftUpdate()

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

Definition at line 78 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 85 of file inv_multi_cg_quda.cpp.

References quda::dslash::aux_worker, quda::blas::axpyBzpcx(), quda::count, j_low, n_shift, X, and quda::zero().

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 80 of file inv_multi_cg_quda.cpp.

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 81 of file inv_multi_cg_quda.cpp.

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 55 of file inv_multi_cg_quda.cpp.

◆ beta

double* quda::ShiftUpdate::beta
private

Definition at line 56 of file inv_multi_cg_quda.cpp.

◆ j_low

const int quda::ShiftUpdate::j_low
private

Definition at line 60 of file inv_multi_cg_quda.cpp.

Referenced by apply().

◆ n_shift

int quda::ShiftUpdate::n_shift
private

Definition at line 61 of file inv_multi_cg_quda.cpp.

Referenced by apply().

◆ 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 69 of file inv_multi_cg_quda.cpp.

◆ p

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

Definition at line 52 of file inv_multi_cg_quda.cpp.

◆ r

ColorSpinorField* quda::ShiftUpdate::r
private

Definition at line 51 of file inv_multi_cg_quda.cpp.

◆ x

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

Definition at line 53 of file inv_multi_cg_quda.cpp.

◆ zeta

double* quda::ShiftUpdate::zeta
private

Definition at line 57 of file inv_multi_cg_quda.cpp.

◆ zeta_old

double* quda::ShiftUpdate::zeta_old
private

Definition at line 58 of file inv_multi_cg_quda.cpp.


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