From Serial Loops to Parallel Execution on Distributed Systems