def submit(self): print "Preparing task", self.taskName task=cesubmit.Task(self.taskName,directory = '/user/kuensken/tapasTasks/' + self.taskName,cmsswVersion=self.cmsswVersion, scramArch=self.scramArch) tempExe = ''' cmsRun $1 RET=$? if [ $RET -eq 0 ]; then echo "Finished execution"; else exit $RET; fi ''' tempFile = open('exec.sh','w') tempFile.write(tempExe) tempFile.close() task.executable=os.path.abspath('exec.sh') uploadurl = cesubmit.createAndUploadGridPack(['../../loader.C','../../hoTriggerAnalyzer'],self.gridPackName) task.addGridPack(uploadurl,extractdir="$CMSSW_BASE/src/HoMuonTrigger") for i in range(0,self.nJobs): job=cesubmit.Job() job.arguments.append('parallelConfig' + str(i) + '.py') job.inputfiles.append(os.path.abspath('configs/parallelConfig' + str(i) + '.py')) job.inputfiles.append(os.path.abspath('sources/sourceList' + str(i))) for file in self.additionalGridPackContents: job.inputfiles.append(os.path.abspath(file)) job.outputfiles.append("jobOutput" + str(i) + '.root') task.addJob(job) task.submit(6) print "[Done]"
def submit(self): print "Preparing task", self.taskName task = gridlib.ce.Task(name=self.taskName, storage_element=self.storage_element, delegation_id=self.get_delegation_id(), directory='/user/kuensken/tapasTasks/' + self.taskName) task.executable = 'exec.sh' task.executable_upload = False self.createTempExe() tarFileUrl = "{0}/{1}.tar.gz".format('gridpacks', self.taskName) execTarUrl = "{0}/{1}_exec.tar.gz".format('gridpacks', self.taskName) cesubmit.createAndUploadGridPack( ['../../loader.C', '../../hoTriggerAnalyzer'], tarFileUrl) cesubmit.createAndUploadGridPack('exec.sh', execTarUrl) gridPackUrl = os.path.join('/store/user', self.username_cern, tarFileUrl) execGridPackUrl = os.path.join('/store/user', self.username_cern, execTarUrl) task.add_gridpack(gridPackUrl, extract_dir="$CMSSW_BASE/src/HoMuonTrigger") task.add_gridpack(execGridPackUrl) for i in range(0, self.nJobs): job = task.create_job() job.arguments.append('parallelConfig' + str(i) + '.py') job.inputfiles.append( os.path.abspath('configs/parallelConfig' + str(i) + '.py')) job.inputfiles.append( os.path.abspath('sources/sourceList' + str(i))) for file in self.additionalGridPackContents: job.inputfiles.append(os.path.abspath(file)) job.outputfiles.append("jobOutput" + str(i) + '.root') task.submit(6) self.cleanup() print "[Done]"
def submit(self): print "Preparing task", self.taskName task = gridlib.ce.Task( name = self.taskName, storage_element = self.storage_element, delegation_id = self.get_delegation_id(), directory = '/user/kuensken/tapasTasks/' + self.taskName ) task.executable= 'exec.sh' task.executable_upload = False self.createTempExe() tarFileUrl = "{0}/{1}.tar.gz".format('gridpacks',self.taskName) execTarUrl = "{0}/{1}_exec.tar.gz".format('gridpacks',self.taskName) cesubmit.createAndUploadGridPack(['../../loader.C','../../hoTriggerAnalyzer'],tarFileUrl) cesubmit.createAndUploadGridPack('exec.sh',execTarUrl) gridPackUrl = os.path.join('/store/user',self.username_cern,tarFileUrl) execGridPackUrl = os.path.join('/store/user',self.username_cern,execTarUrl) task.add_gridpack(gridPackUrl,extract_dir="$CMSSW_BASE/src/HoMuonTrigger") task.add_gridpack(execGridPackUrl) for i in range(0,self.nJobs): job = task.create_job() job.arguments.append('parallelConfig' + str(i) + '.py') job.inputfiles.append(os.path.abspath('configs/parallelConfig' + str(i) + '.py')) job.inputfiles.append(os.path.abspath('sources/sourceList' + str(i))) for file in self.additionalGridPackContents: job.inputfiles.append(os.path.abspath(file)) job.outputfiles.append("jobOutput" + str(i) + '.root') task.submit(6) self.cleanup() print "[Done]"
def main(): name = "gridpacktest" print "Preparing task", name uploadurl = cesubmit.createAndUploadGridPack("zeros.sh", "gridpacks/gridpacktest/{createdatetime}.tar.gz") task = cesubmit.Task(name) task.addGridPack(uploadurl, extractdir="./") task.uploadexecutable=False task.executable="zeros.sh" task.copyResultsToDCache("zeros.txt", "test/{createdatetime}/zeros-{nodeid}_{runid}.txt") job=cesubmit.Job() task.addJob(job) task.submit(6) print "[Done]"
def main(): name = "gridpacktest" print "Preparing task", name uploadurl = cesubmit.createAndUploadGridPack( "zeros.sh", "gridpacks/gridpacktest/{createdatetime}.tar.gz") task = cesubmit.Task(name) task.addGridPack(uploadurl, extractdir="./") task.uploadexecutable = False task.executable = "zeros.sh" task.copyResultsToDCache( "zeros.txt", "test/{createdatetime}/zeros-{nodeid}_{runid}.txt") job = cesubmit.Job() task.addJob(job) task.submit(6) print "[Done]"