Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions ShapeAnalysis/python/ShapeFactoryMulti.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,14 +1331,22 @@ def _test_sdfarm_File(self,path):
# _____________________________________________________________________________
def _test_xrootdFile(self, path):
xrdserver=path.lstrip("root://").split("/")[0]
cmd='xrd '+xrdserver+' existfile '+path.split('root://'+xrdserver)[1]
cmd='xrdfs '+xrdserver+' locate '+path.split('root://'+xrdserver)[1]
if os.system(cmd) == 0 : return True
return False
return False

# _____________________________________________________________________________
def _test_cmsdas_File(self, path):
cmd='ls '+path
if os.system(cmd) == 0 : return True
return False

# _____________________________________________________________________________
def _buildchain(self, multidraw, files, skipMissingFiles, friendtree=None, altDir=''):
def testFile(path):
if "eoscms.cern.ch" in path or "eosuser.cern.ch" in path:
if 'root://' in path:
exists = self._test_xrootdFile(path)
location = 'AAA'
elif "eoscms.cern.ch" in path or "eosuser.cern.ch" in path:
exists = self._testEosFile(path)
location = 'CERN'
elif "maite.iihe.ac.be" in path:
Expand All @@ -1351,9 +1359,9 @@ def testFile(path):
elif "sdfarm" in path:
exists = self._test_sdfarm_File(path)
location = 'sdfarm.kr'
elif 'root://' in path:
exists = self._test_xrootdFile(path)
location = 'AAA'
elif "cmsdas" in path:
exists = self._test_cmsdas_File(path)
location = 'cmsdas'
else:
exists = self._testLocalFile(path)
location = 'local'
Expand Down Expand Up @@ -1414,7 +1422,12 @@ def _geteventlists(self, listName, files):
for path in files:
doesFileExist = True
self._logger.debug(' '+str(os.path.exists(path))+' '+path)
if "eoscms.cern.ch" in path or "eosuser.cern.ch" in path:
if "root://" in path:
if not self._test_xrootdFile(path):
print 'File '+path+' doesn\'t exists @ AAA'
doesFileExist = False
raise RuntimeError('File '+path+' doesn\'t exists')
elif "eoscms.cern.ch" in path or "eosuser.cern.ch" in path:
if not self._testEosFile(path):
print 'File '+path+' doesn\'t exists'
doesFileExist = False
Expand All @@ -1426,6 +1439,10 @@ def _geteventlists(self, listName, files):
raise RuntimeError('File '+path+' doesn\'t exists')
elif "cluster142.knu.ac.kr" in path:
pass # already checked the file at mkShape.py
elif "cmsdas" in path:
if not self._test_cmsdas_File(path):
doesFileExist = False
raise RuntimeError('File '+path+' doesn\'t exists')
else:
if not os.path.exists(path):
print 'File '+path+' doesn\'t exists'
Expand Down
50 changes: 47 additions & 3 deletions Tools/python/batchTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ def __init__ (self,baseName,prodName,stepList,targetList,batchSplit,postFix='',u
jFile.write('#$ -cwd\n')

jFile.write('export X509_USER_PROXY=/afs/cern.ch/user/'+os.environ["USER"][:1]+'/'+os.environ["USER"]+'/.proxy\n')
elif "cmsdas" in hostName:
jFile.write('#$ -N '+jName+'\n')
jFile.write('export X509_USER_PROXY=/home/cmsdas/'+os.environ["USER"]+'/.proxy\n')
elif "pi.infn.it" in socket.getfqdn():
jFile.write('#$ -N '+jName+'\n')
jFile.write('export X509_USER_PROXY=/home/users/'+os.environ["USER"]+'/.proxy\n')
Expand All @@ -124,6 +127,8 @@ def __init__ (self,baseName,prodName,stepList,targetList,batchSplit,postFix='',u
jFile.write('export SCRAM_ARCH='+SCRAMARCH+'\n')
jFile.write('export VO_CMS_SW_DIR=/cvmfs/cms.cern.ch\n')
jFile.write('source $VO_CMS_SW_DIR/cmsset_default.sh\n')
if 'cmsdas' in hostName:
jFile.write('source /cvmfs/grid.cern.ch/etc/profile.d/setup-cvmfs-ui.sh\n')
jFile.write('cd '+CMSSW+'\n')
jFile.write('eval `scramv1 ru -sh`\n')
if 'knu' in hostName or 'hercules' in hostName:
Expand All @@ -141,7 +146,9 @@ def __init__ (self,baseName,prodName,stepList,targetList,batchSplit,postFix='',u
jFile.write("cd /tmp/$USER/$LSB_JOBID \n")

jFile.write("pwd \n")

elif 'cmsdas' in hostName:
jFile.write('cd - \n')
jFile.write("pwd \n")
elif "pi.infn.it" in socket.getfqdn():
jFile.write("mkdir /tmp/$LSB_JOBID \n")
jFile.write("cd /tmp/$LSB_JOBID \n")
Expand Down Expand Up @@ -268,8 +275,18 @@ def Sub(self,queue='longlunch',IiheWallTime='168:00:00',optTodo=False):
MaxRunTime = (runtimes[flavours.index(queue)] - 1) * 60

scheduler = 'condor'


if 'cmsdas' in hostName:
flavours = ['espresso', 'microcentury', 'longlunch', 'workday', 'tomorrow', 'testmatch', 'nextweek']
runtimes = [20, 60, 120, 60 * 8, 60 * 24, 60 * 24 * 3, 60 * 24 * 7]
if queue not in flavours:
print 'Queue', queue, 'is not defined for cmsdas HTCondor.'
print 'Allowed values:', flavours
raise RuntimeError('Undefined queue')

MaxRunTime = (runtimes[flavours.index(queue)] - 1) * 60

scheduler = 'condor'

for jName in self.jobsList:
if JOB_DIR_SPLIT and self.JOB_DIR_SPLIT_READY :
Expand Down Expand Up @@ -309,6 +326,24 @@ def Sub(self,queue='longlunch',IiheWallTime='168:00:00',optTodo=False):
jdsFile.close()
# We write the JDS file for documentation / resubmission, but initial submission will be done in one go below
# jobid=os.system('condor_submit '+jdsFileName+' > ' +jidFile)
elif 'cmsdas' in hostName:
jdsFileName=self.subDir+subDirExtra+'/'+jName+'.jds'
jdsFile = open(jdsFileName,'w')
jdsFile.write('executable = '+self.subDir+subDirExtra+'/'+jName+'.sh\n')
jdsFile.write('universe = vanilla\n')
#jdsFile.write('use_x509userproxy = true\n')
jdsFile.write('output = '+self.subDir+subDirExtra+'/'+jName+'.out\n')
jdsFile.write('error = '+self.subDir+subDirExtra+'/'+jName+'.err\n')
jdsFile.write('log = '+self.subDir+subDirExtra+'/'+jName+'.log\n')
if CONDOR_ACCOUNTING_GROUP:
jdsFile.write('+AccountingGroup = '+CONDOR_ACCOUNTING_GROUP+'\n')
jdsFile.write('accounting_group = '+CONDOR_ACCOUNTING_GROUP+'\n')
jdsFile.write('request_cpus = '+str(self.nThreads)+'\n')
jdsFile.write('+JobFlavour = "'+queue+'"\n')
jdsFile.write('queue\n')
jdsFile.close()
# We write the JDS file for documentation / resubmission, but initial submission will be done in one go below
# jobid=os.system('condor_submit '+jdsFileName+' > ' +jidFile)
elif 'iihe' in hostName:
queue='localgrid@cream02'
QSOPT='-l walltime='+IiheWallTime
Expand Down Expand Up @@ -579,7 +614,16 @@ def batchResub(Dir='ALL',queue='longlunch',requestCpus=1,IiheWallTime='168:00:00
MaxRunTime = (runtimes[flavours.index(queue)] - 1) * 60

scheduler = 'condor'

if 'cmsdas' in hostName:
flavours = ['espresso', 'microcentury', 'longlunch', 'workday', 'tomorrow', 'testmatch', 'nextweek']
runtimes = [20, 60, 120, 60 * 8, 60 * 24, 60 * 24 * 3, 60 * 24 * 7]
if queue not in flavours:
print 'Queue', queue, 'is not defined for cmsdas HTCondor.'
print 'Allowed values:', flavours
raise RuntimeError('Undefined queue')
MaxRunTime = (runtimes[flavours.index(queue)] - 1) * 60

scheduler = 'condor'

for iDir in DirList:
subDir = jobDir+'/'+iDir
Expand Down
Binary file added cratio_Zee_nvtx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.