|
QUDA
0.9.0
|
#include <transfer.h>

Public Member Functions | |
| Transfer (const std::vector< ColorSpinorField *> &B, int Nvec, int *geo_bs, int spin_bs, bool enable_gpu, TimeProfile &profile) | |
| virtual | ~Transfer () |
| void | P (ColorSpinorField &out, const ColorSpinorField &in) const |
| void | R (ColorSpinorField &out, const ColorSpinorField &in) const |
| const ColorSpinorField & | Vectors (QudaFieldLocation location=QUDA_CPU_FIELD_LOCATION) const |
| int | nvec () const |
| int | Spin_bs () const |
| const int * | Geo_bs () const |
| void | setTransferGPU (bool use_gpu) const |
| void | setSiteSubset (QudaSiteSubset site_subset, QudaParity parity) |
| Sets whether the transfer operator is to act on full fields or single parity fields, and if single-parity which parity. If site_subset is QUDA_FULL_SITE_SUBSET, the transfer operator can still be applied to single-parity fields, however, if site_subset is QUDA_PARITY_SITE_SUBSET, then the transfer operator cannot be applied to full fields, and setSiteSubset will need to be called first to reset to QUDA_FULL_SITE_SUBSET. This method exists to reduce GPU memory overhead - if only transfering single-parity fine fields then we only store a single-parity copy of the null space components on the device. More... | |
| double | flops () const |
Private Member Functions | |
| void | fillV (ColorSpinorField &V) |
| void | createGeoMap (int *geo_bs) |
| void | createSpinMap (int spin_bs) |
Private Attributes | |
| const std::vector< ColorSpinorField * > & | B |
| const int | Nvec |
| ColorSpinorField * | V_h |
| ColorSpinorField * | V_d |
| ColorSpinorField * | fine_tmp_h |
| ColorSpinorField * | fine_tmp_d |
| ColorSpinorField * | coarse_tmp_h |
| ColorSpinorField * | coarse_tmp_d |
| int * | geo_bs |
| int * | fine_to_coarse_h |
| int * | coarse_to_fine_h |
| int * | fine_to_coarse_d |
| int * | coarse_to_fine_d |
| int | spin_bs |
| int * | spin_map |
| QudaSiteSubset | site_subset |
| QudaParity | parity |
| bool | enable_gpu |
| bool | use_gpu |
| double | flops_ |
| TimeProfile & | profile |
The transfer class defines the inter-grid operators that connect fine and coarse grids. This implements both restriction and prologation methods. The transfer operator is fully defined at object creation time, and defined by the null-space vectors and the coarsening pattern that are passed to it.
At present only the restriction (R) and prolongation (P) methods have been offloaded to run on the GPU, with the block orthogonlization yet to be offloaded.
Definition at line 30 of file transfer.h.
| quda::Transfer::Transfer | ( | const std::vector< ColorSpinorField *> & | B, |
| int | Nvec, | ||
| int * | geo_bs, | ||
| int | spin_bs, | ||
| bool | enable_gpu, | ||
| TimeProfile & | profile | ||
| ) |
The constructor for Transfer
| B | Array of null-space vectors |
| Nvec | Number of null-space vectors |
| d | The Dirac operator to which these null-space vectors correspond |
| geo_bs | The geometric block sizes to use |
| spin_bs | The spin block sizes to use |
| parity | For single-parity fields are these QUDA_EVEN_PARITY or QUDA_ODD_PARITY |
| enable_gpu | Whether to enable this to run on GPU (as well as CPU) |
Definition at line 21 of file transfer.cpp.
References B, quda::BlockOrthogonalize(), coarse_tmp_d, coarse_tmp_h, coarse_to_fine_d, coarse_to_fine_h, quda::ColorSpinorField::Create(), quda::ColorSpinorField::CreateCoarse(), createGeoMap(), createSpinMap(), d, device_malloc, enable_gpu, errorQuda, fillV(), fine_tmp_d, fine_tmp_h, fine_to_coarse_d, fine_to_coarse_h, geo_bs, getVerbosity(), QudaGaugeParam_s::location, ndim, Nspin, Nvec, param, printfQuda, QUDA_CUDA_FIELD_LOCATION, QUDA_FLOAT2_FIELD_ORDER, QUDA_FULL_SITE_SUBSET, QUDA_NULL_FIELD_CREATE, QUDA_PARITY_SITE_SUBSET, QUDA_VERBOSE, QUDA_ZERO_FIELD_CREATE, safe_malloc, spin_bs, spin_map, sprintf(), V_d, V_h, warningQuda, and X.

