def testCall(self): time.sleep(0.5) import mapreduce M = mapreduce.zeros() res = op.context.pull(np.ndarray, M) self.assertTrue(np.linalg.norm(res) < 1e-5) M = mapreduce.create_dist_array() res = op.context.pull(np.ndarray, M)
def testMatMul(self): time.sleep(1.0) print "starting computation" import matmul import mapreduce M = mapreduce.create_dist_array() res = matmul.matrix_multiply(M, M) A = op.context.assemble(M) B = op.context.assemble(res) self.assertTrue(np.linalg.norm(A.dot(A) - B) <= 1e-4)