CHROMA
avp_bglf_solver.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief DWF/Bluegene single-prec solver
4  */
5 
6 #include "avp_bglf_solver.h"
7 #include <dwf-bluelightf.h>
8 
9 namespace Chroma
10 {
11  //! Bluegene single-prec solver
12  /*!
13  * \ingroup qprop
14  *
15  * @{
16  */
17  namespace AVPSolver
18  {
19  MIT_bluelightf_DWF_Fermion* BGLDWFSolverF::loadFermionRHS(const void* OuterFermion) const {
20  return MIT_bluelightf_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderRHS);
21  }
22 
23  MIT_bluelightf_DWF_Fermion* BGLDWFSolverF::loadFermionGuess(const void *OuterFermion) const {
24  return MIT_bluelightf_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderGuess);
25  }
26 
27  MIT_bluelightf_DWF_Fermion* BGLDWFSolverF::allocateFermion(void) const {
28  return MIT_bluelightf_DWF_allocate_fermion();
29  }
30 
31  void BGLDWFSolverF::saveFermionSolver(void *OuterFermion,
32  MIT_bluelightf_DWF_Fermion* CGFermion) const {
33  MIT_bluelightf_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterSolver, CGFermion);
34  }
35 
36  void BGLDWFSolverF::saveFermionOperator(void *OuterFermion,
37  MIT_bluelightf_DWF_Fermion* CGFermion) const {
38  MIT_bluelightf_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterOperator, CGFermion);
39  }
40 
41  void BGLDWFSolverF::deleteFermion(MIT_bluelightf_DWF_Fermion* ptr) const {
42  MIT_bluelightf_DWF_delete_fermion(ptr);
43  }
44 
45 
46  int BGLDWFSolverF::cgInternal(MIT_bluelightf_DWF_Fermion *psi,
47  double *out_eps,
48  int *out_iter,
49  double M,
50  double m_f,
51  const MIT_bluelightf_DWF_Fermion *x0,
52  const MIT_bluelightf_DWF_Fermion *eta,
53  double eps,
54  int min_iter,
55  int max_iter) const
56  {
57  QDPIO::cout << "Entering MIT_bluelightf_DWF_cg_solver" << std::endl;
58  return MIT_bluelightf_DWF_cg_solver(psi, out_eps, out_iter, g, M, m_f,
59  x0, eta, eps, min_iter, max_iter);
60  }
61 
62  void BGLDWFSolverF::loadGauge(const void *u,
63  const void *v) {
64  g=MIT_bluelightf_DWF_load_gauge(u, v, NULL, &AVPSolverFunctions::gaugeReader);
65  }
66 
68  MIT_bluelightf_DWF_delete_gauge(g);
69  }
70 
71 
72  // Init the system -- Constructor call?
73  int BGLDWFSolverF::init(const int lattice[5],
74  void *(*allocator)(size_t size),
75  void (*deallocator)(void *)) {
76  return MIT_bluelightf_DWF_init(lattice, allocator, deallocator);
77  }
78 
79  // Finalize - destructor call
80  void BGLDWFSolverF::fini(void) {
81  MIT_bluelightf_DWF_fini();
82  }
83  }
84 
85  /*! @} */ // end of group qprop
86 }
87 
88 
DWF/Bluegene single-prec solver.
void saveFermionOperator(void *OuterFermion, MIT_bluelightf_DWF_Fermion *CGFermion) const
void deleteFermion(MIT_bluelightf_DWF_Fermion *ptr) const
int init(const int lattice[5], void *(*allocator)(size_t size), void(*deallocator)(void *))
void saveFermionSolver(void *OuterFermion, MIT_bluelightf_DWF_Fermion *CGFermion) const
void loadGauge(const void *u, const void *v)
MIT_bluelightf_DWF_Fermion * loadFermionGuess(const void *OuterFermion) const
MIT_bluelightf_DWF_Fermion * loadFermionRHS(const void *OuterFermion) const
MIT_bluelightf_DWF_Gauge * g
MIT_bluelightf_DWF_Fermion * allocateFermion(void) const
int cgInternal(MIT_bluelightf_DWF_Fermion *psi, double *out_eps, int *out_iter, double M, double m_f, const MIT_bluelightf_DWF_Fermion *x0, const MIT_bluelightf_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