|
virtual |
The destructor for Transfer
Definition at line 137 of file transfer.cpp.
References coarse_tmp_d, coarse_tmp_h, coarse_to_fine_d, coarse_to_fine_h, device_free, fine_tmp_d, fine_tmp_h, fine_to_coarse_d, fine_to_coarse_h, geo_bs, host_free, spin_map, V_d, and V_h.
|
private |
Creates the map between fine and coarse grids
| geo_bs | An array storing the block size in each geometric dimension |
Definition at line 212 of file transfer.cpp.
References B, checkCudaError, coarse_tmp_h, coarse_to_fine_d, coarse_to_fine_h, d, enable_gpu, fine_tmp_h, fine_to_coarse_d, fine_to_coarse_h, geo_bs, fused_exterior_ndeg_tm_dslash_cuda_gen::i, quda::ColorSpinorField::LatticeIndex(), quda::ColorSpinorField::Ndim(), quda::ColorSpinorField::OffsetIndex(), QUDA_MAX_DIM, qudaMemcpy, quda::ColorSpinorField::Volume(), x, and y.
Referenced by Transfer().


|
private |
Creates a block-ordered version of the color-spinor field V N.B. in must be the accessor to the color-spinor field V
| out | A Complex array storing the block-ordered fields |
| in | Accessor for the color-spinor field V Copies elements from the block-ordered field in back to the color-spinor field V N.B. out must be the accessor to the color-spinor field V |
| out | The full lattice color spinor field, not block-ordered |
| in | A Complex array storing the block-ordered fields Does Gram-Schmidt orthogonalization. |
| v | The block-ordered vectors |
| nBlocks | |
| Nc | |
| blockSize | Creates the map between fine and coarse spin dimensions |
| spin_bs | The spin block size |
Definition at line 253 of file transfer.cpp.
References B, s, spin_bs, and spin_map.
Referenced by Transfer().

|
private |
Copies the null-space vector components into the V-field
Definition at line 197 of file transfer.cpp.
References B, quda::FillV(), Nvec, and V.
Referenced by Transfer().


| double quda::Transfer::flops | ( | ) | const |
Return flops
Definition at line 342 of file transfer.cpp.
References flops_.
Referenced by quda::MG::flops().

|
inline |
Returns the geometrical coarse grid blocking
Definition at line 215 of file transfer.h.
References geo_bs.
Referenced by quda::DiracCoarse::initializeCoarse().

|
inline |
Returns the number of near nullvectors
Definition at line 203 of file transfer.h.
References Nvec.
Referenced by quda::DiracCoarse::initializeCoarse().

| void quda::Transfer::P | ( | ColorSpinorField & | out, |
| const ColorSpinorField & | in | ||
| ) | const |
Apply the prolongator
| out | The resulting field on the fine lattice |
| in | The input field on the coarse lattice |
Definition at line 262 of file transfer.cpp.
References coarse_tmp_d, enable_gpu, errorQuda, quda::ColorSpinorField::Even(), fine_tmp_d, fine_tmp_h, fine_to_coarse_d, fine_to_coarse_h, flops_, quda::ColorSpinorField::GammaBasis(), in, Nvec, out, parity, profile, quda::Prolongate(), QUDA_CPU_FIELD_LOCATION, QUDA_CUDA_FIELD_LOCATION, QUDA_FULL_SITE_SUBSET, QUDA_PARITY_SITE_SUBSET, quda::QUDA_PROFILE_COMPUTE, spin_map, use_gpu, V, V_d, and V_h.
Referenced by quda::MG::operator()(), and quda::MG::verify().


