00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00039 #ifndef AMESOS_PARAKLETE_H
00040 #define AMESOS_PARAKLETE_H
00041
00042 #include "Amesos_ConfigDefs.h"
00043 #include "Amesos_BaseSolver.h"
00044 #include "Amesos_NoCopiable.h"
00045 #include "Amesos_Utils.h"
00046 #include "Amesos_Time.h"
00047 #include "Amesos_Status.h"
00048 #include "Amesos_Control.h"
00049 #include "Epetra_LinearProblem.h"
00050 #include "Epetra_Time.h"
00051 #include "Epetra_Import.h"
00052 #ifdef EPETRA_MPI
00053 #include "Epetra_MpiComm.h"
00054 #else
00055 #include "Epetra_Comm.h"
00056 #endif
00057 #include "Epetra_CrsGraph.h"
00058 #include "Epetra_CrsMatrix.h"
00059 #ifdef HAVE_AMESOS_EPETRAEXT
00060 #include "EpetraExt_Transpose_RowMatrix.h"
00061 #endif
00062
00063
00065
00084
00085
00086
00087
00088
00089 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00090 class Amesos_Paraklete_Pimpl ;
00091 class Amesos_StandardIndex ;
00092 #endif
00093
00094 class Amesos_Paraklete: public Amesos_BaseSolver,
00095 private Amesos_Time,
00096 private Amesos_NoCopiable,
00097 private Amesos_Utils,
00098 private Amesos_Control,
00099 private Amesos_Status {
00100
00101 public:
00102
00104
00105
00112 Amesos_Paraklete(const Epetra_LinearProblem& LinearProblem );
00113
00115 ~Amesos_Paraklete(void);
00116
00118
00119
00120 int SymbolicFactorization() ;
00121
00122 int NumericFactorization() ;
00123
00124 int Solve();
00125
00127
00128
00130 const Epetra_LinearProblem *GetProblem() const { return(Problem_); };
00131
00133
00136 bool MatrixShapeOK() const ;
00137
00139
00143 int SetUseTranspose(bool UseTranspose_in) {UseTranspose_ = UseTranspose_in; return(0);};
00144
00145 bool UseTranspose() const {return(UseTranspose_);};
00146
00147 const Epetra_Comm & Comm() const {return(GetProblem()->GetOperator()->Comm());};
00148
00149 int SetParameters( Teuchos::ParameterList &ParameterList );
00150
00152 int NumSymbolicFact() const { return( Amesos_Status::NumSymbolicFact_ ); }
00153
00155 int NumNumericFact() const { return( Amesos_Status::NumNumericFact_ ); }
00156
00158 int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
00159
00161 void PrintTiming() const;
00162
00164 void PrintStatus() const;
00165
00167 void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
00168
00169 private:
00170
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190 int CreateLocalMatrixAndExporters() ;
00191
00192
00193
00194
00195
00196
00197
00198
00199 int ExportToSerial() ;
00200
00201
00202
00203
00204
00205
00206
00207 int ConvertToParakleteCRS(bool firsttime);
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221 int PerformSymbolicFactorization();
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235 int PerformNumericFactorization();
00236
00237
00238
00239 bool IamInGroup_;
00240
00241 int SerialXlda_ ;
00242
00243
00244
00245
00246 Teuchos::RCP<Amesos_Paraklete_Pimpl> PrivateParakleteData_;
00247 Teuchos::RCP<Amesos_StandardIndex> StdIndex_;
00248 Teuchos::RCP<Amesos_StandardIndex> StdIndexRange_;
00249 Teuchos::RCP<Amesos_StandardIndex> StdIndexDomain_;
00250 MPI_Comm ParakleteComm_;
00251
00256 std::vector <long> Ap;
00257 std::vector <long> Ai;
00258 std::vector <double> VecAval;
00259 double* Aval;
00260
00262 int UseDataInPlace_;
00264 int numentries_;
00266 int NumGlobalElements_;
00267
00269 Epetra_RowMatrix* RowMatrixA_;
00271 Epetra_CrsMatrix* CrsMatrixA_;
00272
00273
00274
00275
00276
00277 #ifdef HAVE_AMESOS_EPETRAEXT
00278 Teuchos::RCP<EpetraExt::RowMatrix_Transpose> transposer_;
00279 #endif
00281 Teuchos::RCP<Epetra_Map> SerialMap_;
00283 Teuchos::RCP<Epetra_CrsMatrix> SerialCrsMatrixA_;
00285 Epetra_RowMatrix* StdIndexMatrix_ ;
00286 Epetra_MultiVector* StdIndexDomainVector_ ;
00287 Epetra_MultiVector* StdIndexRangeVector_ ;
00289 Epetra_RowMatrix* SerialMatrix_ ;
00290
00292
00293
00294
00295 bool TrustMe_;
00297 int NumVectors_;
00299 double *SerialXBvalues_ ;
00300 double *SerialBvalues_ ;
00302 Epetra_MultiVector* SerialB_ ;
00303 Epetra_MultiVector* SerialX_ ;
00305 Teuchos::RCP<Epetra_MultiVector> SerialXextract_;
00306 Teuchos::RCP<Epetra_MultiVector> SerialBextract_;
00307
00309 bool UseTranspose_;
00311 const Epetra_LinearProblem * Problem_;
00312
00314 std::vector<int> ColIndicesV_;
00316 std::vector<double> RowValuesV_;
00318 Teuchos::RCP<Epetra_Import> ImportToSerial_;
00319 Teuchos::RCP<Epetra_Import> ImportRangeToSerial_;
00320 Teuchos::RCP<Epetra_Import> ImportDomainToSerial_;
00321
00323 int MtxConvTime_, MtxRedistTime_, VecRedistTime_;
00324 int SymFactTime_, NumFactTime_, SolveTime_, OverheadTime_;
00325
00326 };
00327
00328 #endif