We have a square matrix A of size NxN of double precision numbers, and consider submatrices of size MxM in the diagonal of A (the submatrix beginning in the position (i,i) consists of M rows and columns beginning in row i and column i: A[i:i+M-1,i:i+M-1]). The L last rows and columns of a submatrix overlap the L initial rows and columns of the following submatrix. Given N, M and L, the submatrices are those beginning in the first row and column, row and column M-L, row and colum 2*M-2*L..., and only submatrices with all the data in A are considered (the final submatrix will be of size MxM). For example, if N=13, M=5 and L=2, the structure of submatrices is:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The squares of the matrices are calculated in the order: first matrix beginning in the first row and column is substituted by its square, then the matrix beginning in row and column M-L is substituted by its square, and so on until the square of all the submatrices is calculated. The whole process is repeated S times.
A number of problems is solved. For each problem the function to parallelize has:
Input parameters:
-int N: the size of matrix A, NxN
-int M: the size of the submatrices, MxM
-int L: the number of rows and columns which the submatrices overlap
-int S: the number of repetitions of the computations
Input-output parameter:
-double *A: the matrix NxN of double precision numbers. It is updated by dividing each element by 10, so that the numbers do not become very high after the multiplications
For more instructions: general instructions.