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 
66 void freeMemory(int Threads);
67 
68 
80 void updateMemory(int Threads, int size);
81 
99 void getSubMatrix(double *matrix,int size1,int size2,int O1,int O2,double *A, int size3,int size4,int nCores);
100 
101 
119 void putSubMatrix(double *matrix,int size1,int size2,int O1,int O2,double *A, int size3,int size4,int nCores);
120 
138 void ParallelChol(double *matrix,int r,int c, int ro, int co, int n,int nCores, int deep);
139 
140 
170 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);
171 
172 
185 void ParallelVectorMatrixT(double *m1,int size,double *m2,double *result, int numThreads);
186 
200 void ParallelVectorMatrix(double *m1,int size,double *m2,double *result, int numThreads);
201 
232 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);
233 
234 
267 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);
268 
269 
296 void TriangleInversion(double *matrix,int r, int c, int ro, int co, int n,int nCores,int posIni, int numTh,double *memaux,int blockSize);
297 
298 
317 void DiagInversion(double *matrix,int r, int c, int ro, int co, int n,int nCores,int posIni,int numTh);
318 
319 
342 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);
343 
344 
367 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);
368 
369 
402 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);
403 
404 
436 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);
437 
469 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);
470 
496 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);
497 
528 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);
529 
530 
561 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);
562 
593 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);
594 
595 
626 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);
627 
628 
650 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);
651 
656 #endif
657 
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 freeMemory(int Threads)
Function to free auxiliar memory to be used in the algebra operations.
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.