| void quda::Transfer::R | ( | ColorSpinorField & | out, |
| const ColorSpinorField & | in | ||
| ) | const |
Apply the restrictor
| out | The resulting field on the coarse lattice |
| in | The input field on the fine lattice |
Definition at line 300 of file transfer.cpp.
References coarse_tmp_d, coarse_to_fine_d, coarse_to_fine_h, enable_gpu, errorQuda, quda::ColorSpinorField::Even(), fine_tmp_d, fine_tmp_h, fine_to_coarse_d, fine_to_coarse_h, flops_, quda::ColorSpinorField::GammaBasis(), in, Nvec, out, parity, profile, QUDA_CPU_FIELD_LOCATION, QUDA_CUDA_FIELD_LOCATION, QUDA_FULL_SITE_SUBSET, QUDA_PARITY_SITE_SUBSET, quda::QUDA_PROFILE_COMPUTE, quda::qudaDeviceSynchronize(), quda::Restrict(), spin_map, use_gpu, V, V_d, and V_h.
Referenced by quda::MG::MG(), quda::MG::operator()(), and quda::MG::verify().


| void quda::Transfer::setSiteSubset | ( | QudaSiteSubset | site_subset, |
| QudaParity | parity | ||
| ) |
Sets whether the transfer operator is to act on full fields or single parity fields, and if single-parity which parity. If site_subset is QUDA_FULL_SITE_SUBSET, the transfer operator can still be applied to single-parity fields, however, if site_subset is QUDA_PARITY_SITE_SUBSET, then the transfer operator cannot be applied to full fields, and setSiteSubset will need to be called first to reset to QUDA_FULL_SITE_SUBSET. This method exists to reduce GPU memory overhead - if only transfering single-parity fine fields then we only store a single-parity copy of the null space components on the device.
| [in] | site_subset | The site_subset of the fine-grid fields |
| [in] | parity | The parity of the single-parity fields (if applicable) |
Definition at line 155 of file transfer.cpp.
References quda::ColorSpinorField::Create(), enable_gpu, errorQuda, quda::ColorSpinorField::Even(), QudaGaugeParam_s::location, quda::ColorSpinorField::Odd(), param, parity, QUDA_CUDA_FIELD_LOCATION, QUDA_EVEN_PARITY, QUDA_FLOAT2_FIELD_ORDER, QUDA_FULL_SITE_SUBSET, QUDA_ODD_PARITY, QUDA_PARITY_SITE_SUBSET, site_subset, V_d, and V_h.
Referenced by quda::MG::reset().


|
inline |
Sets where the prolongator / restrictor should take place
| location | Location where the transfer operator should be computed |
Definition at line 221 of file transfer.h.
References use_gpu.
|
inline |
Returns the amount of spin blocking
Definition at line 209 of file transfer.h.
References spin_bs.
Referenced by quda::DiracCoarse::initializeCoarse().

|
inline |
Returns a const reference to the V field
| location | Which memory space are we requesting |
Definition at line 195 of file transfer.h.
References QUDA_CUDA_FIELD_LOCATION, V_d, and V_h.
Referenced by quda::CoarseCoarseOp(), quda::CoarseOp(), quda::DiracWilson::createCoarseOp(), quda::DiracClover::createCoarseOp(), quda::DiracCloverPC::createCoarseOp(), quda::DiracTwistedClover::createCoarseOp(), quda::DiracTwistedCloverPC::createCoarseOp(), quda::DiracCoarse::createCoarseOp(), quda::DiracCoarsePC::createCoarseOp(), quda::DiracCoarse::initializeCoarse(), and quda::MG::verify().

