avp_bglf_solver.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /*! \file
00003  *  \brief DWF/Bluegene single-prec solver
00004  */
00005 
00006 #include "avp_bglf_solver.h"
00007 #include <dwf-bluelightf.h>
00008 
00009 namespace Chroma 
00010 { 
00011   //! Bluegene single-prec solver
00012   /*!
00013    * \ingroup qprop
00014    *
00015    * @{
00016    */
00017   namespace AVPSolver 
00018   { 
00019     MIT_bluelightf_DWF_Fermion* BGLDWFSolverF::loadFermionRHS(const void* OuterFermion) const {
00020       return MIT_bluelightf_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderRHS);
00021     }
00022 
00023     MIT_bluelightf_DWF_Fermion* BGLDWFSolverF::loadFermionGuess(const void *OuterFermion) const {
00024       return MIT_bluelightf_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderGuess);
00025     }
00026 
00027     MIT_bluelightf_DWF_Fermion* BGLDWFSolverF::allocateFermion(void) const {
00028       return MIT_bluelightf_DWF_allocate_fermion();
00029     }
00030 
00031     void BGLDWFSolverF::saveFermionSolver(void *OuterFermion, 
00032                                           MIT_bluelightf_DWF_Fermion* CGFermion) const {
00033       MIT_bluelightf_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterSolver, CGFermion);
00034     }
00035 
00036     void BGLDWFSolverF::saveFermionOperator(void *OuterFermion, 
00037                                             MIT_bluelightf_DWF_Fermion* CGFermion) const {
00038       MIT_bluelightf_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterOperator, CGFermion);
00039     }
00040     
00041     void BGLDWFSolverF::deleteFermion(MIT_bluelightf_DWF_Fermion* ptr) const {
00042       MIT_bluelightf_DWF_delete_fermion(ptr);
00043     }
00044 
00045     
00046     int BGLDWFSolverF::cgInternal(MIT_bluelightf_DWF_Fermion       *psi,
00047                                   double        *out_eps,
00048                                   int           *out_iter,
00049                                   double        M,
00050                                   double        m_f,
00051                                   const MIT_bluelightf_DWF_Fermion *x0,
00052                                   const MIT_bluelightf_DWF_Fermion *eta,
00053                                   double        eps,
00054                                   int           min_iter,
00055                                   int           max_iter)  const 
00056     {
00057       QDPIO::cout << "Entering MIT_bluelightf_DWF_cg_solver" << endl;
00058       return MIT_bluelightf_DWF_cg_solver(psi, out_eps, out_iter, g, M, m_f,
00059                                           x0, eta, eps, min_iter, max_iter);
00060     }
00061     
00062     void BGLDWFSolverF::loadGauge(const void *u,
00063                                   const void *v) { 
00064       g=MIT_bluelightf_DWF_load_gauge(u, v, NULL, &AVPSolverFunctions::gaugeReader);
00065     }
00066      
00067     void BGLDWFSolverF::deleteGauge(void) {
00068       MIT_bluelightf_DWF_delete_gauge(g);
00069     }
00070 
00071      
00072     // Init the system -- Constructor call?
00073     int BGLDWFSolverF::init(const int lattice[5],
00074                             void *(*allocator)(size_t size),
00075                             void (*deallocator)(void *)) {
00076       return MIT_bluelightf_DWF_init(lattice, allocator, deallocator);
00077     }
00078      
00079     // Finalize - destructor call
00080     void BGLDWFSolverF::fini(void) {
00081       MIT_bluelightf_DWF_fini();
00082     }
00083   }
00084 
00085   /*! @} */   // end of group qprop
00086 }
00087 
00088 

Generated on Sun Nov 22 04:28:49 2009 for CHROMA by  doxygen 1.4.7