ls-dyna is now installed on physix cluster
Ticket n°215786 : installer le logiciel Ls Dyna sur le cluster de calcul de l'IPR also fixes Bug 2812 - la mise à jour de physix-master a échoué (parsing de qconf -sconf global)
This commit is contained in:
parent
98c2b62f78
commit
347a0c034b
|
@ -13,6 +13,8 @@ class SgeConfig:
|
||||||
def getAttr( self, strAttrName ):
|
def getAttr( self, strAttrName ):
|
||||||
return self.m_attrs[ strAttrName ]
|
return self.m_attrs[ strAttrName ]
|
||||||
def setAttr( self, strAttrName, strAttrValue ):
|
def setAttr( self, strAttrName, strAttrValue ):
|
||||||
|
assert isinstance(strAttrName, str)
|
||||||
|
assert isinstance(strAttrValue, str)
|
||||||
self.m_attrs[ strAttrName ] = strAttrValue
|
self.m_attrs[ strAttrName ] = strAttrValue
|
||||||
def loadFromSgeFormat1String( self, strSgeConfigString ):
|
def loadFromSgeFormat1String( self, strSgeConfigString ):
|
||||||
"""
|
"""
|
||||||
|
@ -43,9 +45,10 @@ class SgeConfig:
|
||||||
# put multiline attributes on one line
|
# put multiline attributes on one line
|
||||||
strSgeConfigString = re.sub(r"\\\n", "", strSgeConfigString)
|
strSgeConfigString = re.sub(r"\\\n", "", strSgeConfigString)
|
||||||
for strAttrDef in strSgeConfigString.split("\n"):
|
for strAttrDef in strSgeConfigString.split("\n"):
|
||||||
#print strAttrDef
|
# print("strAttrDef=%s" % strAttrDef)
|
||||||
if len(strAttrDef) != 0:
|
if len(strAttrDef) != 0:
|
||||||
matchObj = re.match( "^(?P<attrName>[^\s]+)[ ]+(?P<attrValue>[^\s].*)$", strAttrDef )
|
matchObj = re.match( "^(?P<attrName>[^\s]+)[ ]+(?P<attrValue>[^\s].*)$", strAttrDef )
|
||||||
|
assert matchObj is not None
|
||||||
#print( '%s = %s\n' % (matchObj.group("attrName"), matchObj.group("attrValue") ) )
|
#print( '%s = %s\n' % (matchObj.group("attrName"), matchObj.group("attrValue") ) )
|
||||||
self.m_attrs[ matchObj.group("attrName") ] = matchObj.group("attrValue")
|
self.m_attrs[ matchObj.group("attrName") ] = matchObj.group("attrValue")
|
||||||
|
|
||||||
|
@ -76,8 +79,50 @@ class SgeConfig:
|
||||||
strResult = ""
|
strResult = ""
|
||||||
for (k,v) in self.m_attrs.items():
|
for (k,v) in self.m_attrs.items():
|
||||||
#print "%s %s" % (k,v)
|
#print "%s %s" % (k,v)
|
||||||
strResult += "%s %s\n" % (k,v)
|
# if the attribute's value is a list of comma separated strings, make sure there are no spaces after the commas, otherwise the value is not properly interpreted when read back into sge
|
||||||
#print strSgeConfigString
|
# for example if the user sets the value of administrator_mail (using qconf -mconf global) to "alice@univ-rennes1.fr, bob@univ-rennes1.fr", then the next call to qconf -sconf global will show a wrong value for administrator_mail, as shown below:
|
||||||
|
# pag_cmd none
|
||||||
|
# administrator_mail alice@univ-rennes1.fr,
|
||||||
|
# token_extend_time none
|
||||||
|
|
||||||
|
# it's even worse, as it messes with the whole config, putting unwanted attributes in the reporting_params attribute. In short, inputting commas followed by spaces seems to confuse sge....
|
||||||
|
|
||||||
|
# the tests below show that administrator_mail can only take a value, which can be a separator separated list, in which a separator is either :
|
||||||
|
# - separator_form_a: a comma character (no spaces after)
|
||||||
|
# - separator_form_b: a comma character, followed by any number of spaces, then a backslash, then \n
|
||||||
|
|
||||||
|
# because we remove carriage returns in our values, the only storage option is separator_form_a
|
||||||
|
|
||||||
|
# administrator_mail alice@univ-rennes1.fr
|
||||||
|
# -> ok
|
||||||
|
|
||||||
|
# administrator_mail alice@univ-rennes1.fr,bob@univ-rennes1.fr
|
||||||
|
# -> ok
|
||||||
|
|
||||||
|
# administrator_mail alice@univ-rennes1.fr, bob@univ-rennes1.fr
|
||||||
|
# -> messes up
|
||||||
|
|
||||||
|
# administrator_mail alice@univ-rennes1.fr, \
|
||||||
|
# bob@univ-rennes1.fr
|
||||||
|
# -> ok
|
||||||
|
|
||||||
|
# administrator_mail alice@univ-rennes1.fr,bob@univ-rennes1.fr, \
|
||||||
|
# bob2@univ-rennes1.fr
|
||||||
|
# -> ok
|
||||||
|
|
||||||
|
# administrator_mail alice@univ-rennes1.fr,bob@univ-rennes1.fr, \
|
||||||
|
# bob2@univ-rennes1.fr
|
||||||
|
# -> ok
|
||||||
|
|
||||||
|
# administrator_mail alice@univ-rennes1.fr,bob@univ-rennes1.fr \
|
||||||
|
# bob2@univ-rennes1.fr
|
||||||
|
# -> error
|
||||||
|
# root@physix-master:~# qconf -Mconf /tmp/global
|
||||||
|
# only a single value is allowed for configuration attribute "administrator_mail"
|
||||||
|
|
||||||
|
cleaned_value = re.sub(',\s*', ',', v)
|
||||||
|
strResult += "%s %s\n" % (k, cleaned_value)
|
||||||
|
# print("strResult=%s" % strResult)
|
||||||
return strResult
|
return strResult
|
||||||
def asFormat2String( self ):
|
def asFormat2String( self ):
|
||||||
strResult = ""
|
strResult = ""
|
||||||
|
|
Loading…
Reference in New Issue