Primitives for Problems using Hierarchical Algorithms on Distributed Memory Machines