modified Lib.Mpi sample