6 #ifndef TPZStructMatrixTBBFlow_H 7 #define TPZStructMatrixTBBFlow_H 11 #include <semaphore.h> 26 #include "tbb/flow_graph.h" 58 unsigned numthreads_assemble,
unsigned numthreads_decompose) {
70 unsigned numthreads_assemble,
unsigned numthreads_decompose) {
71 std::cout <<
"Nothing to do." << std::endl;
105 TPZFlowGraph(TPZFlowGraph
const ©);
108 TPZVec<int> fnextBlocked, felSequenceColor, felSequenceColorInv;
113 tbb::flow::graph fGraph;
114 tbb::flow::broadcast_node<tbb::flow::continue_msg> fStartNode;
115 std::vector<tbb::flow::continue_node<tbb::flow::continue_msg>* > fNodes;
117 void OrderElements();
118 void ElementColoring();
134 TPZFlowNode(TPZFlowGraph *graph,
int el):
135 myGraph(graph), iel(el) {};
139 void operator()(tbb::flow::continue_msg)
const;
141 TPZFlowGraph *myGraph;
150 struct TPZGraphThreadData {
154 ~TPZGraphThreadData();
156 tbb::flow::graph fAssembleGraph;
158 tbb::flow::broadcast_node<tbb::flow::continue_msg> fStart;
160 std::vector<tbb::flow::continue_node<tbb::flow::continue_msg>* > fGraphNodes;
176 struct TPZGraphThreadNode {
177 TPZGraphThreadData *data;
179 TPZGraphThreadNode(TPZGraphThreadData *data,
int el)
180 : data(data), iel(el) {}
181 void operator()(tbb::flow::continue_msg)
const;
197 TPZFlowGraph *fFlowGraph;
Contains declaration of the TPZSemaphore class which implements semaphore to threads.
virtual ~TPZStructMatrixTBBFlow()
void Read(TPZStream &buf, void *context) override
read objects from the stream
Templated vector implementation.
Contains declaration of TPZGuiInterface class.
TPZEquationFilter fEquationFilter
Object which will determine which equations will be assembled.
virtual TPZStructMatrixTBBFlow * Clone() override
TPZSkylMatrix< REAL > matrix
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
virtual TPZMatrix< STATE > * Create() override
virtual void Assemble(TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose)
TPZCompMesh * fMesh
Pointer to the computational mesh from which the matrix will be generated.
Contains TPZMatrixclass which implements full matrix (using column major representation).
virtual void SetNumThreads(int n)
Refines geometrical mesh (all the elements) num times.
virtual void MultiThread_Assemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
Assemble the global system of equations into the matrix which has already been created.
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
Contains declaration of TPZCompMesh class which is a repository for computational elements...
virtual TPZMatrix< STATE > * CreateAssemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose)
Contains TPZMatrix<TVar>class, root matrix class.
std::set< int > fMaterialIds
Set of material ids to be considered. It is a private attribute.
int fNumThreads
Number of threads in Assemble process.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Implements computational mesh. Computational Mesh.
TPZAutoPointer< TPZCompMesh > fCompMesh
Autopointer control of the computational mesh.
Defines the interface for saving and reading data. Persistency.
int ClassId() const override
Define the class id associated with the class.
virtual void Assemble(TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) override
Assemble the global system of equations into the matrix which has already been created.