mpi: Add internal convenience function.