Compile-lime Optimization of Near-Neighbor Communication for Scalable Shared-Memory Multiprocessors