def METHOD_NAME(vm):
  """Get the MPI version on the vm, based on mpirun.
  Args:
    vm: the virtual machine to query
  Returns:
    A string containing the active MPI version,
    None if mpirun could not be found
  Raises:
    MpirunParseOutputError: if parsing fails.
  """
  stdout, _ = vm.RemoteCommand('mpirun --version', ignore_failure=True)
  if bool(stdout.rstrip()):
    regex = r'MPI\) (\S+)'
    match = re.search(regex, stdout)
    if not match:
      raise MpirunParseOutputError('Unable to parse mpirun version output')
    return str(match.group(1))
  else:
    return None