def test_LHCbsubmit(self):

        print "**********************************************************************************************************"

        gLogger.info(
            "\n Submitting hello world job targeting DIRAC.JobDebugger.cern")

        helloJ = LHCbJob()

        helloJ.setName("helloWorld-test-CERN")
        helloJ.setInputSandbox([
            find_all('exe-script.py', '..',
                     '/LHCbDIRAC/tests/System/GridTestSubmission')[0]
        ])
        helloJ.setExecutable("exe-script.py", "", "helloWorld.log")

        helloJ.setCPUTime(17800)
        helloJ.setDestination('DIRAC.JobDebugger.cern')
        result = self.dirac.submitJob(helloJ)
        gLogger.info("Hello world job: ", result)
        jobID = int(result['Value'])
        jobsSubmittedList.append(jobID)

        self.assertTrue(result['OK'])

        print "**********************************************************************************************************"

        gLogger.info("\n Submitting hello world job targeting slc6 machines")

        helloJ = LHCbJob()

        helloJ.setName("helloWorld-test-slc6")
        helloJ.setInputSandbox([
            find_all('exe-script.py', '.',
                     '/LHCbDIRAC/tests/System/GridTestSubmission')[0]
        ])
        helloJ.setExecutable("exe-script.py", "", "helloWorld.log")

        helloJ.setCPUTime(17800)
        helloJ.setPlatform('x86_64-slc6')
        result = self.dirac.submitJob(helloJ)
        gLogger.info("Hello world job: ", result)

        jobID = int(result['Value'])
        jobsSubmittedList.append(jobID)

        self.assertTrue(result['OK'])

        print "**********************************************************************************************************"

        gLogger.info("\n Submitting a job that uploads an output")

        helloJ = LHCbJob()

        helloJ.setName("upload-Output-test")
        helloJ.setInputSandbox( [find_all( 'testFileUpload.txt', '.',
                                           '/LHCbDIRAC/tests/System/GridTestSubmission' )[0]]\
                                            + [find_all( 'exe-script.py', '.',
                                                         '/LHCbDIRAC/tests/System/GridTestSubmission' )[0]] )
        helloJ.setExecutable("exe-script.py", "", "helloWorld.log")

        helloJ.setCPUTime(17800)
        helloJ.setDestination('DIRAC.JobDebugger.cern')

        helloJ.setOutputData(['testFileUpload.txt'])

        result = self.dirac.submitJob(helloJ)
        gLogger.info("Hello world with output: ", result)

        jobID = int(result['Value'])
        jobsSubmittedList.append(jobID)

        self.assertTrue(result['OK'])
Beispiel #2
0
#               "CLEO_K3PiScan_2014_pdf.root",
#               "CLEO_K3PiScan_2009_GaussianRise_pdf2.root",
#               "CLEO_KPiPi0Scan_2014_pdf.root",
#               "CLEO_KSKpiScan_2012_Kst_pdf.root"]

#  arg = "tot 1500000000 1";
  arg = "tot 500000000 1";



  j1 = LHCbJob()
  j1.setName('GammaDh.'+mode+'.'+str(i))
  j1.setExecutable('run_gamma_Dh.sh',arg,'gamma.log')
  j1.setInputSandbox(inputList)
  j1.setOutputSandbox(['*.root','__postprocesslocations__','std.out','std.err','*.log'])
  j1.setOutputData(['*.root'])
  j1.setCPUTime(172800)
  j1.setBannedSites(['LCG.CERN.ch', 'LCG.CNAF.it', 'LCG.GRIDKA.de', 'LCG.IN2P3.fr', 'LCG.NIKHEF.nl', 'LCG.PIC.es', 'LCG.RAL.uk', 'LCG.SARA.nl'])
 
  jobList.append({ 'Job' : j1, 'Name' : 'GammaDh.'+mode+'.'+str(i) })
  

#SPLITTING JOBLIST BY THREAD
nThread = int(10)
if len(jobList) < nThread: nThread = len(jobList)

njobsPerList = len(jobList)/nThread #Number of jobs to submit for each thread

jobListPerThread = [jobList[x:x+njobsPerList] for x in xrange(0, len(jobList), njobsPerList)]

if nThread < len(jobListPerThread):
Beispiel #3
0
gLogger.info("\n Submitting a job that uploads an output")

helloJ = LHCbJob()
dirac = DiracLHCb()

helloJ.setName("upload-Output-test")
helloJ.setInputSandbox([
    find_all('testFileUpload.txt', rootPath,
             '/tests/System/GridTestSubmission')[0]
])
helloJ.setExecutable("exe-script.py", "", "helloWorld.log")

helloJ.setCPUTime(17800)

helloJ.setOutputData(['testFileUpload.txt'])

result = dirac.submitJob(helloJ)
gLogger.info("Hello world with output: ", result)

########################################################################################

gLogger.info("\n Submitting a job that uploads an output and replicates it")

helloJ = LHCbJob()
dirac = DiracLHCb()

helloJ.setName("upload-Output-test-with-replication")
helloJ.setInputSandbox([
    find_all('testFileReplication.txt', rootPath,
             '/tests/System/GridTestSubmission')[0]