Added #ifdef USE_MPI everywhere MPI is used to make it optional.