CHROMA
avp_altivecf_solver.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief DWF/Bluegene altivec solver
4  */
5 
6 #include "avp_altivecf_solver.h"
7 #include <dwf-altivecf.h>
8 
9 namespace Chroma
10 {
11  //! Bluegene altivec single-prec solver
12  /*!
13  * \ingroup qprop
14  *
15  * @{
16  */
17  namespace AVPSolver
18  {
19 
20  MIT_altivecf_DWF_Fermion* AltiVecDWFSolverF::loadFermionRHS(const void* OuterFermion) const {
21  return MIT_altivecf_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderRHS);
22  }
23 
24  MIT_altivecf_DWF_Fermion* AltiVecDWFSolverF::loadFermionGuess(const void *OuterFermion) const {
25  return MIT_altivecf_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderGuess);
26  }
27 
28  MIT_altivecf_DWF_Fermion* AltiVecDWFSolverF::allocateFermion(void) const {
29  return MIT_altivecf_DWF_allocate_fermion();
30  }
31 
32  void AltiVecDWFSolverF::saveFermionSolver(void *OuterFermion,
33  MIT_altivecf_DWF_Fermion* CGFermion) const {
34  MIT_altivecf_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterSolver, CGFermion);
35  }
36 
37  void AltiVecDWFSolverF::saveFermionOperator(void *OuterFermion,
38  MIT_altivecf_DWF_Fermion* CGFermion) const {
39  MIT_altivecf_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterOperator, CGFermion);
40  }
41 
42  void AltiVecDWFSolverF::deleteFermion(MIT_altivecf_DWF_Fermion* ptr) const {
43  MIT_altivecf_DWF_delete_fermion(ptr);
44  }
45 
46 
47  int AltiVecDWFSolverF::cgInternal(MIT_altivecf_DWF_Fermion *psi,
48  double *out_eps,
49  int *out_iter,
50  double M,
51  double m_f,
52  const MIT_altivecf_DWF_Fermion *x0,
53  const MIT_altivecf_DWF_Fermion *eta,
54  double eps,
55  int min_iter,
56  int max_iter) const
57  {
58  QDPIO::cout << "Entering MIT_altivecf_DWF_cg_solver" << std::endl;
59  return MIT_altivecf_DWF_cg_solver(psi, out_eps, out_iter, g, M, m_f,
60  x0, eta, eps, min_iter, max_iter);
61  }
62 
63  void AltiVecDWFSolverF::loadGauge(const void *u,
64  const void *v) {
65  g=MIT_altivecf_DWF_load_gauge(u, v, NULL, &AVPSolverFunctions::gaugeReader);
66  }
67 
69  MIT_altivecf_DWF_delete_gauge(g);
70  }
71 
72 
73  // Init the system -- Constructor call?
74  int AltiVecDWFSolverF::init(const int lattice[5],
75  void *(*allocator)(size_t size),
76  void (*deallocator)(void *)) {
77  return MIT_altivecf_DWF_init(lattice, allocator, deallocator);
78  }
79 
80  // Finalize - destructor call
82  MIT_altivecf_DWF_fini();
83  }
84  }
85 
86  /*! @} */ // end of group qprop
87 
88 }
89 
90 
DWF/Bluegene altivec solver.
int init(const int lattice[5], void *(*allocator)(size_t size), void(*deallocator)(void *))
MIT_altivecf_DWF_Fermion * allocateFermion(void) const
void saveFermionSolver(void *OuterFermion, MIT_altivecf_DWF_Fermion *CGFermion) const
MIT_altivecf_DWF_Fermion * loadFermionGuess(const void *OuterFermion) const
MIT_altivecf_DWF_Fermion * loadFermionRHS(const void *OuterFermion) const
void loadGauge(const void *u, const void *v)
void deleteFermion(MIT_altivecf_DWF_Fermion *ptr) const
void saveFermionOperator(void *OuterFermion, MIT_altivecf_DWF_Fermion *CGFermion) const
int cgInternal(MIT_altivecf_DWF_Fermion *psi, double *out_eps, int *out_iter, double M, double m_f, const MIT_altivecf_DWF_Fermion *x0, const MIT_altivecf_DWF_Fermion *eta, double eps, int min_iter, int max_iter) const
void fermionWriterOperator(void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim, double val)
double fermionReaderGuess(const void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim)
double gaugeReader(const void *OuterGauge, void *env, const int latt_coord[4], int mu, int row, int col, int reim)
double fermionReaderRHS(const void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim)
void fermionWriterSolver(void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim, double val)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LatticeFermion psi
Definition: mespbg5p_w.cc:35
LatticeFermion eta
Definition: mespbg5p_w.cc:37