Question: Using the C++ programming language of your choice, implement the matrix multiplication algorithm use the multithreading that we will explaine it down (the one that

Using the C++ programming language of your choice, implement the matrix multiplication algorithm use the multithreading that we will explaine it down (the one that recursively partitions the two n x n matrices which are to be multiplied into n/2 x n/2 matrices). Demonstrate that your algorithm actually runs by multiplying the 2 16 x 16 matrices shown below. When you submit the solution, please include your source code as well as the output for the specified input. Note: you must use multithreading every place that it is reasonable to do so in your program; that includes the 8 sub-matrix recursive multiplication calls, the 4 sub-matrix additions, and the partitioning of the n x n matrices into the various n/2 x n/2 matrices (i.e., those partitions can be created concurrently).

Pleae use the method for the solution:

Matrix Multiplication . Can multiply 2 n x n matrices in O(n2.81) time using Strassens algorithm; Can we do better using multithreading??? . To multiply 2 n x n matrices in the non-Strassens way, we perform 8 matrix multiplications of n/2 x n/2 matrices and 4 additions of n/2 x n/2 matrices; for simplicity, assume n is a power of 2 . Multithreaded algorithm MatrixMultiply(C, A, B, n): // C = A * B, assume n is a power of 2 if (n == 1) C[1][1] = A[1][1] * B[1][1]; else { allocate a temporary matrix T[1..n][1..n]; partition A, B, C, and T into n/2 x n/2 submatrices; spawn MatrixMultiply(C11, A11, B11, n/2); spawn MatrixMultiply(C12, A11, B12, n/2); spawn MatrixMultiply(C21, A21, B11, n/2); spawn MatrixMultiply(C22, A21, B12, n/2); spawn MatrixMultiply(T11, A12, B21, n/2); spawn MatrixMultiply(T12, A12, B22, n/2); spawn MatrixMultiply(T21, A22, B21, n/2); spawn MatrixMultiply(T22, A22, B22, n/2); sync; // wait for spawnd child processes to finish parallel for (i = 1; i

}

Using the C++ programming language of your choice, implement the matrix multiplicationalgorithm use the multithreading that we will explaine it down (the one

2531710032111090 6031232019108051 3111151100515940 0210461112413130 1320609113122015 8141200717015101 6002100609003101 0211110000020101 1127066010712852 3002835010412543 9421252111312402 5629323112231010 1058444134111211 2347040520106111 3216120001198120

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!