- Aalyan Raza
- Aashir Hameed
- Najam Hassan
This projects covers Phase 2 of the project focused on implementing a parallel Single Source Shortest Path (SSSP) algorithm using MPI and OpenMP. The goal was to enhance scalability and efficiency when operating over large graphs.
Key Technologies Used:
- π§ METIS for graph partitioning
- π Intel VTune Profiler for performance analysis
- π Hybrid MPI + OpenMP parallelization
# Transforms raw Facebook edge list CSV β weighted graph
# Features:
# - Random weights (1-10) assignment
# - METIS-compatible format generationPurpose: Converts raw Facebook edge list CSV into a weighted graph (graph.txt) with random weights (1β10) assigned to each edge. This format is necessary for METIS and parallel processing.
Using METIS, the graph is partitioned into multiple subgraphs, each assigned to an MPI process.
Output Files per Process:
subgraph_<rank>.txtβ Local edgessubgraph_<rank>_nodes.txtβ Local and ghost nodes
Simulates dynamic graph behavior by generating:
- β Insertions
- β Deletions
All changes saved in changes.txt for processing.
Implements the core SSSP algorithm using distributed-memory parallelism (MPI) combined with shared-memory parallelism (OpenMP).
- Hybrid Parallelism: MPI + OpenMP
- Ghost Node Message Passing: Inter-process communication
- Edge Relaxation: Via
relax_edges_distributed() - Dynamic Updates: Edge insertions/deletions handling
- π Apply edge updates
- π― Initialize distances
- π Iteratively relax edges
- π‘ Sync ghost nodes across ranks
Visualizes the resulting SSSP tree from sssp_output.txt and exports it as sssp_graph.png.
| Challenge | Description | Solution |
|---|---|---|
| π Data Duplication | Preventing double-counting during edge insertions | Implemented deduplication checks |
| π MPI Sync Bugs | Ensuring correct ghost vertex updates without message loss | Added robust synchronization barriers |
| βοΈ Partition Balance | Handling imbalance in METIS output partitions | Manual tuning and load monitoring |
| π₯ CPU Utilization | Optimizing OpenMP loop schedules | Experimented with different scheduling strategies |
Performance measured using Intel VTune Profiler for:
- β±οΈ Elapsed time
- π₯οΈ CPU time
- π§΅ Thread utilization
- π― Hotspot identification
π Performance Metrics:
βββ Elapsed Time: 20.235s
βββ CPU Time: 72.390s
βββ Parallelism: Poor (underutilized threads)
Observations: All threads mostly underutilized, indicating poor parallelism in baseline implementation.
π Performance Metrics:
βββ Elapsed Time: 11.451s β¬οΈ (43% improvement)
βββ CPU Time: 36.190s β¬οΈ (50% improvement)
βββ Parallelism: Improved (3-4 logical CPUs peak)
π Performance Metrics:
βββ Elapsed Time: 11.904s
βββ CPU Time: 36.840s
βββ Parallelism: Moderate scaling
Note: Limited benefit over 12-thread configuration indicates scaling bottlenecks.
π Performance Metrics:
βββ Elapsed Time: 13.151s β¬οΈ (Performance degradation)
βββ CPU Time: 40.508s β¬οΈ
βββ Hotspots: Identified in relax_edges_distributed
π Performance Metrics:
βββ Elapsed Time: 5.990s β¬οΈ (Best performance)
βββ CPU Time: 31.390s β¬οΈ
βββ Parallelism: ~8 logical CPUs utilization
π Best Configuration: Achieved optimal balance between thread count and CPU utilization.
| Configuration | Threads | Elapsed Time | CPU Time | Parallel Efficiency |
|---|---|---|---|---|
| Serial | 1 | 20.235s | 72.390s | - |
| MPI+OpenMP | 12 | 11.451s | 36.190s | ~43% |
| MPI+OpenMP | 20 | 11.904s | 36.840s | ~41% |
| MPI+OpenMP | 28 | 13.151s | 40.508s | ~35% |
| MPI+OpenMP | 56 | 5.990s | 31.390s | ~65% |
π Key Insight: Parallel efficiency improved up to 65% with higher thread counts, showing strong scaling behavior.

- π METIS Integration: Successful graph partitioning with improved load distribution
- β‘ Hybrid Parallelism: MPI+OpenMP significantly reduced execution time vs. serial
- π Performance Analysis: VTune identified thread imbalance and optimization opportunities
- π― Bottleneck Identification: Main bottleneck in
relax_edges_distributedfunction
- π 3.4x speedup (20.235s β 5.990s) with optimal configuration
- πͺ 65% parallel efficiency achieved with 56 threads
- π₯ Hotspot optimization improved CPU utilization patterns
- METIS partitioning requires manual tuning for optimal results
- Thread scaling benefits plateau around 56 threads for this workload
- Ghost node synchronization critical for correctness
- π₯οΈ GPU Acceleration: Use OpenCL for offloading compute-heavy sections
- βοΈ Dynamic Load Balancing: Integrate adaptive balancing for uneven subgraph sizes
- π‘ Async Communication: Explore asynchronous models to hide MPI latency
- π§ Machine Learning: Predict optimal partitioning strategies
- π Pipeline Parallelism: Overlap computation and communication phases
- π Memory Optimization: Reduce memory footprint for larger graphs
- βοΈ Cloud Deployment: Scale to distributed cloud environments
- π Benchmarking Suite: Comprehensive performance testing framework
- π§ Auto-tuning: Automatic parameter optimization based on graph characteristics
Environment:
- Language: C++, Python
- Parallelization: MPI + OpenMP
- Profiling: Intel VTune Profiler
- Partitioning: METIS Library
- Visualization: Python matplotlib
Performance Metrics:
- Best Speedup: 3.4x
- Optimal Threads: 56
- Parallel Efficiency: 65%
- Primary Bottleneck: Edge relaxation









