def METHOD_NAME(vm):
  """Changes system settings for optimal Intel MPI conditions.
  Sets the ptrace_scope to 0, for details see:
    https://www.kernel.org/doc/Documentation/security/Yama.txt
  Args:
    vm: The virtual machine to run on.
  """
  if not vm.TryRemoteCommand('ulimit -l | grep unlimited'):
    ulimit_fix_cmd = (f'echo "{vm.user_name} - memlock unlimited" | '
                      'sudo tee -a /etc/security/limits.conf')
    vm.RemoteCommand(ulimit_fix_cmd)
    logging.info('Rebooting to permamently set ulimit')
    vm.Reboot()
    vm.WaitForBootCompletion()
  _, stderr, exitcode = vm.RemoteCommandWithReturnCode(
      'sudo sysctl -w kernel.yama.ptrace_scope=0', ignore_failure=True)
  if exitcode:
    logging.info('Not setting yama ptrace as %s', stderr)