|
private |
The raw null space components
Definition at line 35 of file transfer.h.
Referenced by createGeoMap(), createSpinMap(), fillV(), and Transfer().
|
private |
A GPU temporary field with coarse geometry and coarse color we use for CPU input / output
Definition at line 56 of file transfer.h.
Referenced by P(), R(), Transfer(), and ~Transfer().
|
private |
A CPU temporary field with coarse geometry and coarse color
Definition at line 53 of file transfer.h.
Referenced by createGeoMap(), Transfer(), and ~Transfer().
|
private |
The mapping onto fine sites from coarse sites. This has length equal to the fine-grid volume, and is sorted into lexicographical block order, with each value corresponding to a fine-grid offset. (GPU)
Definition at line 81 of file transfer.h.
Referenced by createGeoMap(), R(), Transfer(), and ~Transfer().
|
private |
The mapping onto fine sites from coarse sites. This has length equal to the fine-grid volume, and is sorted into lexicographical block order, with each value corresponding to a fine-grid offset. (CPU)
Definition at line 70 of file transfer.h.
Referenced by createGeoMap(), R(), Transfer(), and ~Transfer().
|
private |
Whether to enable transfer operator on the GPU
Definition at line 96 of file transfer.h.
Referenced by createGeoMap(), P(), R(), setSiteSubset(), and Transfer().
|
private |
A GPU temporary field with fine geometry and fine color we use for changing gamma basis
Definition at line 50 of file transfer.h.
Referenced by P(), R(), Transfer(), and ~Transfer().
|
private |
A CPU temporary field with fine geometry and fine color we use for changing gamma basis
Definition at line 47 of file transfer.h.
Referenced by createGeoMap(), P(), R(), Transfer(), and ~Transfer().
|
private |
The mapping onto coarse sites from fine sites. This has length equal to the fine-grid volume, and is sorted into lexicographical fine-grid order, with each value corresponding to a coarse-grid offset. (GPU)
Definition at line 76 of file transfer.h.
Referenced by createGeoMap(), P(), R(), Transfer(), and ~Transfer().
|
private |
The mapping onto coarse sites from fine sites. This has length equal to the fine-grid volume, and is sorted into lexicographical fine-grid order, with each value corresponding to a coarse-grid offset. (CPU)
Definition at line 65 of file transfer.h.
Referenced by createGeoMap(), P(), R(), Transfer(), and ~Transfer().
|
mutableprivate |
Internal flops accumulator
Definition at line 150 of file transfer.h.
|
private |
The geometrical coase grid blocking
Definition at line 59 of file transfer.h.
Referenced by createGeoMap(), Geo_bs(), Transfer(), and ~Transfer().
|
private |
The number of null space components
Definition at line 38 of file transfer.h.
Referenced by fillV(), nvec(), P(), R(), and Transfer().
|
private |
The parity of any single-parity fine-grid fields that are passed into the transfer operator
Definition at line 93 of file transfer.h.
Referenced by P(), R(), and setSiteSubset().
|
private |
Reference to profile kept in the corresponding MG instance. Use this to record restriction and prolongation overhead.
Definition at line 156 of file transfer.h.
|
private |
Whether the transfer operator is to be applied to full fields or single parity fields
Definition at line 90 of file transfer.h.
Referenced by setSiteSubset().
|
private |
The spin blocking
Definition at line 84 of file transfer.h.
Referenced by createSpinMap(), Spin_bs(), and Transfer().
|
private |
The mapping onto coarse spin from fine spin
Definition at line 87 of file transfer.h.
Referenced by createSpinMap(), P(), R(), Transfer(), and ~Transfer().
|
mutableprivate |
Whether to apply the transfer operaton the GPU (requires enable_gpu=true in the constructor)
Definition at line 100 of file transfer.h.
Referenced by P(), R(), and setTransferGPU().
|
private |
GPU copy of the block-normalized null-space components that define the prolongator
Definition at line 44 of file transfer.h.
Referenced by P(), R(), setSiteSubset(), Transfer(), Vectors(), and ~Transfer().
|
private |
CPU copy of the block-normalized null-space components that define the prolongator
Definition at line 41 of file transfer.h.
Referenced by P(), R(), setSiteSubset(), Transfer(), Vectors(), and ~Transfer().
1.8.14