MPI leader election for distributed systems