Beispiel #1
0
        job.setState(["stagein", 0, 0])
        # send the special setup string back to the pilot (needed for the log transfer on xrdcp systems)
        rt = RunJobUtilities.updatePilotServer(job, runJob.getPilotServer(),
                                               runJob.getPilotPort())

        # stage-in .........................................................................................

        # update the job state file
        job.jobState = "stagein"
        #_retjs = JR.updateJobStateTest(job, jobSite, node, mode="test")

        # update copysetup[in] for production jobs if brokerage has decided that remote I/O should be used
        if job.transferType == 'direct':
            tolog('Brokerage has set transfer type to \"%s\" (remote I/O will be attempted for input files, any special access mode will be ignored)' %\
                  (job.transferType))
            RunJobUtilities.updateCopysetups('', transferType=job.transferType)

        # stage-in all input files (if necessary)
        job, ins, statusPFCTurl, usedFAXandDirectIO = runJob.stageIn(
            job, jobSite, analysisJob)
        if job.result[2] != 0:
            tolog("Failing job with ec: %d" % (ec))
            runJob.failJob(0,
                           job.result[2],
                           job,
                           ins=ins,
                           pilotErrorDiag=job.pilotErrorDiag)

        # after stageIn, all file transfer modes are known (copy_to_scratch, file_stager, remote_io)
        # consult the FileState file dictionary if cmd3 should be updated (--directIn should not be set if all
        # remote_io modes have been changed to copy_to_scratch as can happen with ByteStream files)
Beispiel #2
0
        tolog("Setting stage-in state until all input files have been copied")
        job.setState(["stagein", 0, 0])
        # send the special setup string back to the pilot (needed for the log transfer on xrdcp systems)
        rt = RunJobUtilities.updatePilotServer(job, runJob.getPilotServer(), runJob.getPilotPort())

        # stage-in .........................................................................................

        # update the job state file
        job.jobState = "stagein"
        #_retjs = JR.updateJobStateTest(job, jobSite, node, mode="test")

        # update copysetup[in] for production jobs if brokerage has decided that remote I/O should be used
        if job.transferType == 'direct':
            tolog('Brokerage has set transfer type to \"%s\" (remote I/O will be attempted for input files, any special access mode will be ignored)' %\
                  (job.transferType))
            RunJobUtilities.updateCopysetups('', transferType=job.transferType)

        # stage-in all input files (if necessary)
        job, ins, statusPFCTurl, usedFAXandDirectIO = runJob.stageIn(job, jobSite, analysisJob)
        if job.result[2] != 0:
            tolog("Failing job with ec: %d" % (ec))
            runJob.failJob(0, job.result[2], job, ins=ins, pilotErrorDiag=job.pilotErrorDiag)

        # after stageIn, all file transfer modes are known (copy_to_scratch, file_stager, remote_io)
        # consult the FileState file dictionary if cmd3 should be updated (--directIn should not be set if all
        # remote_io modes have been changed to copy_to_scratch as can happen with ByteStream files)
        # and update the run command list if necessary.
        # in addition to the above, if FAX is used as a primary site mover and direct access is enabled, then
        # the run command should not contain the --oldPrefix, --newPrefix, --lfcHost options but use --usePFCTurl
        hasInput = job.inFiles != ['']
        if hasInput:
Beispiel #3
0
def setup(job, jobSite, thisExperiment):
    """ prepare the setup and get the run command list """

    # start setup time counter
    t0 = time.time()

    ec = 0
    runCommandList = []

    # split up the job parameters to be able to loop over the tasks
    jobParameterList = job.jobPars.split("\n")
    jobHomePackageList = job.homePackage.split("\n")
    jobTrfList = job.trf.split("\n")
    jobAtlasRelease = getAtlasRelease(job.atlasRelease)

    tolog("Number of transformations to process: %s" % len(jobParameterList))
    if len(jobParameterList) > 1:
        multi_trf = True
    else:
        multi_trf = False

    # verify that the multi-trf job is setup properly
    ec, job.pilotErrorDiag, jobAtlasRelease = RunJobUtilities.verifyMultiTrf(jobParameterList, jobHomePackageList, jobTrfList, jobAtlasRelease)
    if ec > 0:
        return ec, runCommandList, job, multi_trf
            
    os.chdir(jobSite.workdir)
    tolog("Current job workdir is %s" % os.getcwd())
    
    # setup the trf(s)
    _i = 0
    _stdout = job.stdout
    _stderr = job.stderr
    _first = True
    for (_jobPars, _homepackage, _trf, _swRelease) in map(None, jobParameterList, jobHomePackageList, jobTrfList, jobAtlasRelease):
        tolog("Preparing setup %d/%d" % (_i + 1, len(jobParameterList)))

        # reset variables
        job.jobPars = _jobPars
        job.homePackage = _homepackage
        job.trf = _trf
        job.atlasRelease = _swRelease
        if multi_trf:
            job.stdout = _stdout.replace(".txt", "_%d.txt" % (_i + 1))
            job.stderr = _stderr.replace(".txt", "_%d.txt" % (_i + 1))

        # post process copysetup variable in case of directIn/useFileStager
        _copysetup = readpar('copysetup')
        _copysetupin = readpar('copysetupin')
        if "--directIn" in job.jobPars or "--useFileStager" in job.jobPars or _copysetup.count('^') == 5 or _copysetupin.count('^') == 5:
            # only need to update the queuedata file once
            if _first:
                RunJobUtilities.updateCopysetups(job.jobPars)
                _first = False

        # setup the trf
        ec, job.pilotErrorDiag, cmd, job.spsetup, job.JEM, job.cmtconfig = thisExperiment.getJobExecutionCommand(job, jobSite, pilot_initdir)
        if ec > 0:
            # setup failed
            break

        # add the setup command to the command list
        runCommandList.append(cmd)
        _i += 1

    job.stdout = _stdout
    job.stderr = _stderr
    job.timeSetup = int(time.time() - t0)
    tolog("Total setup time: %d s" % (job.timeSetup))

    return ec, runCommandList, job, multi_trf