make python implement parallel matrix multiplication by row-partitioning using the Process object of multiprocessing module. The input matrices A and B are small 3×3 matrices and each of 3 processes receives its row and matrix B from the master process, multiplies its row with matrix B to form the row of product matrix C. A worker then sends its associated row of matrixC to the master.We need to consider the following for this algorithm: when a process is spawned using the Process module, it has all of the data of the parent process but the modifications it makes are not reflected in the parent process. In order to have the product matrix C shared between the processes, we need to use the Manager object of the multiprocessing module and define C as an array to be shared from this object. Each worker process performs multiplication and stores the result in its row entry of matrix C.
make python implement parallel matrix multiplication by row-partitioning using the
Process object of multiprocessing module. The input matrices A and B are small
3×3 matrices and each of 3 processes receives its row and matrix B from the master
process, multiplies its row with matrix B to form the row of product matrix C. A
worker then sends its associated row of matrixC to the master.We need to consider the
following for this
it has all of the data of the parent process but the modifications it makes are not
reflected in the parent process. In order to have the product matrix C shared between
the processes, we need to use the Manager object of the multiprocessing module and
define C as an array to be shared from this object. Each worker process performs
multiplication and stores the result in its row entry of matrix C.
Step by step
Solved in 3 steps with 1 images