11msg = logging.getLogger(__name__)
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')
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:
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"))
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:
70 self.
_envdict[
"LD_PRELOAD"].
add(path.join(
"$TCMALLOCDIR",
"libtcmalloc_minimal.so"))
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)')
96 return [
"{0}={1}".format(k, v)
for k, v
in self.
_envdict.items() ]
106 _currentEnvironmentValue =
"+++CURRENT+++"
108 def __init__(self, varname, separator=":
", testForExistance=True):
118 def add(self, value, prepend=True):
119 msg.debug(
'Adding new value "{0}" to envvar {1} (currently {2}'.format(value, self.
_name, self.
_value))
121 msg.warning(
'Attempt to add environment element {0} twice to {1}'.format(value, self.
_name))
125 if '$' in test_value:
126 test_value = os.path.join(os.environ[os.path.dirname(value)[1:]], os.path.basename(value))
127 if not os.access(test_value, os.R_OK):
128 msg.warning(
"Path to {0} is not readable - will not add it to {1}".format(value, self.
_name))
131 self.
_value[0:0] = [value]
140 if self.
_name in os.environ:
Class holding the update to an environment that will be passed on to an executor.
probeIMFSettings(self, argdict, name='all', substep='')
Add the libimf maths library to the setup.
setStandardEnvironment(self, argdict, name='all', substep='')
Setup the standard execution environment according to the switches in the transform configuration.
len(self)
Count the number of environment items that need to be updated.
probeOtherSettings(self, argdict, name='all', substep='')
Add other settings.
value(self, key)
Return the value for a key, string converted.
probeTcmallocSettings(self, argdict, name='all', substep='')
Add TCMALLOC to the setup.
values(self)
Return a list of KEY=VALUE pairs for this environment.
Helper class for environment variables using colon separated paths.
__str__(self)
Return the correct string representing the value for the shell.
add(self, value, prepend=True)
Add a new element to the variable.
__init__(self, varname, separator=":", testForExistance=True)
str _currentEnvironmentValue
bool add(const std::string &hname, TKey *tobj)