From Code to Performance

Exercise 5: MPI + OpenMP Performance Tuning

Objective:: Investigate how different thread/process combinations affect runtime.

Tasks:

  1. Modify your hybrid sum program to record timestamps using MPI_Wtime(). Run with varying configurations:
  1. Analyze the results to identify trends in performance. Consider factors like load balancing, communication overhead, and thread contention.
  2. MPI Ranks OpenMP Threads Expected Bahavior
    4 1 Baseline MPI only
    2 2 Hybrid moderate
    1 4 OpenMP only
    4 4 Fully hybrid​
    1. Collect runtimes and plot execution time vs. configurations.
    1. Discuss which configuration achieved the best performance and why (hint: consider NUMA and communication cost).

    Command to Practice

    export OMP_NUM_THREADS=, mpirun -np ./hybrid_sum