A program that simulates the of MPI:
public class Main { public static void main(String[] args) { int size = 4; for (int rank = 0; rank < size; rank++) { System.out.println("Hi, I am process " + rank + " out of " + size); } }}