def METHOD_NAME(seriesname,simname,tmplfile,maxLevel,maxCoarseSize, simplesweeps, simplerelax, usesimplec, coarsesimplesweeps, coarsesimplerelax, coarseusesimplec, relsmootype, relsmooiter, relsmoodamp, schursmootype, schursmoofill, procs, jobfile):
  # generate filenames
  filename_out = seriesname + simname + "_" + str(simplesweeps) + "Simple" + str(simplerelax) + "_" + str(coarsesimplesweeps) + str(usesimplec) + "Simple" + str(coarsesimplerelax) + str(coarseusesimplec) + "_" + str(relsmootype) + str(relsmooiter) + str(relsmoodamp) + "_" + str(schursmootype) + str(schursmoofill) + "_maxL" + str(maxLevel) + "_maxCoarseSize" + str(maxCoarseSize) + "_" + str(procs) + "proc"  
  if (relsmootype == "SGS"):
    relsmootype = "Symmetric Gauss-Seidel"
  elif (relsmootype == "GS"):
    relsmootype = "Gauss-Seidel"
  elif (relsmootype == "JAC"):
    relsmootype = "Jacobi"
  # generate filenames
  filename_log  = filename_out + ".log"     
  filename_xml  = filename_out + ".xml"
  # generate XML file for pre_exodus
  if os.path.isfile(filename_xml):
    os.remove(filename_xml)
  o = open(filename_xml,"a")
  for line in open(tmplfile):
    line = line.replace("$MAXLEVEL", str(maxLevel))
    line = line.replace("$MAXCOARSESIZE", str(maxCoarseSize))
    line = line.replace("$RELSMOOTYPE", str(relsmootype))
    line = line.replace("$RELSMOOITER", str(relsmooiter))
    line = line.replace("$RELSMOODAMP", str(relsmoodamp))
    line = line.replace("$SCHURSMOOTYPE", str(schursmootype))
    line = line.replace("$SCHURSMOOFILL", str(schursmoofill))
    line = line.replace("$COARSESIMPLESWEEPS", str(coarsesimplesweeps))
    line = line.replace("$COARSESIMPLERELAX", str(coarsesimplerelax))
    line = line.replace("$COARSEUSESIMPLEC", str(coarseusesimplec))
    line = line.replace("$SIMPLESWEEPS", str(simplesweeps))
    line = line.replace("$SIMPLERELAX", str(simplesweeps))
    line = line.replace("$USESIMPLEC", str(usesimplec))
    o.write(line)
  o.close()
  jobfile.write("mpirun -np " + str(procs) + " ./MueLu_CradaDriver.exe --xml=" + filename_xml + " --split=1 --thyra=0  --matrixfile=grid_50_50_30/A0.m --rhsfile=grid_50_50_30/b0.m --coordinatesfile=grid_50_50_30/coordinates.m --specialfile=grid_50_50_30/special.m --nspfile= --linAlgebra=Epetra --tol=1e-10 --maxits=150 --output=" + filename_out + " | tee " + filename_out + ".txt\n\n\n")