Exemple #1
0
def createJob(workflow, cmssw_ver, arch):
  workflow_args = FixWFArgs(cmssw_ver, arch, workflow, GetMatrixOptions(cmssw_ver, arch))
  cmd = format("rm -rf %(workflow)s %(workflow)s_*; mkdir %(workflow)s; cd %(workflow)s; PATH=%(das_utils)s:$PATH runTheMatrix.py --maxSteps=0 -l %(workflow)s %(workflow_args)s",workflow=workflow,workflow_args=workflow_args, das_utils=CMS_BOT_DIR+"/das-utils")
  print "Running ",cmd
  getstatusoutput(cmd)
  try:
    workflow_dir = glob.glob(format("%(workflow)s/%(workflow)s_*", workflow=workflow))[0]
    getstatusoutput(format("mv %(workflow)s/runall-report-step123-.log %(workflow_dir)s/workflow.log; touch %(workflow_dir)s/cmdLog; mv %(workflow_dir)s .; rm -rf %(workflow)s", workflow=workflow, workflow_dir=workflow_dir))
    print "Commands for workflow %s generated" % workflow
  except Exception, e:
    print "ERROR: Creating workflow job:",workflow,str(e)
    getstatusoutput("rm -rf %s %s_*" % (workflow,workflow))
Exemple #2
0
if __name__ == "__main__":
  parser = OptionParser(usage="%prog -i|--id <jobid> -l|--list <list of workflows>")
  parser.add_option("-i", "--id",   dest="jobid", help="Job Id e.g. 1of3", default="1of1")
  parser.add_option("-l", "--list", dest="workflow", help="List of workflows to run e.g. 1.0,2.0,3.0", type=str, default=None)
  parser.add_option("-f", "--force",dest="force", help="Force running of workflows without checking the server for previous run", action="store_true", default=False)
  parser.add_option("-d", "--das-cache", dest="das_cache", help="Das cache file", type=str, default=None)
  opts, args = parser.parse_args()

  if len(args) > 0: parser.error("Too many/few arguments")
  if not opts.workflow: parser.error("Missing -l|--list <workflows> argument.")
  if (not environ.has_key("CMSSW_VERSION")) or (not environ.has_key("CMSSW_BASE")) or (not environ.has_key("SCRAM_ARCH")):
    print "ERROR: Unable to file the release environment, please make sure you have set the cmssw environment before calling this script"
    exit(1)

  thrds = cmsRunProcessCount
  if isThreaded(environ["CMSSW_VERSION"],environ["SCRAM_ARCH"]):
    print "Treaded IB Found"
    thrds=int(MachineMemoryGB/5)
  elif "fc22_" in environ["SCRAM_ARCH"]:
    print "FC22 IB Found"
    thrds=int(MachineMemoryGB/4)
  else:
    print "Normal IB Found"
  if thrds>cmsRunProcessCount: thrds=cmsRunProcessCount

  matrix = PyRelValsThread(thrds, environ["CMSSW_BASE"]+"/pyRelval", opts.jobid)
  matrix.setArgs(GetMatrixOptions(environ["CMSSW_VERSION"],environ["SCRAM_ARCH"], opts.das_cache))
  matrix.run_workflows(opts.workflow.split(","),LogUpdater(environ["CMSSW_BASE"]),opts.force)

Exemple #3
0
import sys
import json
from os import environ
from os.path import exists
from RelValArgs import GetMatrixOptions
from runPyRelValThread import PyRelValsThread, splitWorkflows
from cmsutils import doCmd
print "Diving workflows"
workdir = sys.argv[1]
RelValtimes = sys.argv[2]
print RelValtimes
try:
    max_wf = int(sys.argv[3])
except:
    max_wf = 100
relval_args = GetMatrixOptions(environ["CMSSW_VERSION"], environ["SCRAM_ARCH"])
if 'RELVAL_WORKFLOWS' in environ:
    relval_args = relval_args + ' ' + environ["RELVAL_WORKFLOWS"]
matrix = PyRelValsThread(1, environ["CMSSW_BASE"])
workflows = matrix.getWorkFlows(relval_args)
if exists(RelValtimes):
    owf = []
    max_tm = 0
    with open(RelValtimes) as json_file:
        try:
            json_data = json.load(json_file)
        except:
            print "Error reading RelVal Times"
            json_data = {"avg": []}
        for tm_str in sorted(json_data["avg"], key=int, reverse=True):
            tm = int(tm_str)
Exemple #4
0
                shell=True)

        e = waitpid(p.pid, 0)[1]
        print("Time took to create jobs:", int(time() - stime), "sec")
        system("touch " + cmssw_base + "/done." + opts.jobid)
        if logger:
            logger.updateRelValMatrixPartialLogs(cmssw_base,
                                                 "done." + opts.jobid)
        exit(e)

    if isThreaded(cmssw_ver, arch):
        print("Threaded IB Found")
        thrds = int(MachineMemoryGB / 4.5)
        if thrds == 0: thrds = 1
    elif "fc24_ppc64le_" in arch:
        print("FC22 IB Found")
        thrds = int(MachineMemoryGB / 4)
    elif "fc24_ppc64le_" in arch:
        print("CentOS 7.2 + PPC64LE Found")
        thrds = int(MachineMemoryGB / 3)
    else:
        print("Normal IB Found")
    if thrds > cmsRunProcessCount: thrds = cmsRunProcessCount
    known_errs = get_known_errors(cmssw_ver, arch, "relvals")
    matrix = PyRelValsThread(thrds, cmssw_base + "/pyRelval", opts.jobid)
    matrix.setArgs(GetMatrixOptions(cmssw_ver, arch))
    matrix.run_workflows(opts.workflow.split(","),
                         logger,
                         opts.force,
                         known_errors=known_errs)
Exemple #5
0
#!/bin/bash
""":"
python_cmd="python3"
python -V >/dev/null 2>&1 && python_cmd="python"
exec ${python_cmd} $0 ${1+"$@"}
"""

from __future__ import print_function
import os, sys
BOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
sys.path.insert(0, BOT_DIR)
from _py2with3compatibility import run_cmd
from cmsutils import MachineCPUCount
from RelValArgs import GetMatrixOptions

os.environ["PATH"] = "%s/das-utils:%s" % (BOT_DIR, os.environ["PATH"])
cmd = "runTheMatrix.py -j %s --maxSteps=0 %s" % (
    MachineCPUCount,
    GetMatrixOptions(os.environ["CMSSW_VERSION"], os.environ["SCRAM_ARCH"]))
print("Running ", cmd)
e, o = run_cmd(cmd)
print(o)
if e:
    sys.exit(1)