Class holding the update to an environment that will be passed on to an executor.
More...
|
def | __init__ (self) |
|
def | setStandardEnvironment (self, argdict, name='all', substep='') |
| Setup the standard execution environment according to the switches in the transform configuration. More...
|
|
def | probeIMFSettings (self, argdict, name='all', substep='') |
| Add the libimf maths library to the setup. More...
|
|
def | probeTcmallocSettings (self, argdict, name='all', substep='') |
| Add TCMALLOC to the setup. More...
|
|
def | probeOtherSettings (self, argdict, name='all', substep='') |
| Add other settings. More...
|
|
def | value (self, key) |
| Return the value for a key, string converted. More...
|
|
def | values (self) |
| Return a list of KEY=VALUE pairs for this environment. More...
|
|
def | len (self) |
| Count the number of environment items that need to be updated. More...
|
|
Class holding the update to an environment that will be passed on to an executor.
Definition at line 15 of file trfEnv.py.
◆ __init__()
def python.trfEnv.environmentUpdate.__init__ |
( |
|
self | ) |
|
◆ _addIMFSettings()
def python.trfEnv.environmentUpdate._addIMFSettings |
( |
|
self | ) |
|
|
private |
Definition at line 42 of file trfEnv.py.
42 def _addIMFSettings(self):
43 if 'ATLASMKLLIBDIR_PRELOAD' not in os.environ:
44 msg.warning(
'"ATLASMKLLIBDIR_PRELOAD" not found in the current environment'
45 ' - no setup of MKL is possible')
48 if 'ATLASMKLLIBDIR_PRELOAD' in os.environ:
49 if "LD_PRELOAD" not in self._envdict:
50 self._envdict[
"LD_PRELOAD"] = pathVar(
"LD_PRELOAD")
51 self._envdict[
"LD_PRELOAD"].
add(path.join(
"$ATLASMKLLIBDIR_PRELOAD",
"libimf.so"))
52 self._envdict[
"LD_PRELOAD"].
add(path.join(
"$ATLASMKLLIBDIR_PRELOAD",
"libintlc.so.5"))
◆ len()
def python.trfEnv.environmentUpdate.len |
( |
|
self | ) |
|
Count the number of environment items that need to be updated.
Definition at line 100 of file trfEnv.py.
101 return len(self._envdict)
◆ probeIMFSettings()
def python.trfEnv.environmentUpdate.probeIMFSettings |
( |
|
self, |
|
|
|
argdict, |
|
|
|
name = 'all' , |
|
|
|
substep = '' |
|
) |
| |
Add the libimf maths library to the setup.
Definition at line 28 of file trfEnv.py.
28 def probeIMFSettings(self, argdict, name='all', substep=''):
32 if argdict[
'imf'].returnMyValue(name=name, substep=substep)
is False:
33 msg.info(
'Skipping inclusion of imf libraries: --imf is set to False')
35 msg.info(
'Enabling inclusion of imf libraries: --imf is set to True')
36 self._addIMFSettings()
39 self._addIMFSettings()
◆ probeOtherSettings()
def python.trfEnv.environmentUpdate.probeOtherSettings |
( |
|
self, |
|
|
|
argdict, |
|
|
|
name = 'all' , |
|
|
|
substep = '' |
|
) |
| |
Add other settings.
Definition at line 74 of file trfEnv.py.
74 def probeOtherSettings(self, argdict, name='all', substep=''):
75 if 'env' not in argdict:
78 myEnv = argdict[
'env'].returnMyValue(name=name, substep=substep)
84 k, v = setting.split(
'=', 1)
87 msg.warning(
'Environment setting "{0}" seems to be invalid (must be KEY=VALUE)')
◆ probeTcmallocSettings()
def python.trfEnv.environmentUpdate.probeTcmallocSettings |
( |
|
self, |
|
|
|
argdict, |
|
|
|
name = 'all' , |
|
|
|
substep = '' |
|
) |
| |
Add TCMALLOC to the setup.
Definition at line 56 of file trfEnv.py.
56 def probeTcmallocSettings(self, argdict, name='all', substep=''):
58 if 'tcmalloc' not in argdict
or argdict[
'tcmalloc'].returnMyValue(name=name, substep=substep)
is False:
59 msg.info(
'Skipping inclusion of tcmalloc')
62 if 'TCMALLOCDIR' not in os.environ:
63 msg.warning(
'"TCMALLOCDIR" not found in the current environment'
64 ' - no setup of tcmalloc is possible')
68 if "LD_PRELOAD" not in self._envdict:
69 self._envdict[
"LD_PRELOAD"] = pathVar(
"LD_PRELOAD")
70 self._envdict[
"LD_PRELOAD"].
add(path.join(
"$TCMALLOCDIR",
"libtcmalloc_minimal.so"))
◆ setStandardEnvironment()
def python.trfEnv.environmentUpdate.setStandardEnvironment |
( |
|
self, |
|
|
|
argdict, |
|
|
|
name = 'all' , |
|
|
|
substep = '' |
|
) |
| |
Setup the standard execution environment according to the switches in the transform configuration.
Definition at line 22 of file trfEnv.py.
22 def setStandardEnvironment(self, argdict, name='all', substep=''):
23 self.probeIMFSettings(argdict, name=name, substep=substep)
24 self.probeTcmallocSettings(argdict, name=name, substep=substep)
25 self.probeOtherSettings(argdict, name=name, substep=substep)
◆ value()
def python.trfEnv.environmentUpdate.value |
( |
|
self, |
|
|
|
key |
|
) |
| |
Return the value for a key, string converted.
Definition at line 90 of file trfEnv.py.
91 return str(self._envdict[key])
◆ values()
def python.trfEnv.environmentUpdate.values |
( |
|
self | ) |
|
Return a list of KEY=VALUE pairs for this environment.
Definition at line 95 of file trfEnv.py.
96 return [
"{0}={1}".
format(k, v)
for k, v
in self._envdict.
items() ]
◆ _envdict
python.trfEnv.environmentUpdate._envdict |
|
private |
The documentation for this class was generated from the following file: