00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SELDON_FILE_PASTIX_HXX
00020
00021
00022 extern "C"
00023 {
00024 #define _COMPLEX_H
00025
00026 #include "pastix.h"
00027 }
00028
00029 namespace Seldon
00030 {
00031
00032 template<class T>
00033 class MatrixPastix
00034 {
00035 protected :
00037 pastix_data_t* pastix_data;
00039 pastix_int_t iparm[64];
00041 double dparm[64];
00043 pastix_int_t n;
00045 MPI_Comm comm_facto;
00047 Vector<pastix_int_t> perm, invp;
00049 Vector<pastix_int_t> col_num;
00051 bool distributed;
00053 int print_level;
00055 bool refine_solution;
00056
00057 public :
00058
00059 MatrixPastix();
00060 ~MatrixPastix();
00061
00062 void CreateCommunicator();
00063 void Clear();
00064
00065 void CallPastix(const MPI_Comm&, pastix_int_t* colptr, pastix_int_t* row,
00066 T* val, T* b, pastix_int_t nrhs);
00067
00068 void HideMessages();
00069 void ShowMessages();
00070
00071 void RefineSolution();
00072 void DoNotRefineSolution();
00073
00074 template<class T0, class Prop, class Storage, class Allocator, class Tint>
00075 void FindOrdering(Matrix<T0, Prop, Storage, Allocator> & mat,
00076 Vector<Tint>& numbers, bool keep_matrix = false);
00077
00078 template<class Storage, class Allocator>
00079 void FactorizeMatrix(Matrix<T, General, Storage, Allocator> & mat,
00080 bool keep_matrix = false);
00081
00082 template<class Storage, class Allocator>
00083 void FactorizeMatrix(Matrix<T, Symmetric, Storage, Allocator> & mat,
00084 bool keep_matrix = false);
00085
00086 template<class Allocator2>
00087 void Solve(Vector<T, VectFull, Allocator2>& x);
00088
00089 template<class Allocator2, class Transpose_status>
00090 void Solve(const Transpose_status& TransA,
00091 Vector<T, VectFull, Allocator2>& x);
00092
00093 #ifdef SELDON_WITH_MPI
00094
00095 void SetNbThreadPerNode(int);
00096
00097 template<class Alloc1, class Alloc2, class Alloc3, class Tint>
00098 void FactorizeDistributedMatrix(Vector<pastix_int_t, VectFull, Alloc1>&,
00099 Vector<pastix_int_t, VectFull, Alloc2>&,
00100 Vector<T, VectFull, Alloc3>&,
00101 const Vector<Tint>& glob_number,
00102 bool sym, bool keep_matrix = false);
00103
00104 template<class Allocator2, class Tint>
00105 void SolveDistributed(Vector<T, Vect_Full, Allocator2>& x,
00106 const Vector<Tint>& glob_num);
00107
00108 template<class Allocator2, class Transpose_status, class Tint>
00109 void SolveDistributed(const Transpose_status& TransA,
00110 Vector<T, Vect_Full, Allocator2>& x,
00111 const Vector<Tint>& glob_num);
00112 #endif
00113
00114 };
00115
00116 }
00117
00118 #define SELDON_FILE_PASTIX_HXX
00119 #endif
00120