LIBIRWLS
ParallelAlgorithms.h
Go to the documentation of this file.
1 /*
2  ============================================================================
3  Author : Roberto Diaz Morales
4  ============================================================================
5 
6  Copyright (c) 2016 Roberto Díaz Morales
7 
8  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
9  (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
10  publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
11  subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14 
15  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17  FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 
20  ============================================================================
21  */
22 
37 #ifndef PARALLEL_ALGORITHMS_
38 #define PARALLEL_ALGORITHMS_
39 
40 
53 void initMemory(int Threads, int size);
54 
55 
67 void updateMemory(int Threads, int size);
68 
86 void getSubMatrix(double *matrix,int size1,int size2,int O1,int O2,double *A, int size3,int size4,int nCores);
87 
88 
106 void putSubMatrix(double *matrix,int size1,int size2,int O1,int O2,double *A, int size3,int size4,int nCores);
107 
125 void ParallelChol(double *matrix,int r,int c, int ro, int co, int n,int nCores, int deep);
126 
127 
157 void ParallelLinearSystem(double *matrix1,int r1,int c1, int ro1, int co1,double *matrix2,int r2,int c2, int ro2, int co2,int n, int m,double *result,int rr,int cr, int ror, int cor, int nCores);
158 
159 
172 void ParallelVectorMatrixT(double *m1,int size,double *m2,double *result, int numThreads);
173 
187 void ParallelVectorMatrix(double *m1,int size,double *m2,double *result, int numThreads);
188 
219 void Chol(double *matrix,int r,int c, int ro, int co, int n,int nCores,int numTh, int deep,int posIni,double *memaux, int blockSize);
220 
221 
254 void LinearSystem(double *matrix1,int r1,int c1, int ro1, int co1,double *matrix2,int r2,int c2, int ro2, int co2,int n, int m,double *result,int rr,int cr, int ror, int cor, int nCores, int numTh,int posIni,double *memaux, int blockSize);
255 
256 
283 void TriangleInversion(double *matrix,int r, int c, int ro, int co, int n,int nCores,int posIni, int numTh,double *memaux,int blockSize);
284 
285 
304 void DiagInversion(double *matrix,int r, int c, int ro, int co, int n,int nCores,int posIni,int numTh);
305 
306 
329 void InversionNLProducts(double *matrix,int r, int c, int ro, int co, int n,int nCores,int posIni,int deep,int numTh, double *memaux, int blockSize);
330 
331 
354 void InversionLNProducts(double *matrix,int r, int c, int ro, int co, int n,int nCores,int posIni,int deep,int numTh, double *memaux, int blockSize);
355 
356 
389 void NNProduct(double *m1,int r1,int ro1,int c1, int co1,double *m2,int r2,int ro2,int c2, int co2,int n1,int n2,int n3,double K1,double K2,double *result,int rr,int ror,int cr, int cor, int nCores,int posIni,int numTh,int orientation);
390 
391 
423 void TNNProduct(double *m1,int r1,int ro1,int c1, int co1,double *m2,int r2,int ro2,int c2, int co2,int n1,int n2,int n3,double K1,double K2,double *result,int rr,int ror,int cr, int cor, int nCores,int posIni,int numTh);
424 
456 void NNTProduct(double *m1,int r1,int ro1,int c1, int co1,double *m2,int r2,int ro2,int c2, int co2,int n1,int n2,int n3,double K1,double K2,double *result,int rr,int ror,int cr, int cor, int nCores,int posIni,int numTh);
457 
483 void AATProduct(double *m1,int r1,int ro1,int c1, int co1,int n1,int n2,double K1,double K2,double *result,int rr,int ror,int cr, int cor, int nCores,int posIni,int numTh);
484 
515 void LNProduct(double *m1,int r1,int ro1,int c1, int co1,double *m2,int r2,int ro2,int c2, int co2,int n1,int n2,double K1,double *result,int rr,int ror,int cr, int cor, int nCores,int posIni,int numTh);
516 
517 
548 void LTNProduct(double *m1,int r1,int ro1,int c1, int co1,double *m2,int r2,int ro2,int c2, int co2,int n1,int n2,double K1,double *result,int rr,int ror,int cr, int cor, int nCores,int posIni,int numTh);
549 
580 void NLProduct(double *m1,int r1,int ro1,int c1, int co1,double *m2,int r2,int ro2,int c2, int co2,int n1,int n2,double K1,double *result,int rr,int ror,int cr, int cor, int nCores,int posIni,int numTh);
581 
582 
613 void NLTProduct(double *m1,int r1,int ro1,int c1, int co1,double *m2,int r2,int ro2,int c2, int co2,int n1,int n2,double K1,double *result,int rr,int ror,int cr, int cor, int nCores,int posIni,int numTh);
614 
615 
637 void MoveMatrix(double *m1,int r1,int ro1,int c1, int co1,double *m2,int r2,int ro2,int c2, int co2, int n1, int n2, int nCores,int posIni,int numTh);
638 
643 #endif
644 
void initMemory(int Threads, int size)
Function to allocate auxiliar memory to be used in the algebra operations.
void ParallelVectorMatrixT(double *m1, int size, double *m2, double *result, int numThreads)
This function performs a product of a vector and the transpose of a square matrix in parallel...
void ParallelChol(double *matrix, int r, int c, int ro, int co, int n, int nCores, int deep)
Main function that performs a parallel cholesky factorization.
void ParallelLinearSystem(double *matrix1, int r1, int c1, int ro1, int co1, double *matrix2, int r2, int c2, int ro2, int co2, int n, int m, double *result, int rr, int cr, int ror, int cor, int nCores)
Main function to solve a linear system in parallel.
void ParallelVectorMatrix(double *m1, int size, double *m2, double *result, int numThreads)
This function performs a product of a vector and a square matrix in parallel.
void getSubMatrix(double *matrix, int size1, int size2, int O1, int O2, double *A, int size3, int size4, int nCores)
This function saves a piece of a matrix in the auxiliar memory.
void putSubMatrix(double *matrix, int size1, int size2, int O1, int O2, double *A, int size3, int size4, int nCores)
This function loads a piece of a matrix in the auxiliar memory and storage it in a matrix...
void updateMemory(int Threads, int size)
Function to update auxiliar memory to be used in the algebra operations.