NeoPZ
pzskylmatpar.h
Go to the documentation of this file.
1 
12 #ifndef TSKYLPARMATH
13 #define TSKYLPARMATH
14 
15 #include "pzmatrix.h"
16 #include "pzvec.h"
17 #include "pzmanvector.h"
18 #include "pzskylmat.h"
19 
20 
21 #include <stdlib.h>
22 #include <signal.h>
23 #include <time.h>
24 
25 //parallel libraries
26 #include <pthread.h>
27 
28 #include <set>
29 
34 template<class TVar>
35 class TPZSkylParMatrix : public TPZSkylMatrix<TVar>
36 {
37 public:
39  static int main();
40  static int main_nada();
41 
45  TPZSkylParMatrix(const int64_t dim);
47  TPZSkylParMatrix(const int64_t dim, const TPZVec<int64_t> &skyline,int NumThreads);
50 
52  // : TPZMatrix(A.Dim(), A.Dim()), fElem(0), fStorage(0) {Copy(A); }
53 
54 
55  virtual ~TPZSkylParMatrix();
56 
63  int Decompose_Cholesky(std::list<int64_t> &singular) override;
64  int Decompose_Cholesky() override;
65 
66  int Decompose_LDLt(std::list<int64_t> &singular) override;
67  int Decompose_LDLt() override;
68 
69  void SetSkyline(const TPZVec<int64_t> &skyline);
70 
72  public:
73 int ClassId() const override;
74 
75 private:
76 
77  static void *ParallelLDLt(void *t);
78  static void *ParallelLDLt2(void *t);
79  static void *ParallelCholesky(void *t);
80 
82  void ColumnToWork(int64_t &lcol, int64_t &lprevcol);
84  void ColumnToWork(int64_t &lcol);
85  void DecomposeColumnCholesky(int64_t lcol, int64_t lprevcol);
86  void DecomposeColumnLDLt(int64_t lcol, int64_t lprevcol);
87  void DecomposeColumnLDLt2(int64_t lcol);
88  void PrintState();
89 
90 public:
93 
94 private:
95  int64_t fEqDec, fNthreads;
96  int * fThreadUsed;
97  std::set<int64_t> fColUsed;
100  std::list<int64_t> fSingular;
101 
102 #ifdef OOPARLIB
103 
104  virtual int Unpack( TReceiveStorage *buf );
105  static TSaveable *CreateInstance(TReceiveStorage *buf);
106  virtual int Pack( TSendStorage *buf ) const;
107  virtual std::string ClassName() const { return( "TPZSkylParMatrix"); }
108  virtual int DerivedFrom(const int64_t Classid) const;
109  virtual int DerivedFrom(const char *classname) const; // a class with name classname
110 
111 #endif
112 
113 };
114 
115 #endif
std::set< int64_t > fColUsed
Definition: pzskylmatpar.h:97
int ClassId() const override
Define the class id associated with the class.
static int main()
Static main for testing.
TPZVec< int64_t > fSkyline
Definition: pzskylmatpar.h:92
Templated vector implementation.
int Decompose_LDLt() override
Decomposes the current matrix using LDLt.
void DecomposeColumnLDLt(int64_t lcol, int64_t lprevcol)
void SetSkyline(const TPZVec< int64_t > &skyline)
void DecomposeColumnCholesky(int64_t lcol, int64_t lprevcol)
TPZSkylParMatrix()
Default constructor.
Implements a skyline storage format. A Skyline matrix is symmetric so square. Matrix.
Definition: pzskylmat.h:394
int Decompose_Cholesky() override
Decomposes the current matrix using Cholesky method. The current matrix has to be symmetric...
virtual std::string ClassName() const
Definition: pzskylmat.h:555
static int main_nada()
Free store vector implementation.
static void * ParallelLDLt2(void *t)
static TPZSavable * CreateInstance(const int &classId)
Definition: TPZSavable.cpp:120
Contains TPZSkyline class which implements a skyline storage format.
Contains TPZMatrix<TVar>class, root matrix class.
virtual ~TPZSkylParMatrix()
Default destructor.
TPZVec< int > fDec
Definition: pzskylmatpar.h:91
Implements a skyline storage format to parallelized process. Matrix.
Definition: pzskylmatpar.h:35
std::list< int64_t > fSingular
Definition: pzskylmatpar.h:100
void DecomposeColumnLDLt2(int64_t lcol)
static void * ParallelLDLt(void *t)
#define CLONEDEF(A)
To create clone matrix.
Definition: pzmatrix.h:28
static void * ParallelCholesky(void *t)
void ColumnToWork(int64_t &lcol, int64_t &lprevcol)
Determine which column can be decomposed with respect to which column.