27 static LoggerPtr logger(Logger::getLogger(
"pz.strmatrix.frontstructmatrix"));
28 static LoggerPtr loggerfw(Logger::getLogger(
"pz.frontal.frontmatrix.fw"));
41 template<
class TVar,
class store,
class front>
46 pthread_mutex_t mlocal = PTHREAD_MUTEX_INITIALIZER;
48 pthread_cond_t clocal = PTHREAD_COND_INITIALIZER;
58 template<
class TVar,
class store,
class front>
64 pthread_mutex_t mlocal = PTHREAD_MUTEX_INITIALIZER;
66 pthread_cond_t clocal = PTHREAD_COND_INITIALIZER;
70 template<
class TVar,
class store,
class front>
74 template<
class TVar,
class store,
class front>
79 this->
fFront.AddKel(elmat, destinationindex);
82 std::stringstream sout;
83 sout <<
"Frondwidth after AddKel "<< this->
fFront.FrontSize();
94 this->
fFront.DecomposeEquations(mineq,maxeq,*AuxEqn);
98 if(maxeq == this->
Rows()-1){
99 cout <<
"Decomposition finished" << endl;
109 template<
class TVar,
class store,
class front>
112 this->
fFront.AddKel(elmat, sourceindex, destinationindex);
114 if (loggerfw->isDebugEnabled())
116 std::stringstream sout;
117 sout <<
"Frondwidth after AddKel "<< this->
fFront.FrontSize();
121 int64_t mineq, maxeq;
127 this->
fFront.DecomposeEquations(mineq,maxeq,*AuxEqn);
131 if(maxeq == this->
Rows()-1){
133 cout << endl <<
"Decomposition finished" << endl;
145 template<
class TVar,
class store,
class front>
149 cout << endl <<
"FinishWriting" << endl;
157 template<
class TVar,
class store,
class front>
161 if (logger->isDebugEnabled())
163 std::stringstream sout;
164 sout <<
"Entering WriteFile thread execution";
168 cout << endl <<
"Entering Decomposition" << endl;
174 if (logger->isDebugEnabled())
176 std::stringstream sout;
177 sout <<
"Acquired writelock";
184 if (logger->isDebugEnabled())
186 std::stringstream sout;
187 sout <<
"Terminating WriteFile thread execution";
191 cout <<
"Leaving WHILE" << endl;
196 if (logger->isDebugEnabled())
198 std::stringstream sout;
199 sout <<
"Entering cond_wait on fwritecond variable";
209 if (logger->isDebugEnabled())
211 std::stringstream sout;
212 sout <<
"Copied the equation stack releasing the writelock";
221 for(eq=0; eq<neqn; eq++) {
222 parfront->
fStorage.AddEqnArray(local[eq]);
230 if (logger->isDebugEnabled())
232 std::stringstream sout;
233 sout <<
"Releasing writelock";
240 if (logger->isDebugEnabled())
242 std::stringstream sout;
243 sout <<
"Falling through on the write thread";
247 std::cout <<
"Terminating write thread\n";
#define PZ_PTHREAD_MUTEX_UNLOCK(mutex, fn)
Has the same porpouse of EqnStack but stores the EqnArrays in a different form (binary files)...
TPZParFrontMatrix()
Simple Constructor.
#define PZ_PTHREAD_COND_SIGNAL(cond, fn)
void CheckCompress()
Checks if FrontMatrix needs a compression, if so calls Compress method.
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
FrontMatrix with parallel techniques included. Frontal.
Responsible for the frontal method as a whole. Frontal.
pthread_mutex_t mutex_write
Initializing semaphore.
int fFinish
Boolean responsibility. Assumes values 0 and 1.
It is an equation array, generally in its decomposed form. Frontal.
Contains the TPZFront class which implements decomposition process of the frontal matrix...
Responsible for storing arrays of equations (mostly in a decomposed form). Frontal.
store fStorage
Indicates storage schema. Assumes values TPZFileEqnStorage for binary file and TPZStackEqnStorage for...
static void * WriteFile(void *t)
Used in an independent thread to write decomposed equations to a binary file.
char fDecomposed
Decomposition type used to decompose the current matrix.
Contains the TPZParFrontMatrix class which implements FrontMatrix with parallel techniques.
Abstract class implements storage and decomposition process of the frontal matrix involving simmetry ...
#define PZ_PTHREAD_COND_WAIT(cond, mutex, fn)
TPZStack< TPZEqnArray< TVar > * > fEqnStack
Buffer of pointers to decomposed equations. Stored in a Stack.
pthread_cond_t conda_write
Initializing condition.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Contains the TPZEqnArray class which implements an equation array.
void Push(const T object)
Pushes a copy of the object on the stack.
#define LOGPZ_INFO(A, B)
Define log for informations.
#define PZ_PTHREAD_MUTEX_LOCK(mutex, fn)
pthread_cond_t fwritecond
Condition variable used in management of writeing to disk and decomposition.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
int64_t Rows() const
Returns number of rows.
front fFront
Indicates Front matrix type. Assumes values TPZFrontSym for symmetric front and TPZFrontNonSym for no...
Full matrix class. Matrix.
virtual void AddKel(TPZFMatrix< TVar > &elmat, TPZVec< int64_t > &sourceindex, TPZVec< int64_t > &destinationindex) override
Add a contribution of a stiffness matrix.
~TPZParFrontMatrix()
Simple Destructor.
void EquationsToDecompose(TPZVec< int64_t > &destinationindex, int64_t &lower_eq, int64_t &upper_eq)
Sends a message to decompose equations from lower_eq to upper_eq, according to destination index...
This class implements a stack object. Utility.
Contains the TPZAbstractFrontMatrix class which implements a matrix stored in a frontal decomposition...
int64_t NElements() const
Returns the number of elements of the vector.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
void FinishWriting()
Sets the flag fFinish to its true value.
pthread_mutex_t fwritelock
Mutual exclusion locks used in management of writeing to disk and decomposition.
Abstract class implements storage and decomposition process of the frontal matrix involving non-simet...
Contains TPZSFMatrix class which implements a symmetric full matrix.
int ClassId() const override
Define the class id associated with the class.