def convert(tree,fileName=None):
  """
    Converts input files to be compatible with merge request 191, where some
    of the less used mpi mode features were moved to mpilegacy
    @ In, tree, xml.etree.ElementTree.ElementTree object, the contents of a RAVEN input file
    @ In, fileName, the name for the raven input file
    @Out, tree, xml.etree.ElementTree.ElementTree object, the modified RAVEN input file
  """
  simulation = tree.getroot()
  runinfo = simulation.find('RunInfo')
  if runinfo is None:
    return tree #No RunInfo, no need to change.
  if runinfo.find('mode') is not None:
    mode = runinfo.find('mode')
    foundLegacy = False
    for child in mode:
      if child.tag.lower() == "nosplitnode":
        foundLegacy = True
      if child.tag.lower() == "limitnode":
        foundLegacy = True
    if foundLegacy and mode.text.strip() == "mpi":
      print("found mpi legacy features in mpi mode")
      mode.text = "mpilegacy"
  return tree