Implemented the Barnes–Hut algorithm to approximate gravitational forces in O(N log N) time. To handle distributed workloads, I utilized a coordinator-worker pattern leveraging MPI for inter-node communication.

Spatial Data Structures: Particles are stored in a spatial quadtree where internal nodes store aggregate mass and center-of-mass data.

Locality Optimization: Computed Hilbert ordering of particle indices to group spatially close particles into contiguous ranges, significantly improving cache locality and reducing communication overhead.

Collective Communication: Managed data distribution and updates using MPI_Scatterv and MPI_Allgatherv to ensure synchronized state across the cluster.

Performance Tuning: Balanced the Multipole Acceptance Criterion (MAC) to maintain high accuracy while maximizing computational throughput.