Exemple #1
0
    #if found newer fills, store  in mem fill number
    #reprocess anyway the last 1 fill in the dir
    #redo specific lumi for all marked fills
    ##    
    svc=sessionManager.sessionManager(options.connect,authpath=options.authpath,debugON=options.debug)
    session=svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])

    fillstoprocess=[]
    maxfillnum=options.maxfill
    minfillnum=options.minfill
    if options.fillnum is not None: #if process a specific single fill
        fillstoprocess.append(int(options.fillnum))
    else:
        session.transaction().start(True)
        schema=session.nominalSchema()
        allfillsFromDB=lumiCalcAPI.fillInRange(schema,fillmin=minfillnum,fillmax=maxfillnum,amodetag=options.amodetag)
        processedfills=listfilldir(options.outputdir)
        lastcompletedFill=lastcompleteFill(os.path.join(options.inputdir,'runtofill_dqm.txt'))
        for pf in processedfills:
            if pf>lastcompletedFill:
                print('\tremove unfinished fill from processed list ',pf)
                processedfills.remove(pf)
        for fill in allfillsFromDB:
            if fill not in processedfills :
                if int(fill)<=lastcompletedFill:
                    if int(fill)>minfillnum and int(fill)<maxfillnum:
                        fillstoprocess.append(fill)
                else:
                    print('ongoing fill...',fill)
        session.transaction().commit()
    print('fills to process : ',fillstoprocess)
 dbname = options.connect
 authdir = options.authpath
 if options.fillnum is not None:  #if process a specific single fill
     fillstoprocess.append(int(options.fillnum))
 else:  #if process fills automatically
     svc = sessionManager.sessionManager(options.connect,
                                         authpath=options.authpath,
                                         debugON=options.debug)
     session = svc.openSession(isReadOnly=True,
                               cpp2sqltype=[('unsigned int', 'NUMBER(10)'),
                                            ('unsigned long long',
                                             'NUMBER(20)')])
     session.transaction().start(True)
     schema = session.nominalSchema()
     allfillsFromDB = lumiCalcAPI.fillInRange(schema,
                                              fillmin=MINFILL,
                                              fillmax=maxfillnum,
                                              amodetag=options.amodetag)
     session.transaction().commit()
     processedfills = listfilldir(options.outputdir)
     lastcompletedFill = lastcompleteFill(
         os.path.join(options.inputdir, 'runtofill_dqm.txt'))
     for pf in processedfills:
         if pf > lastcompletedFill:
             print '\tremove unfinished fill from processed list ', pf
             processedfills.remove(pf)
     for fill in allfillsFromDB:
         if fill not in processedfills:
             if int(fill) <= lastcompletedFill:
                 if int(fill) > MINFILL:
                     fillstoprocess.append(fill)
             else:
Exemple #3
0
                        action='store_true',
                        help='debug')
    options = parser.parse_args()
    if options.authpath:
        os.environ['CORAL_AUTH_PATH'] = options.authpath
    svc = sessionManager.sessionManager(options.connect,
                                        authpath=options.authpath,
                                        debugON=options.debug)
    session = svc.openSession(isReadOnly=True,
                              cpp2sqltype=[('unsigned int', 'NUMBER(10)'),
                                           ('unsigned long long', 'NUMBER(20)')
                                           ])

    session.transaction().start(True)
    allfills = lumiCalcAPI.fillInRange(session.nominalSchema(),
                                       fillmin=options.minfill,
                                       fillmax=options.maxfill,
                                       amodetag=options.amodetag)
    if len(allfills) == 0:
        print 'no qualified fills found, do nothing... '
        exit(-1)
    allfills.sort()
    runsperfill = {}
    runtimes = {}
    irunlsdict = {}
    if options.fillnum:
        if int(options.fillnum) in allfills:
            runsperfill = lumiCalcAPI.fillrunMap(session.nominalSchema(),
                                                 fillnum=int(options.fillnum))
            allruns = runsperfill[int(options.fillnum)]
            allls = [None] * len(allruns)
            irunlsdict = dict(list(zip(allruns, allls)))
Exemple #4
0
                     type=int,
                     action='store',
                     required=False,
                     default=MAXFILL,
                     help='maximum fillnumber '
                     )
 parser.add_argument('-siteconfpath',dest='siteconfpath',action='store',help='specific path to site-local-config.xml file, optional. If path undefined, fallback to cern proxy&server')
 parser.add_argument('--debug',dest='debug',action='store_true',help='debug')
 options=parser.parse_args()
 if options.authpath:
     os.environ['CORAL_AUTH_PATH'] = options.authpath
 svc=sessionManager.sessionManager(options.connect,authpath=options.authpath,debugON=options.debug)
 session=svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])
     
 session.transaction().start(True)
 allfills=lumiCalcAPI.fillInRange(session.nominalSchema(),fillmin=options.minfill,fillmax=options.maxfill,amodetag=options.amodetag)
 if len(allfills)==0:
     print 'no qualified fills found, do nothing... '
     exit(-1)
 allfills.sort()
 runsperfill={}
 runtimes={}
 irunlsdict={}
 if options.fillnum:
     if int(options.fillnum) in allfills:
         runsperfill=lumiCalcAPI.fillrunMap(session.nominalSchema(),fillnum=int(options.fillnum))
         allruns=runsperfill[ int(options.fillnum) ]
         allls=[None]*len(allruns)
         irunlsdict=dict(list(zip(allruns,allls)))
         runresults=lumiCalcAPI.runsummary(session.nominalSchema(),irunlsdict)
         for r in runresults:
Exemple #5
0
 options=parser.parse_args()
 
 allfillsFromFile=[]
 fillstoprocess=[]
 minfillnum=1700
 maxfillnum=None
 summaryfilename='_summary_CMS.txt'
 dbname=options.connect
 authdir=options.authpath
 if options.fillnum is not None: #if process a specific single fill
     fillstoprocess.append(int(options.fillnum))
 else: #if process fills automatically
     session.transaction().start(True)
     schema=session.nominalSchema()
     schema.transaction().start(True)
     allfillsFromDB=lumiCalcAPI.fillInRange(schema,minfillnum,maxfillnum)
     processedfills=listfilldir(options.outputdir)
     lastcompletedFill=lastcompleteFill(os.path.join(options.inputdir,'runtofill_dqm.txt'))
     print 'last complete fill : ',lastcompletedFill
     print 'processedfills in '+options.outputdir+' ',processedfills
     for pf in processedfills:
         if pf>lastcompletedFill:
             print '\tremove unfinished fill from processed list ',pf
             processedfills.remove(pf)
     print 'final processed fills : ',sorted(processedfills)
     for fill in allfillsFromDB:
         if fill not in processedfills :
             if fill<=lastcompletedFill:
                 #print 'fill less than last complet fill ',fill
                 if fill>minfillnum:
                     fillstoprocess.append(fill)