move to c++ mpi functions, fix #1