def doStartupChecks(): global doStartFromPAT log.output("********** Checking environment **********") log.output("--> Checking if you have a "+options.cmssw_ver+" release.") if (os.path.isdir(options.cmssw_ver)): log.output(" ---> Ok, the release is present!") cmd ='cd '+options.cmssw_ver+'; cmsenv' pExe = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) else: log.output(" ---> ERROR: Please scram the proper release first! (Exiting)") dieOnError("Environment: resquested CMSSW version is not found in the working directory") log.output("--> Checking if "+options.cmssw_ver+" contains the TopTreeProducer package.") if (os.path.isdir(options.cmssw_ver+TopTreeProducerDir)): log.output(" ---> Ok, the "+TopTreeProducerDir+" directory exists!") else: log.output(" ---> ERROR: Please ensure that you have the TopTreeProducer package installed! (Exiting)") dieOnError("Environment: resquested CMSSW version does not contain the TopTreeProducer package") log.output("--> Checking if "+options.cmssw_ver+" contains the PatAlgos package.") if (os.path.isdir(options.cmssw_ver+PatDir)): log.output(" ---> Ok, the "+PatDir+" directory exists!") else: log.output(" ---> ERROR: Please ensure that you have the PatAlgos package installed! (Exiting)") dieOnError("Environment: resquested CMSSW version does not contain the PatAlgos package") log.output("--> Checking DBS to see wether the requested Dataset exists") if dbsInst == "": dbsMgr = DBSHandler("cms_dbs_prod_global"); else: dbsMgr = DBSHandler(dbsInst); if doStartFromPAT: dbsMgr.setDBSInst("cms_dbs_ph_analysis_02") if not dbsMgr.datasetExists(options.dataset): log.output(" ---> ERROR: "+options.dataset+" was not found in DBS! (Exiting)") dieOnError("Dataset: DBS query for your dataset returned an empty set.") else: log.output(" ---> Ok, Dataset was found!") log.output("--> Checking status of CRABServer (not yet implemented)") crab = CRABHandler("","","",log) crab.checkGridProxy(False) crab.checkCredentials(False)
################## log.output("--------------------------------------------") log.output("--> Automated FAST SIMULATION production <--") log.output("--------------------------------------------") # display input options and do consistency checks inputSummary() # check GRID proxy crab = CRABHandler("", "", log) crab.checkGridProxy(False) crab.checkCredentials(False) # create working directories if not cmssw_sim == "": workingDir_sim = setupDirs(cmssw_sim + "/src", "GEN-FASTSIM_" + publish_sim) processGENFASTSIM() if not options.dryRun: updateTopDB("GENFASTSIM") if not doDry: announceDataSet() log.output("********* END OF SCRIPT *********")
################## log.output("--------------------------------------------") log.output("--> Automated FAST SIMULATION production <--") log.output("--------------------------------------------") # display input options and do consistency checks inputSummary() # check GRID proxy crab = CRABHandler("", "", log) crab.checkGridProxy(False) crab.checkCredentials(False) # create working directories if not cmssw_sim == "": workingDir_sim = setupDirs(cmssw_sim + "/src", "GEN-FASTSIM_" + publish_sim) processGENFASTSIM() if not options.dryRun: updateTopDB("GENFASTSIM") if not doDry: announceDataSet()
crab = CRABHandler(timestamp, options.dir, log) # change idle time crab.idleTime = float(options.idleTime) crab.idleTimeResubmit = float(options.idleTimeResubmit) # set the crab env crab.crabSource = "source /etc/profile.d/set_globus_tcp_port_range.sh; export EDG_WL_LOCATION=/opt/edg " # check GRID proxy crab.checkGridProxy(0) crab.checkCredentials(0) # check setup toCheck = ["scram", "crab"] for i in toCheck: log.output("--> Checking if you have " + i + " in your path") check = Popen("which " + i, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True).stdout.read() if not check.rfind("no " + i + " in") == -1:
crab = CRABHandler(timestamp,options.dir,log) # change idle time crab.idleTime=float(options.idleTime) crab.idleTimeResubmit=float(options.idleTimeResubmit) # set the crab env crab.crabSource = "source /etc/profile.d/set_globus_tcp_port_range.sh; export EDG_WL_LOCATION=/opt/edg " # check GRID proxy crab.checkGridProxy(0) crab.checkCredentials(0) # check setup toCheck = ["scram","crab"] for i in toCheck: log.output("--> Checking if you have "+i+" in your path") check = Popen("which "+i, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True).stdout.read() if not check.rfind("no "+i+" in") == -1: log.output(" ---> ERROR: you don't have "+i+" in your path, did you read the twiki instructions?") if options.stdout: print "Fatal ERROR, script exiting" else:
def doStartupChecks(): global doStartFromPAT log.output("********** Checking environment **********") log.output("--> Checking if you have a " + options.cmssw_ver + " release.") if (os.path.isdir(options.cmssw_ver)): log.output(" ---> Ok, the release is present!") cmd = 'cd ' + options.cmssw_ver + '; cmsenv' pExe = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) else: log.output( " ---> ERROR: Please scram the proper release first! (Exiting)") dieOnError( "Environment: resquested CMSSW version is not found in the working directory" ) log.output("--> Checking if " + options.cmssw_ver + " contains the TopTreeProducer package.") if (os.path.isdir(options.cmssw_ver + TopTreeProducerDir)): log.output(" ---> Ok, the " + TopTreeProducerDir + " directory exists!") else: log.output( " ---> ERROR: Please ensure that you have the TopTreeProducer package installed! (Exiting)" ) dieOnError( "Environment: resquested CMSSW version does not contain the TopTreeProducer package" ) log.output("--> Checking if " + options.cmssw_ver + " contains the PatAlgos package.") if (os.path.isdir(options.cmssw_ver + PatDir)): log.output(" ---> Ok, the " + PatDir + " directory exists!") else: log.output( " ---> ERROR: Please ensure that you have the PatAlgos package installed! (Exiting)" ) dieOnError( "Environment: resquested CMSSW version does not contain the PatAlgos package" ) log.output("--> Checking DBS to see wether the requested Dataset exists") if dbsInst == "": dbsMgr = DBSHandler("cms_dbs_prod_global") else: dbsMgr = DBSHandler(dbsInst) if doStartFromPAT: dbsMgr.setDBSInst("cms_dbs_ph_analysis_02") if not dbsMgr.datasetExists(options.dataset): log.output(" ---> ERROR: " + options.dataset + " was not found in DBS! (Exiting)") dieOnError( "Dataset: DBS query for your dataset returned an empty set.") else: log.output(" ---> Ok, Dataset was found!") log.output("--> Checking status of CRABServer (not yet implemented)") crab = CRABHandler("", "", "", log) crab.checkGridProxy(False) crab.checkCredentials(False)