当前位置: 首页>>代码示例>>Python>>正文


Python JobDB.setJobOptParameter方法代码示例

本文整理汇总了Python中DIRAC.WorkloadManagementSystem.DB.JobDB.JobDB.setJobOptParameter方法的典型用法代码示例。如果您正苦于以下问题:Python JobDB.setJobOptParameter方法的具体用法?Python JobDB.setJobOptParameter怎么用?Python JobDB.setJobOptParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIRAC.WorkloadManagementSystem.DB.JobDB.JobDB的用法示例。


在下文中一共展示了JobDB.setJobOptParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: OptimizerModule

# 需要导入模块: from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB [as 别名]
# 或者: from DIRAC.WorkloadManagementSystem.DB.JobDB.JobDB import setJobOptParameter [as 别名]

#.........这里部分代码省略.........
        self.log.debug("Cannot load JDL")
        return S_ERROR('Illegal Job JDL')
      if not classad.isOK():
        self.log.debug("Warning: illegal JDL for job %s, will be marked problematic" % (job))
        return S_ERROR('Illegal Job JDL')
      jobDef['classad'] = classad
    return S_OK(jobDef)

  #############################################################################
  def getOptimizerJobInfo(self, job, reportName):
    """This method gets job optimizer information that will
       be used for
    """
    self.log.verbose("self.jobDB.getJobOptParameter(%s,'%s')" % (job, reportName))
    result = self.jobDB.getJobOptParameter(job, reportName)
    if result['OK']:
      value = result['Value']
      if not value:
        self.log.warn('JobDB returned null value for %s %s' % (job, reportName))
        return S_ERROR('No optimizer info returned')
      else:
        try:
          return S_OK(eval(value))
        except BaseException as x:
          return S_ERROR('Could not evaluate optimizer parameters: %s' % repr(x))

    return result

  #############################################################################
  def setOptimizerJobInfo(self, job, reportName, value):
    """This method sets the job optimizer information that will subsequently
       be used for job scheduling and TURL queries on the WN.
    """
    self.log.verbose("self.jobDB.setJobOptParameter(%s,'%s','%s')" % (job, reportName, value))
    if not self.am_Enabled():
      return S_OK()
    return self.jobDB.setJobOptParameter(job, reportName, str(value))

  #############################################################################
  def setOptimizerChain(self, job, value):
    """This method sets the job optimizer chain, in principle only needed by
       one of the optimizers.
    """
    self.log.verbose("self.jobDB.setOptimizerChain(%s,%s)" % (job, value))
    if not self.am_Enabled():
      return S_OK()
    return self.jobDB.setOptimizerChain(job, value)

  #############################################################################
  def setNextOptimizer(self, job):
    """This method is executed when the optimizer instance has successfully
       processed the job.  The next optimizer in the chain will subsequently
       start to work on the job.
    """

    result = self.logDB.addLoggingRecord(job, status=self.startingMajorStatus,
                                         minor=self.startingMinorStatus,
                                         source=self.am_getModuleParam("optimizerName"))
    if not result['OK']:
      self.log.warn(result['Message'])

    self.log.verbose("self.jobDB.setNextOptimizer(%s,'%s')" % (job, self.am_getModuleParam("optimizerName")))
    return self.jobDB.setNextOptimizer(job, self.am_getModuleParam("optimizerName"))

  #############################################################################
  def updateJobStatus(self, job, status, minorStatus=None, appStatus=None):
开发者ID:DIRACGrid,项目名称:DIRAC,代码行数:70,代码来源:OptimizerModule.py


注:本文中的DIRAC.WorkloadManagementSystem.DB.JobDB.JobDB.setJobOptParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。