Exercise 8: Data Decomposition in MPI
Objective: Explore data decomposition strategies in MPI. Understand domain decomposition and its impact on parallel performance.
Tasks:
- Create a 1-D array of 1000 integers
- Implement Domain Decomposition: Modify a simple MPI application (e.g., matrix multiplication) to implement domain decomposition. Divide the data into subdomains and assign them to different processes.
- Experiment with Decomposition Strategies: Implement different decomposition strategies (e.g., block, cyclic) and compare their performance. Analyze how the choice of decomposition affects load balancing and communication overhead.
- Performance Analysis: Use profiling tools to analyze the performance of your MPI application with different decomposition strategies. Identify bottlenecks and discuss how data decomposition impacts overall performance.
- Split the array evenly across MPI ranks.
- Each rank squares its segment.
- Use
MPI_Gatherto collect results on the root process.
- Experiment with different data sizes and number of ranks to see how it affects performance.
- Analyze the impact of communication patterns on performance.
- Extend to a 2-D array and try both row-wise and column-wise decompositions.
- Implement a simple matrix multiplication using MPI with domain decomposition.
- Measure which decomposition pattern gives better performance.
Bonus: Visualize rank boundaries using a simple ASCII output per process.