Skip to content

Commit

Permalink
new sge default memory command
Browse files Browse the repository at this point in the history
this new default replaces some outdated custom cluster hacks,
any new config options should be based on import time checks
of SGE features
  • Loading branch information
ctsa committed Sep 26, 2015
1 parent 7c29192 commit f3167eb
Showing 1 changed file with 4 additions and 51 deletions.
55 changes: 4 additions & 51 deletions pyflow/src/pyflowConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,46 +176,10 @@ def getEnvVar(key) :



#
# this is site specific configuration information, although it won't be triggered
# for your site, it provides an example of how SGE mode can be customized:
#

class ChukSiteConfig(DefaultSiteConfig) :
class hvmemSGEConfig(DefaultSiteConfig) :
"""
Chuk environment specializations..
"""

sgeRoot = getEnvVar('SGE_ROOT')

@classmethod
def _qsubResourceArgConfig(cls, nCores, memMb) :

if cls.sgeRoot is None :
raise Exception("Can't find expected environment variable: 'SGE_ROOT'")

retval = []
This config assumes 'h_vmem' is defined on the SGE instance
# this stack size setting is required for multi-core jobs,
# and a good idea just in case for other jobs:
retval.extend(["-l", "s_stack=10240k"])

# in the uk we can specify our memory requirements:
memGb = 1 + ((memMb - 1) / 1024)
reqMemFile = "%s/req/mem%iG" % (cls.sgeRoot, memGb)
assert os.path.isfile(reqMemFile)
retval.extend(["-@", reqMemFile])

if nCores > 1 :
retval.extend(["-pe", "threaded", str(nCores)])

return retval



class Ilmn2012Config(DefaultSiteConfig) :
"""
The new standard cluster configuration at ilmn
"""

@classmethod
Expand All @@ -240,19 +204,8 @@ def _qsubResourceArgConfig(cls, nCores, memMb) :
#

def siteConfigFactory() :
isChukConfig = (DefaultSiteConfig.getDomainName() == "chuk.illumina.com")
isIlmn2012Config = False
if DefaultSiteConfig.getHostName().startswith("uscp-prd-ln") :
isIlmn2012Config = True
# if DefaultSiteConfig.getHostName().startswith("ussd-prd-ln") :
# isIlmn2012Config=True

if isChukConfig :
return ChukSiteConfig
elif isIlmn2012Config :
return Ilmn2012Config
else :
return DefaultSiteConfig
# TODO: add an import time test to determine if h_vmem is valid
return hvmemSGEConfig


siteConfig = siteConfigFactory()
Expand Down

0 comments on commit f3167eb

Please sign in to comment.