本文整理汇总了Python中Ganga.Utility.Config.setConfigOption函数的典型用法代码示例。如果您正苦于以下问题:Python setConfigOption函数的具体用法?Python setConfigOption怎么用?Python setConfigOption使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setConfigOption函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
super(Savannah9638, self).setUp()
wipe_temp_dir()
from Ganga.Utility.Config import setConfigOption
setConfigOption('Configuration', 'gangadir', '/tmp/ganga_topdir-$USER')
示例2: setUp
def setUp(self):
"""Make sure that the Tasks object isn't destroyed between tests"""
super(TestCoreTasks, self).setUp()
from Ganga.Utility.Config import setConfigOption
setConfigOption('TestingFramework', 'AutoCleanup', 'False')
setConfigOption('Tasks', 'TaskLoopFrequency', 1)
self._numTasks = 50
示例3: setUp
def setUp(self):
"""Make sure that the Job object isn't destroyed between tests"""
super(TestLazyLoadingSubjobs, self).setUp()
from Ganga.Utility.Config import getConfig
default_CleanUp = getConfig('TestingFramework')['AutoCleanup']
from Ganga.Utility.Config import setConfigOption
setConfigOption('TestingFramework', 'AutoCleanup', 'False')
示例4: test_e_testInMemory
def test_e_testInMemory(self):
"""
Test the resubmit on a job in memory vs a job which has been loaded from disk
"""
from Ganga.GPI import Job, Local
j=Job()
j.splitter = self._getSplitter()
j.backend = Local()
j.submit()
from GangaTest.Framework.utils import sleep_until_completed
sleep_until_completed(j)
# Job has ben created, split, run and now exists in Memory (NOT SJXML)
from Ganga.Utility.Config import setConfigOption
setConfigOption('Configuration', 'resubmitOnlyFailedSubjobs', 'True')
j.resubmit()
sleep_until_completed(j)
j.subjobs(0).resubmit()
# We should get here if calling resubmit doesn't stall
j.subjobs(0).force_status('failed')
j.resubmit()
sleep_until_completed(j)
assert j.subjobs(0).status == 'completed'
# Test resubmit from the master job worked
j.subjobs(0).force_status('failed')
j.subjobs(0).resubmit()
sleep_until_completed(j)
assert j.subjobs(0).status == 'completed'
# Test that the resubmit from the subjob worked
setConfigOption('Configuration', 'resubmitOnlyFailedSubjobs', 'False')
j.resubmit()
sleep_until_completed(j)
j.subjobs(0).force_status('failed')
j.resubmit()
sleep_until_completed(j)
示例5: setUp
def setUp(self):
"""Make sure that the Job object isn't destroyed between tests"""
super(TestMutableMethods, self).setUp()
from Ganga.Utility.Config import setConfigOption
setConfigOption('TestingFramework', 'AutoCleanup', 'False')
from Ganga.GPI import Job, TestSubmitter, GListApp
self.test_job = Job(application=GListApp(gListComp=[self._makeRandomTFile() for _ in range(10)],
gList=[self._makeRandomString() for _ in range(10)],
seq=range(10)),backend=TestSubmitter())
示例6: test_d_JobRemoval
def test_d_JobRemoval(self):
""" Fourth make sure that we get rid of the jobs safely"""
from Ganga.GPI import jobs
self.assertEqual(len(jobs), 1)
jobs(0).remove()
self.assertEqual(len(jobs), 0)
from Ganga.Utility.Config import setConfigOption
setConfigOption('TestingFramework', 'AutoCleanup', 'True')
示例7: test_CondorConfigDefaults
def test_CondorConfigDefaults(self):
from Ganga.GPI import Condor, GangaList
from Ganga.Utility.Config import setConfigOption
from Ganga.GPIDev.Base.Proxy import isType
setConfigOption('defaults_CondorRequirements', 'other', ['POOL == "General"'])
setConfigOption('defaults_CondorRequirements', 'opsys', 'print')
a = Condor()
c = a.requirements
assert isType(c.other, GangaList)
assert c.opsys == 'print'
assert c.other == ['POOL == "General"']
示例8: test_unprepareTrue
def test_unprepareTrue(self):
from Ganga.Utility.Config import setConfigOption
from Ganga.GPI import Job, Executable
setConfigOption('Preparable', 'unprepare_on_copy', 'True')
j = Job(application=Executable(exe='/bin/echo', args=['hello']))
j.submit()
assert(j.application.is_prepared != None)
j2 = j.copy()
assert(j2.application.is_prepared == None)
j3 = Job(j)
assert(j3.application.is_prepared == None)
示例9: test_unprepareFalse
def test_unprepareFalse(self):
from Ganga.Utility.Config import setConfigOption
from Ganga.GPI import Job, Executable
setConfigOption('Preparable', 'unprepare_on_copy', 'False')
k = Job(application=Executable(exe='/bin/echo', args=['hello']))
k.submit()
assert(k.application.is_prepared != None)
k2 = k.copy()
assert(k2.application.is_prepared != None)
k3 = Job(k)
assert(k.application.is_prepared != None)
示例10: _ganga_run_exitfuncs
def _ganga_run_exitfuncs():
"""run any registered exit functions
atexit._exithandlers is traversed based on the priority.
If no priority was registered for a given function
than the lowest priority is assumed (LIFO policy)
We keep the same functionality as in *atexit* bare module but
we run each exit handler inside a try..catch block to be sure all
the registered handlers are executed
"""
# Set the disk timeout to 1 sec, sacrifice stability for quick-er exit
from Ganga.Utility.Config import setConfigOption
setConfigOption('Configuration', 'DiskIOTimeout', 1)
try:
from Ganga.GPI import queues
queues.lock()
except Exception, err:
logger.debug("This should only happen if Ganga filed to initialize correctly")
示例11: bootstrap
def bootstrap():
# Bootstrap for startup and setting of parameters for the Registries
retval = []
try:
checkDiskQuota()
except GangaException as err:
raise
except Exception as err:
logger.error("Disk quota check failed due to: %s" % err)
for registry in bootstrap_getreg():
if registry.name in started_registries:
continue
if not hasattr(registry, 'type'):
registry.type = config["repositorytype"]
if not hasattr(registry, 'location'):
registry.location = getLocalRoot()
logger.debug("Registry: %s" % registry.name)
logger.debug("Loc: %s" % registry.location)
registry.startup()
logger.debug("started " + registry.info(full=False))
started_registries.append(registry.name)
proxied_registry_slice = registry.getProxy()
retval.append((registry.name, proxied_registry_slice, registry.doc))
# Assuming all registries are started for all instances of Ganga atm
# Avoid ever, ever, calling the repository from behind the registry. This allows for all forms of bad behaviour
# This is a form of trade off but still is something which should be strongly discouraged!
# TODO investigate putting access to the repository behind a getter/setter which keeps the registry locked
other_sessions = bootstrap_getreg()[0].repository.get_other_sessions()
if other_sessions:
# Just print this from 1 repo only so chose the zeorth, nothing special
logger.warning("%i other concurrent sessions:\n * %s" % (len(other_sessions), "\n * ".join(other_sessions)))
logger.warning("Multiple Ganga sessions detected. The Monitoring Thread is being disabled.")
logger.warning("Type 'enableMonitoring' to restart")
setConfigOption('PollThread', 'autostart', False)
return retval
示例12: setUp
def setUp(self):
"""Make sure that the Job object isn't destroyed between tests"""
super(TestSJSubmit, self).setUp()
from Ganga.Utility.Config import setConfigOption
setConfigOption('Output', 'FailJobIfNoOutputMatched', 'True')
setConfigOption('TestingFramework', 'AutoCleanup', 'False')
setConfigOption('Configuration', 'resubmitOnlyFailedSubjobs', 'True')
示例13: test_d_SJResubmit_FailNotRequired
def test_d_SJResubmit_FailNotRequired(self):
"""
Resubmit when jobs are not required to have failed
"""
from Ganga.Utility.Config import setConfigOption
setConfigOption('Configuration', 'resubmitOnlyFailedSubjobs', 'False')
from Ganga.GPI import jobs
# Test that resubmitting a job with SubJobXMLList subjobs doesn't stall
# Test them with all subjobs completed and resubmitOnlyFailedSubjobs = False
jobs(0).resubmit()
from GangaTest.Framework.utils import sleep_until_completed
sleep_until_completed(jobs(0))
# Test that resubmitting a subjob from SubJobXMLList that subjob doesn't stall
jobs(0).subjobs(0).resubmit()
jobs(0).subjobs(0).force_status('failed')
jobs(0).subjobs(0).resubmit()
sleep_until_completed(jobs(0))
assert jobs(0).subjobs(0).status == 'completed'
# Test that we can resubmit 1 subjob from the subjob itself when the subjob is failed
# resubmitOnlyFailedSubjobs = False
jobs(0).subjobs(0).force_status('failed')
jobs(0).resubmit()
sleep_until_completed(jobs(0))
assert jobs(0).subjobs(0).status == 'completed'
示例14: test_ConfigDefaults
def test_ConfigDefaults(self):
from Ganga.GPI import Executable
from Ganga.Utility.Config import setConfigOption
setConfigOption('defaults_Executable', 'exe', 'echo2')
setConfigOption('defaults_Executable', 'args', ['Hello World2'])
a = Executable()
assert a.exe == 'echo2'
assert a.args == ['Hello World2']
setConfigOption('defaults_Executable', 'exe', '/bin/echo')
k = Executable()
assert k.exe == '/bin/echo'
assert k.args == ['Hello World2']
示例15: setUp
def setUp(self):
"""Make sure that the Job object isn't destroyed between tests"""
super(TestSavannah10016, self).setUp()
setConfigOption('TestingFramework', 'AutoCleanup', 'False')