Minimization of Memory and Network Contention for Accessing Arbitrary Power-of-2 Data patterns