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


Python Scheduler.configure方法代码示例

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


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

示例1: configure

# 需要导入模块: from Scheduler import Scheduler [as 别名]
# 或者: from Scheduler.Scheduler import configure [as 别名]
    def configure(self, cfg_params):
        self.environment_unique_identifier = None
        self.cfg_params = cfg_params
        Scheduler.configure(self,cfg_params)
        self.jobtypeName = cfg_params['CRAB.jobtype']

        name=string.upper(self.name())
        self.queue = cfg_params.get(name+'.queue',None)

        self.res = cfg_params.get(name+'.resource',None)

        # minimal padding time for jobs. For local schedulers is disabled.
        # Added for alignment purpose only (and for test) with Grid schedulers
        self.minimal_job_duration = 0

        if (cfg_params.has_key(self.name()+'.env_id')): self.environment_unique_identifier = cfg_params[self.name()+'.env_id']
        ## is this ok?
        localDomainName = getLocalDomain(self)
        localPSNs = getListOfPSNsForThisDomain(localDomainName)
        # turn list to a string as in crab.cfg
        localPSNs = ",".join(localPSNs)
        if not cfg_params.has_key('GRID.se_white_list'):
            cfg_params['GRID.se_white_list']=localPSNs
            common.logger.info("Your domain name is "+str(localDomainName)+": only local dataset will be considered")
        else:
            common.logger.info("Your se_white_list is set to "+str(cfg_params['GRID.se_white_list'])+": only local dataset will be considered")
        return
开发者ID:belforte,项目名称:CRAB2,代码行数:29,代码来源:SchedulerLocal.py

示例2: configure

# 需要导入模块: from Scheduler import Scheduler [as 别名]
# 或者: from Scheduler.Scheduler import configure [as 别名]
    def configure(self, cfg_params):
        self.cfg_params = cfg_params
        self.jobtypeName   = cfg_params.get('CRAB.jobtype','')
        self.schedulerName = cfg_params.get('CRAB.scheduler','')
        Scheduler.configure(self,cfg_params)
        #self.proxyValid=0

        #self.dontCheckProxy=int(cfg_params.get("GRID.dont_check_proxy",0)) 	 
        self.space_token = cfg_params.get("USER.space_token",None) 	 
        self.proxyServer= 'myproxy.cern.ch'
        #self.group = cfg_params.get("GRID.group", None) 	 
        #self.role = cfg_params.get("GRID.role", None)

        removeBList = cfg_params.get("GRID.remove_default_blacklist", 0 )
        blackAnaOps = None
        if int(removeBList) == 0:
            blacklist = Downloader("http://cmsdoc.cern.ch/cms/LCG/crab/config/")
            result = blacklist.config("site_black_list.conf")
            if result != None:
                blackAnaOps = result
            common.logger.debug("Enforced black list: %s "%blackAnaOps)
        else:
            common.logger.info("WARNING: Skipping default black list!")

        self.EDG_ce_black_list = None
        if cfg_params.has_key('GRID.ce_black_list') and cfg_params['GRID.ce_black_list']:
            self.EDG_ce_black_list = cfg_params.get('GRID.ce_black_list')
            if int(removeBList) == 0 and blackAnaOps: 
                self.EDG_ce_black_list += ",%s"%blackAnaOps
        elif int(removeBList) == 0 and blackAnaOps:
            self.EDG_ce_black_list = blackAnaOps
        if self.EDG_ce_black_list:
            self.EDG_ce_black_list = str(self.EDG_ce_black_list).split(',')

        self.EDG_ce_white_list = cfg_params.get('GRID.ce_white_list',None)
        if (self.EDG_ce_white_list): self.EDG_ce_white_list = str(self.EDG_ce_white_list).split(',')

        self.VO = cfg_params.get('GRID.virtual_organization','cms')

        self.EDG_clock_time = cfg_params.get('GRID.max_wall_clock_time',None)

        # Default minimum CPU time to >= 130 minutes
        self.EDG_cpu_time = cfg_params.get('GRID.max_cpu_time', '130')

        ## Add EDG_WL_LOCATION to the python path
        #if not self.CRAB_useServer and not self.CRAB_serverName:
        #    if not os.environ.has_key('EDG_WL_LOCATION'):
        #        msg = "Error: the EDG_WL_LOCATION variable is not set."
        #        raise CrabException(msg)
        #    path = os.environ['EDG_WL_LOCATION']
        #    libPath=os.path.join(path, "lib")
        #    sys.path.append(libPath)
        #    libPath=os.path.join(path, "lib", "python")
        #    sys.path.append(libPath)

        self.checkProxy()
        return
开发者ID:belforte,项目名称:CRAB2,代码行数:59,代码来源:SchedulerGrid.py

示例3: configure

# 需要导入模块: from Scheduler import Scheduler [as 别名]
# 或者: from Scheduler.Scheduler import configure [as 别名]
    def configure(self, cfg_params):
        self.cfg_params = cfg_params
        self.jobtypeName   = cfg_params.get('CRAB.jobtype','')
        self.schedulerName = cfg_params.get('CRAB.scheduler','')
        Scheduler.configure(self,cfg_params)
        self.proxyValid=0

        self.dontCheckProxy=int(cfg_params.get("GRID.dont_check_proxy",0)) 	 
        self.space_token = cfg_params.get("USER.space_token",None) 	 
 	try:
            self.proxyServer = Downloader("http://cmsdoc.cern.ch/cms/LCG/crab/config/").config("myproxy_server.conf")
            self.proxyServer = self.proxyServer.strip()
            if self.proxyServer is None:
                raise CrabException("myproxy_server.conf retrieved but empty")
        except Exception, e:
            common.logger.info("Problem setting myproxy server endpoint: using myproxy.cern.ch")
            common.logger.debug(e)
            self.proxyServer= 'myproxy.cern.ch'
开发者ID:PerilousApricot,项目名称:CRAB2,代码行数:20,代码来源:SchedulerGrid.py


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