![]() |
NeoPZ
|
Structure to manipulate thread to solve system equations. More...
#include <pzstrmatrixgc.h>
Public Member Functions | |
ThreadData (TPZStructMatrixGC *strmat, TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, std::set< int > &MaterialIds, TPZAutoPointer< TPZGuiInterface > guiInterface) | |
Initialize the mutex semaphores and others. More... | |
ThreadData (TPZStructMatrixGC *strmat, TPZFMatrix< STATE > &rhs, std::set< int > &MaterialIds, TPZAutoPointer< TPZGuiInterface > guiInterface) | |
Initialize the mutex semaphores and others. More... | |
~ThreadData () | |
Destructor: Destroy the mutex semaphores and others. More... | |
bool | ShouldCompute (int matid) |
The function which will compute the assembly. More... | |
Static Public Member Functions | |
static void * | ThreadWork (void *threaddata) |
The function which will compute the matrices. More... | |
static void * | ThreadWorkResidual (void *datavoid) |
Public Attributes | |
TPZStructMatrixGC * | fStruct |
Current structmatrix object. More... | |
TPZAutoPointer< TPZGuiInterface > | fGuiInterface |
Gui interface object. More... | |
TPZMatrix< STATE > * | fGlobMatrix |
Global matrix. More... | |
TPZFMatrix< STATE > * | fGlobRhs |
Global rhs vector. More... | |
std::map< int, std::pair< TPZAutoPointer< TPZElementMatrix >, TPZAutoPointer< TPZElementMatrix > > > | fSubmitted |
List of computed element matrices (autopointers?) More... | |
std::set< int > | fProcessed |
Elements which are being processed. More... | |
int64_t | fNextElement |
Current element. More... | |
pthread_mutex_t | fAccessElement |
Mutexes (to choose which element is next) More... | |
TPZSemaphore | fAssembly |
Semaphore (to wake up assembly thread) More... | |
pthread_cond_t | fCondition |
bool | fSleeping |
std::map< int, int > | felBlocked |
TPZVec< int64_t > * | fnextBlocked |
Vector for mesh coloring. More... | |
TPZVec< int64_t > * | felSequenceColor |
Structure to manipulate thread to solve system equations.
Definition at line 100 of file pzstrmatrixgc.h.
TPZStructMatrixGC::ThreadData::ThreadData | ( | TPZStructMatrixGC * | strmat, |
TPZMatrix< STATE > & | mat, | ||
TPZFMatrix< STATE > & | rhs, | ||
std::set< int > & | MaterialIds, | ||
TPZAutoPointer< TPZGuiInterface > | guiInterface | ||
) |
Initialize the mutex semaphores and others.
Definition at line 494 of file pzstrmatrixgc.cpp.
References fAccessElement, fCondition, and PZ_PTHREAD_MUTEX_INIT.
TPZStructMatrixGC::ThreadData::ThreadData | ( | TPZStructMatrixGC * | strmat, |
TPZFMatrix< STATE > & | rhs, | ||
std::set< int > & | MaterialIds, | ||
TPZAutoPointer< TPZGuiInterface > | guiInterface | ||
) |
Initialize the mutex semaphores and others.
Definition at line 528 of file pzstrmatrixgc.cpp.
References fAccessElement, fCondition, and PZ_PTHREAD_MUTEX_INIT.
TPZStructMatrixGC::ThreadData::~ThreadData | ( | ) |
Destructor: Destroy the mutex semaphores and others.
Definition at line 562 of file pzstrmatrixgc.cpp.
References fAccessElement, fCondition, and PZ_PTHREAD_MUTEX_DESTROY.
|
inline |
The function which will compute the assembly.
Definition at line 111 of file pzstrmatrixgc.h.
References fStruct, and TPZStructMatrixBase::ShouldCompute().
|
static |
The function which will compute the matrices.
Definition at line 575 of file pzstrmatrixgc.cpp.
References TPZFMatrix< TVar >::AddFel(), TPZMatrix< TVar >::AddKel(), TPZGuiInterface::AmIKilled(), TPZElementMatrix::ApplyConstraints(), TPZCompEl::CalcStiff(), TPZElementMatrix::ComputeDestinationIndices(), DebugStop, TPZElementMatrix::EF, TPZElementMatrix::EK, TPZCompMesh::ElementVec(), tht::EnterCriticalSection(), fAccessElement, fCondition, TPZElementMatrix::fConstrMat, TPZElementMatrix::fDestinationIndex, felBlocked, felSequenceColor, fGlobMatrix, fGlobRhs, fGuiInterface, TPZStructMatrixBase::FilterEquations(), TPZElementMatrix::fMat, fnextBlocked, fNextElement, fSleeping, TPZElementMatrix::fSourceIndex, fStruct, TPZElementMatrix::HasDependency(), TPZCompEl::HasDependency(), TPZCompEl::IsInterface(), tht::LeaveCriticalSection(), LOGPZ_DEBUG, TPZGeoEl::MaterialId(), TPZStructMatrixBase::Mesh(), TPZCompMesh::NElements(), TPZElementMatrix::Print(), TPZCompEl::Print(), TPZMatrix< TVar >::Print(), TPZGeoEl::Print(), TPZCompEl::Reference(), and TPZTimer::start().
Referenced by TPZStructMatrixGC::MultiThread_Assemble().
|
static |
Definition at line 791 of file pzstrmatrixgc.cpp.
References TPZFMatrix< TVar >::AddFel(), TPZGuiInterface::AmIKilled(), TPZElementMatrix::ApplyConstraints(), TPZCompEl::CalcResidual(), TPZElementMatrix::ComputeDestinationIndices(), DebugStop, TPZElementMatrix::EF, TPZCompMesh::ElementVec(), tht::EnterCriticalSection(), fAccessElement, fCondition, TPZElementMatrix::fConstrMat, TPZElementMatrix::fDestinationIndex, felBlocked, felSequenceColor, fGlobRhs, fGuiInterface, TPZStructMatrixBase::FilterEquations(), TPZElementMatrix::fMat, fnextBlocked, fNextElement, fSleeping, TPZElementMatrix::fSourceIndex, fStruct, TPZElementMatrix::HasDependency(), TPZCompEl::HasDependency(), TPZCompEl::IsInterface(), tht::LeaveCriticalSection(), LOGPZ_DEBUG, TPZGeoEl::MaterialId(), TPZStructMatrixBase::Mesh(), TPZCompMesh::NElements(), TPZCompEl::Print(), TPZMatrix< TVar >::Print(), TPZGeoEl::Print(), and TPZCompEl::Reference().
Referenced by TPZStructMatrixGC::MultiThread_Assemble().
pthread_mutex_t TPZStructMatrixGC::ThreadData::fAccessElement |
Mutexes (to choose which element is next)
Definition at line 131 of file pzstrmatrixgc.h.
Referenced by ThreadData(), ThreadWork(), ThreadWorkResidual(), and ~ThreadData().
TPZSemaphore TPZStructMatrixGC::ThreadData::fAssembly |
Semaphore (to wake up assembly thread)
Definition at line 133 of file pzstrmatrixgc.h.
pthread_cond_t TPZStructMatrixGC::ThreadData::fCondition |
Definition at line 135 of file pzstrmatrixgc.h.
Referenced by ThreadData(), ThreadWork(), ThreadWorkResidual(), and ~ThreadData().
std::map<int,int> TPZStructMatrixGC::ThreadData::felBlocked |
Definition at line 139 of file pzstrmatrixgc.h.
Referenced by ThreadWork(), and ThreadWorkResidual().
TPZVec<int64_t> * TPZStructMatrixGC::ThreadData::felSequenceColor |
Definition at line 141 of file pzstrmatrixgc.h.
Referenced by TPZStructMatrixGC::MultiThread_Assemble(), TPZStructMatrixGC::Read(), ThreadWork(), ThreadWorkResidual(), and TPZStructMatrixGC::Write().
TPZMatrix<STATE>* TPZStructMatrixGC::ThreadData::fGlobMatrix |
TPZFMatrix<STATE>* TPZStructMatrixGC::ThreadData::fGlobRhs |
Global rhs vector.
Definition at line 123 of file pzstrmatrixgc.h.
Referenced by ThreadWork(), and ThreadWorkResidual().
TPZAutoPointer<TPZGuiInterface> TPZStructMatrixGC::ThreadData::fGuiInterface |
Gui interface object.
Definition at line 119 of file pzstrmatrixgc.h.
Referenced by ThreadWork(), and ThreadWorkResidual().
TPZVec<int64_t>* TPZStructMatrixGC::ThreadData::fnextBlocked |
Vector for mesh coloring.
Definition at line 141 of file pzstrmatrixgc.h.
Referenced by TPZStructMatrixGC::MultiThread_Assemble(), TPZStructMatrixGC::Read(), ThreadWork(), ThreadWorkResidual(), and TPZStructMatrixGC::Write().
int64_t TPZStructMatrixGC::ThreadData::fNextElement |
Current element.
Definition at line 129 of file pzstrmatrixgc.h.
Referenced by ThreadWork(), and ThreadWorkResidual().
std::set<int> TPZStructMatrixGC::ThreadData::fProcessed |
Elements which are being processed.
Definition at line 127 of file pzstrmatrixgc.h.
bool TPZStructMatrixGC::ThreadData::fSleeping |
Definition at line 136 of file pzstrmatrixgc.h.
Referenced by ThreadWork(), and ThreadWorkResidual().
TPZStructMatrixGC* TPZStructMatrixGC::ThreadData::fStruct |
Current structmatrix object.
Definition at line 117 of file pzstrmatrixgc.h.
Referenced by ShouldCompute(), ThreadWork(), and ThreadWorkResidual().
std::map<int, std::pair< TPZAutoPointer<TPZElementMatrix>, TPZAutoPointer<TPZElementMatrix> > > TPZStructMatrixGC::ThreadData::fSubmitted |
List of computed element matrices (autopointers?)
Definition at line 125 of file pzstrmatrixgc.h.