ATLAS Offline Software
Loading...
Searching...
No Matches
python.trfEnv.environmentUpdate Class Reference

Class holding the update to an environment that will be passed on to an executor. More...

Inheritance diagram for python.trfEnv.environmentUpdate:
Collaboration diagram for python.trfEnv.environmentUpdate:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self)
 setStandardEnvironment (self, argdict, name='all', substep='')
 Setup the standard execution environment according to the switches in the transform configuration.
 probeIMFSettings (self, argdict, name='all', substep='')
 Add the libimf maths library to the setup.
 probeTcmallocSettings (self, argdict, name='all', substep='')
 Add TCMALLOC to the setup.
 probeOtherSettings (self, argdict, name='all', substep='')
 Add other settings.
 value (self, key)
 Return the value for a key, string converted.
 values (self)
 Return a list of KEY=VALUE pairs for this environment.
 len (self)
 Count the number of environment items that need to be updated.

Protected Member Functions

 _addIMFSettings (self)

Protected Attributes

dict _envdict = {}

Detailed Description

Class holding the update to an environment that will be passed on to an executor.

Definition at line 15 of file trfEnv.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

python.trfEnv.environmentUpdate.__init__ ( self)

Definition at line 17 of file trfEnv.py.

17 def __init__(self):
18 self._envdict = {}
19

Member Function Documentation

◆ _addIMFSettings()

python.trfEnv.environmentUpdate._addIMFSettings ( self)
protected

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')
46 return
47
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"))
53
54
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55

◆ len()

python.trfEnv.environmentUpdate.len ( self)

Count the number of environment items that need to be updated.

Definition at line 100 of file trfEnv.py.

100 def len(self):
101 return len(self._envdict)
102
103

◆ probeIMFSettings()

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=''):
29 # If imf=True/False then follow its lead, but otherwise try to detect the release
30 # and enable if we have a release >= 17.7
31 if 'imf' in argdict:
32 if argdict['imf'].returnMyValue(name=name, substep=substep) is False:
33 msg.info('Skipping inclusion of imf libraries: --imf is set to False')
34 else:
35 msg.info('Enabling inclusion of imf libraries: --imf is set to True')
36 self._addIMFSettings()
37 return
38
39 self._addIMFSettings()
40
41

◆ probeOtherSettings()

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:
76 return
77
78 myEnv = argdict['env'].returnMyValue(name=name, substep=substep)
79 if myEnv is None:
80 return
81
82 for setting in myEnv:
83 try:
84 k, v = setting.split('=', 1)
85 self._envdict[k] = v
86 except ValueError:
87 msg.warning('Environment setting "{0}" seems to be invalid (must be KEY=VALUE)')
88

◆ probeTcmallocSettings()

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=''):
57 # We only do this if tcmalloc=True in atgdict
58 if 'tcmalloc' not in argdict or argdict['tcmalloc'].returnMyValue(name=name, substep=substep) is False:
59 msg.info('Skipping inclusion of tcmalloc')
60 return
61
62 if 'TCMALLOCDIR' not in os.environ:
63 msg.warning('"TCMALLOCDIR" not found in the current environment'
64 ' - no setup of tcmalloc is possible')
65 return
66
67 # For now we support the minimal version (it's the default)
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"))
71
72

◆ setStandardEnvironment()

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)
26

◆ value()

python.trfEnv.environmentUpdate.value ( self,
key )

Return the value for a key, string converted.

Definition at line 90 of file trfEnv.py.

90 def value(self, key):
91 return str(self._envdict[key])
92

◆ values()

python.trfEnv.environmentUpdate.values ( self)

Return a list of KEY=VALUE pairs for this environment.

Definition at line 95 of file trfEnv.py.

95 def values(self):
96 return [ "{0}={1}".format(k, v) for k, v in self._envdict.items() ]
97

Member Data Documentation

◆ _envdict

python.trfEnv.environmentUpdate._envdict = {}
protected

Definition at line 18 of file trfEnv.py.


The documentation for this class was generated from the following file: