From Code to Performance

Exercise 8: Data Decomposition in MPI

Objective: Explore data decomposition strategies in MPI. Understand domain decomposition and its impact on parallel performance.

Tasks:

  1. 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.
  1. Split the array evenly across MPI ranks.
  1. Each rank squares its segment.
  1. Use MPI_Gather to 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.
  1. Implement a simple matrix multiplication using MPI with domain decomposition.
  1. Measure which decomposition pattern gives better performance.

Bonus: Visualize rank boundaries using a simple ASCII output per process.