Amesos Package Browser (Single Doxygen Collection) Development
Amesos_Dscpack.h
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //                Amesos: Direct Sparse Solver Package
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef AMESOS_DSCPACK_H
00030 #define AMESOS_DSCPACK_H
00031 
00032 #include "Amesos_ConfigDefs.h"
00033 #include "Amesos_BaseSolver.h"
00034 #include "Amesos_NoCopiable.h"
00035 #include "Amesos_Utils.h"
00036 #include "Amesos_Time.h"
00037 #include "Amesos_Status.h"
00038 #include "Amesos_Control.h"
00039 #include "Epetra_LinearProblem.h"
00040 #include "Epetra_MpiComm.h"
00041 #include "Epetra_Import.h"
00042 #include "Teuchos_RCP.hpp"
00043 
00044 // Amesos_Dscpack_Pimpl contains a pointer to the structure defined in 
00045 // dscmain.h.  This prevents Amesos_Dscpack.h from having to include dscmain.h.
00046 //
00047 //  Doxygen does not handle forward class references well.
00048 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00049 class Amesos_Dscpack_Pimpl ; 
00050 #endif
00051 
00052 
00054 
00060 class Amesos_Dscpack: public Amesos_BaseSolver, 
00061                       private Amesos_Time, 
00062                       private Amesos_NoCopiable, 
00063                       private Amesos_Utils, 
00064                       private Amesos_Control, 
00065                       private Amesos_Status { 
00066 
00067 public: 
00068 
00070 
00071 
00078   Amesos_Dscpack(const Epetra_LinearProblem& LinearProblem );
00079 
00081 
00083   ~Amesos_Dscpack(void);
00085 
00087 
00088   int SymbolicFactorization() ;
00089 
00090   int NumericFactorization() ;
00091 
00092   int Solve();
00093 
00095 
00096 
00097   const Epetra_LinearProblem *GetProblem() const { return(Problem_); };
00098 
00100 
00103   bool MatrixShapeOK() const ;
00104 
00105   int SetUseTranspose(bool UseTranspose) 
00106   {
00107     return(0);
00108   }
00109 
00110   bool UseTranspose() const 
00111   {
00112     return(false);
00113   }
00114 
00115   const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
00116 
00117   int SetParameters( Teuchos::ParameterList &ParameterList )  ;
00118 
00120   int NumSymbolicFact() const { return( Amesos_Status::NumSymbolicFact_ ); }
00121 
00123   int NumNumericFact() const { return( Amesos_Status::NumNumericFact_ ); }
00124 
00126   int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
00127 
00129   void PrintTiming() const;
00130   
00132   void PrintStatus() const;
00133   
00135   void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
00136 
00138 
00139 private:  
00140   
00141   const Epetra_Import& Importer() const
00142   {
00143     return(*Importer_.get());
00144   }
00145 
00146   const Epetra_Map& DscRowMap() const
00147   {
00148     return(*DscRowMap_.get());
00149   }
00150 
00151   const Epetra_Map& DscColMap() const
00152   {
00153     return(*DscColMap_.get());
00154   }
00155 
00157   int PerformSymbolicFactorization();
00158 
00160   int PerformNumericFactorization();
00161 
00163   const Epetra_LinearProblem * Problem_;
00164 
00165   Teuchos::RCP<Amesos_Dscpack_Pimpl> PrivateDscpackData_; 
00166 
00167   bool FirstCallToSolve_;
00169   bool A_and_LU_built;
00170   int *GlobalStructNewColNum; 
00171   int *GlobalStructNewNum; 
00172   int *GlobalStructOwner;
00173   int *LocalStructOldNum;
00174 
00175   int MyDscRank;
00176   int DscNumProcs;
00177   int NumLocalCols;
00178   int NumGlobalCols;
00179   int NumLocalStructs;
00180   int NumLocalNonz ; 
00181 
00182   RCP<Epetra_Import> Importer_;
00183   RCP<Epetra_Map>    DscColMap_;
00184   RCP<Epetra_Map>    DscRowMap_;
00185 
00186   int MaxProcs_;
00187  
00188   int MtxRedistTime_, MtxConvTime_, VecRedistTime_;
00189   int SymFactTime_, NumFactTime_, SolveTime_, OverheadTime_;
00190   
00191   // track memory (as reported by DSCPACK routines)
00192   int TotalMemory_;                       // estimates of the total memory requirements
00193                                           // for the factorization step as a
00194             // whole number of Mbytes. As
00195             // reported in the manual, this is a
00196             // "fair" estimation, but not
00197             // accurate at the last byte.
00198 
00199   
00200 };  // class Amesos_Dscpack  
00201 #endif /* AMESOS_DSCPACK_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines