avp_bgld_solver.cc

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

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