Q # 1: Develop the Python MPI code for the following requirements.
1. Create two float 2D arrays with size of 400 * 400 elements each.
2. Initialize them with random values.
3. Perform the array multiplication.
You will use MPI_Scatter, MPI_Bcast, and MPI_Reduce operations to distribute the workload among multiple processes and combine the results. Measure and compare the execution time of the sequential matrix multiplication and parallel matrix multiplication using matrix size of 100 x 100, 200 x 200, 400 x 400, and 800 x 800 and varying numbers of processes from 2, 4, 6, and 8. Analyze the performance improvement achieved by the parallel implementation.
|