P3M: a Virtual Machine Approach to Massively Parallel Computation