1. A non-transitory computer readable storage medium comprising computer readable program instructions for: storing a three-dimensional N×N×N matrix in a distributed memory network comprising a plurality of nodes, where there exists a mapping of the nodes onto the three-dimensional array of dimension Px×Py×Pz such that every node can be assigned a coordinate (px, py, pz); using a control node for distributing work associated with a calculation of a transform of the three-dimensional matrix among N 2 of the plurality of nodes; wherein distributing the work comprises: allocating to each node points in the matrix corresponding to a specific set of x, y values, wherein a point (x, y, z) in the matrix is assigned to the node coordinates (px, py, pz) according to the mapping selected from: the mapping where px=floor(x/nx), py=floor(y/ny), pz=floor((dy+ny dx)Pz/(nx ny)); and the mapping where px and py are the same, but pz=floor((dx+nx dy)Pz/(nx ny)); where nx is defined as Nx/Px, dx is defined as x-floor(x/nx) nx and similarly for ny, dy and nz, dz and floor(x) is defined as the greatest integer less than or equal to x; and receiving results of the calculation of the transform of the matrix by the nodes.