indict=para.fcc_dic.replace('VERSION',version) inread=para.readfcc_dic.replace('VERSION',version) else: print 'unrecognized mode ',sys.argv[1],' possible values are FCC or LHE' sys.exit(3) if os.path.isfile(indict)==False: print 'dictonary does not exists ',indict sys.exit(3) inprocess='' if len(sys.argv)==3 and sys.argv[2]!='secret': inprocess=sys.argv[2] readdic=isr.isreading(inread, indict) readdic.backup('jobchecker') readdic.reading() mydict=None with open(indict) as f: mydict = json.load(f) firstprocess=True for s in mydict: evttot=0 njobs=0 print 'process ',s if inprocess!='': if inprocess!=s: continue
#!/usr/bin/env python import json, sys import glob, os, sys, subprocess, cPickle import commands import time import random import EventProducer.common.dicwriter as dicr import EventProducer.common.isreading as isr if sys.argv[1] == "secret": import EventProducer.config.param_test as para else: import EventProducer.config.param as para mydict = dicr.dicwriter(para.lhe_dic) readdic = isr.isreading(para.readlhe_dic, para.lhe_dic) eosbase = '/afs/cern.ch/project/eos/installation/0.3.84-aquamarine/bin/eos.select' #__________________________________________________________ def getCommandOutput(command): p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate() return {"stdout": stdout, "stderr": stderr, "returncode": p.returncode} #__________________________________________________________ def SubmitToBatch(cmd, nbtrials):
decay = options.decay version = options.version ninput = int(options.ninput) rundir = os.getcwd() nbjobsSub = 0 if version not in para.fcc_versions: print 'version of the cards should be: fcc_v01, cms' sys.exit(3) ############# fcc_dic = para.fcc_dic.replace('VERSION', version) readfcc_dic = para.readfcc_dic.replace('VERSION', version) outdict = dicr.dicwriter(fcc_dic) readdic = isr.isreading(readfcc_dic, fcc_dic) ############# delphescards_mmr = '%s%s/%s' % (para.delphescards_dir, version, para.delphescard_mmr) if eosexist(delphescards_mmr) == False and version != 'cms': print 'delphes card does not exist: ', delphescard_mmr sys.exit(3) delphescards_mr = '%s%s/%s' % (para.delphescards_dir, version, para.delphescard_mr) if eosexist(delphescards_mr) == False and version != 'cms': print 'delphes card does not exist: ', delphescard_mr sys.exit(3) delphescards_base = '%s%s/%s' % (para.delphescards_dir, version,