Efficient execution replay technique for distributed memory architectures