![]() |
ATLAS Offline Software
|
Classes | |
| class | analytic |
| Analytics service class. More... | |
| class | Fit |
| Low-level fitting class. More... | |
| class | Job |
| Job: a set of pieces of information relevant to a given work function. More... | |
| class | JobGroup |
| JobGroup: a set of Job objects and pieces of information relevant to a given set of Job objects. More... | |
| class | math |
| some mathematical tools More... | |
| class | memFileToTable |
| Extract a table of data from a txt file. More... | |
| class | ParallelJobProcessor |
| ParallelJobProcessor: a multiple-process processor of Job objects. More... | |
Functions | |
| findFile (pathvar, fname) | |
| Find a named file along a colon separated PATH type variable. | |
| getAncestry (listMyOrphans=False) | |
| List all processes and parents and form a dictionary where the parent key lists all child PIDs. | |
| listChildren (psTree=None, parent=os.getpid(), listOrphans=False) | |
| Find all the children of a particular PID (calls itself recursively to descend into each leaf) | |
| infanticide (childPIDs=None, sleepTime=3, message=True, listOrphans=False) | |
| Kill all PIDs. | |
| call (args, bufsize=0, executable=None, stdin=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0, message="", logger=msg, loglevel=None, timeout=None, retry=2, timefactor=1.5, sleeptime=10) | |
| asetupReport () | |
| Return a string with a report of the current athena setup. | |
| releaseIsOlderThan (major, minor=None) | |
| Test (to the best of our knowledge) if the current release is older than a major, minor version number. | |
| asetupReleaseIsOlderThan (asetup_string, major, minor=None) | |
| Test (to the best of our knowledge) if the asetup release is older than a major, minor version number. | |
| shQuoteStrings (strArray=sys.argv) | |
| Quote a string array so that it can be echoed back on the command line in a cut 'n' paste safe way. | |
| lineByLine (filename, strip=True, removeTimestamp=True, substepName=None) | |
| Generator to return lines and line count from a file. | |
| prettyXML (element, indent=' ', poolFileCatalogFormat=False) | |
| XML pretty print an ElementTree.ELement object. | |
| isodate () | |
| Return isoformated 'now' string. | |
| forceToAlphaNum (string) | |
| Strip a string down to alpha-numeric characters only. | |
| cmpMetadata (metadata1, metadata2, guidCheck='valid') | |
| Compare metadata for files, but taking into account that GUID can vary. | |
| unpackTarFile (filename, directory=".") | |
| Unpack a given tarfile. | |
| unpackDBRelease (tarball, dbversion=None) | |
| Ensure that the DBRelease tarball has been unpacked. | |
| setupDBRelease (setup) | |
| Run a DBRelease setup. | |
| cvmfsDBReleaseCheck (dbrelease) | |
| Validate a DBRelease exists on cvmfs and return the path to the setup script. | |
| pickledDump (argdict) | |
| Dump a list of arguments to the pickle file given in the 'dumpPickle' argument. | |
| JSONDump (argdict) | |
| Dump a list of arguments to the JSON file given in the 'dumpJSON' argument. | |
| convertToStr (in_string) | |
| Recursively convert unicode to str, useful when we have just loaded something from json (TODO: make the transforms happy with unicode as well as plain str!) | |
| cliToKey (option) | |
| Convert a command line option to the dictionary key that will be used by argparse. | |
| printHR (the_object) | |
| print in a human-readable way the items of a given object | |
| uniqueIdentifier () | |
| return a URL-safe, base 64-encoded pseudorandom UUID | |
| units (quantity=None, unitSingular="unit", unitPlural="units") | |
| return either singular or plural units as appropriate for a given quantity | |
| isInteractiveEnv () | |
| initialise_processes () | |
| initisation procedure for processes of process pool | |
| ValgrindCommand (defaultOptions=True, extraOptionsList=None, AthenaSerialisedConfigurationFile="athenaConf.pkl", returnFormat="string") | |
| VTuneCommand (defaultOptions=True, extraOptionsList=None, AthenaCommand=["athena.py", "athenaConf.pkl"], returnFormat="string") | |
| return VTune command @detail This function returns a VTune command for use with Athena. | |
| calcCpuTime (start, stop) | |
| calcWallTime (start, stop) | |
| bind_port (host, port) | |
| reportEventsPassedSimFilter (log) | |
| summarize events passed the ISF_SimEventFilter @detail this function sums up all events passed the ISF_SimEventFilter out of all total events. | |
Variables | |
| msg = logging.getLogger(__name__) | |
| python.trfUtils.asetupReleaseIsOlderThan | ( | asetup_string, | |
| major, | |||
| minor = None ) |
Test (to the best of our knowledge) if the asetup release is older than a major, minor version number.
| asetup_string | asetup string |
| major | Major release number |
| minor | Minor release number (if not specified, will not be matched against) |
Definition at line 303 of file trfUtils.py.
| python.trfUtils.asetupReport | ( | ) |
Return a string with a report of the current athena setup.
Definition at line 223 of file trfUtils.py.
| python.trfUtils.bind_port | ( | host, | |
| port ) |
Definition at line 1699 of file trfUtils.py.
| python.trfUtils.calcCpuTime | ( | start, | |
| stop ) |
Definition at line 1684 of file trfUtils.py.
| python.trfUtils.calcWallTime | ( | start, | |
| stop ) |
Definition at line 1692 of file trfUtils.py.
| python.trfUtils.call | ( | args, | |
| bufsize = 0, | |||
| executable = None, | |||
| stdin = None, | |||
| preexec_fn = None, | |||
| close_fds = False, | |||
| shell = False, | |||
| cwd = None, | |||
| env = None, | |||
| universal_newlines = False, | |||
| startupinfo = None, | |||
| creationflags = 0, | |||
| message = "", | |||
| logger = msg, | |||
| loglevel = None, | |||
| timeout = None, | |||
| retry = 2, | |||
| timefactor = 1.5, | |||
| sleeptime = 10 ) |
Definition at line 155 of file trfUtils.py.
| python.trfUtils.cliToKey | ( | option | ) |
Convert a command line option to the dictionary key that will be used by argparse.
Definition at line 652 of file trfUtils.py.
| python.trfUtils.cmpMetadata | ( | metadata1, | |
| metadata2, | |||
| guidCheck = 'valid' ) |
Compare metadata for files, but taking into account that GUID can vary.
Compare metadata dictionaries, but allowing for differences in the file_guid property as this is generated randomly for file types without an intrinsic GUID
| metadata1 | Filel metadata dictionary |
| metadata2 | File2 metadata dictionary |
| giudCheck | How to compare GUIDs. Valid values are:
|
Definition at line 464 of file trfUtils.py.
| python.trfUtils.convertToStr | ( | in_string | ) |
Recursively convert unicode to str, useful when we have just loaded something from json (TODO: make the transforms happy with unicode as well as plain str!)
Definition at line 636 of file trfUtils.py.
| python.trfUtils.cvmfsDBReleaseCheck | ( | dbrelease | ) |
Validate a DBRelease exists on cvmfs and return the path to the setup script.
| dbrelease | The DBRelease number (X.Y.Z[.A]) or "current" |
| trfExceptions.TransformSetupException | If the DBRelease setup is unreadable or the dbrelease parameter is not understood |
Definition at line 569 of file trfUtils.py.
| python.trfUtils.findFile | ( | pathvar, | |
| fname ) |
Find a named file along a colon separated PATH type variable.
Note will also work for finding directories
None is file is not found Definition at line 37 of file trfUtils.py.
| python.trfUtils.forceToAlphaNum | ( | string | ) |
Strip a string down to alpha-numeric characters only.
Definition at line 443 of file trfUtils.py.
| python.trfUtils.getAncestry | ( | listMyOrphans = False | ) |
List all processes and parents and form a dictionary where the parent key lists all child PIDs.
| listMyOrphans | If this is True, then processes which share the same pgid as this process and have parent PID=1 (i.e., init) get added to this process's children, which allows these orphans to be added to the kill list. N.B. this means that orphans have two entries - as child of init and a child of this process |
Definition at line 62 of file trfUtils.py.
| python.trfUtils.infanticide | ( | childPIDs = None, | |
| sleepTime = 3, | |||
| message = True, | |||
| listOrphans = False ) |
Kill all PIDs.
| childPIDs | Explicit list of PIDs to kill; if absent then listChildren() is called |
| sleepTime | Time between SIGTERM and SIGKILL |
| message | Boolean if messages should be printed |
| listOrphans | Parameter value to pass to getAncestry(), if necessary (beware, killing orphans is dangerous, you may kill "upstream" processes; Caveat Emptor) |
Definition at line 132 of file trfUtils.py.
| python.trfUtils.initialise_processes | ( | ) |
initisation procedure for processes of process pool
Definition at line 855 of file trfUtils.py.
| python.trfUtils.isInteractiveEnv | ( | ) |
Definition at line 703 of file trfUtils.py.
| python.trfUtils.isodate | ( | ) |
Return isoformated 'now' string.
Uses datetime.isoformat method, but suppressing microseconds
Definition at line 434 of file trfUtils.py.
| python.trfUtils.JSONDump | ( | argdict | ) |
Dump a list of arguments to the JSON file given in the 'dumpJSON' argument.
Definition at line 617 of file trfUtils.py.
Generator to return lines and line count from a file.
| filename | Filename to open and deliver lines from |
| strip | If lines get stripped before being returned (default True) |
| removeTimestamp | Removes timestamp from left.(default True) Since strings are removed only from left, this option requires explicit removal of substepName. |
| substepName | Removes substepName from left, if it's value is provided. (default None) |
Definition at line 372 of file trfUtils.py.
Find all the children of a particular PID (calls itself recursively to descend into each leaf)
| psTree | The process tree returned by trfUtils.listChildren(); if None then trfUtils.listChildren() is called internally. |
| parent | The parent process for which to return all the child PIDs |
| listOrphans | Parameter value to pass to getAncestry() if necessary |
children List of child PIDsTake a psTree dictionary and list all children
Definition at line 109 of file trfUtils.py.
| python.trfUtils.pickledDump | ( | argdict | ) |
Dump a list of arguments to the pickle file given in the 'dumpPickle' argument.
Definition at line 598 of file trfUtils.py.
| python.trfUtils.prettyXML | ( | element, | |
| indent = ' ', | |||
| poolFileCatalogFormat = False ) |
XML pretty print an ElementTree.ELement object.
| element | ElementTree.ELement object to print |
| indent | Indent parameter for minidom toprettyxml method |
| poolFileCatalogFormat | Whether to reformat the XML as a classic POOLFILECATALOG document |
Definition at line 397 of file trfUtils.py.
| python.trfUtils.printHR | ( | the_object | ) |
print in a human-readable way the items of a given object
This function prints in a human-readable way the items of a given object.
| object | to print |
Definition at line 660 of file trfUtils.py.
| python.trfUtils.releaseIsOlderThan | ( | major, | |
| minor = None ) |
Test (to the best of our knowledge) if the current release is older than a major, minor version number.
There's no unambiguous reference to the release that encompasses all of the development builds (dev, devval, migs), but almost everything can be determined from AtlasVersion and AtlasBaseDir. If neither of those contain version information then we assume a development build that is new by definition (so we return False)
| major | Major release number |
| minor | Minor release number (if not specified, will not be matched against) |
Definition at line 261 of file trfUtils.py.
| python.trfUtils.reportEventsPassedSimFilter | ( | log | ) |
summarize events passed the ISF_SimEventFilter @detail this function sums up all events passed the ISF_SimEventFilter out of all total events.
All this inforamation is extracted from log.ReSim
Definition at line 1717 of file trfUtils.py.
| python.trfUtils.setupDBRelease | ( | setup | ) |
Run a DBRelease setup.
| setup | DMRelease setup script location (absolute or relative path) |
Definition at line 543 of file trfUtils.py.
| python.trfUtils.shQuoteStrings | ( | strArray = sys.argv | ) |
Quote a string array so that it can be echoed back on the command line in a cut 'n' paste safe way.
| strArray | Array of strings to quote |
Technique is to first quote any pre-existing single quotes, then single quote all of the array elements so that the shell sees them as a single argument
Definition at line 361 of file trfUtils.py.
| python.trfUtils.uniqueIdentifier | ( | ) |
return a URL-safe, base 64-encoded pseudorandom UUID
This function returns a URL-safe, base 64-encoded pseudorandom Universally Unique IDentifier (UUID).
Definition at line 678 of file trfUtils.py.
| python.trfUtils.units | ( | quantity = None, | |
| unitSingular = "unit", | |||
| unitPlural = "units" ) |
return either singular or plural units as appropriate for a given quantity
This function returns either singular or plural units as appropriate for a given quantity. So, a quantity of 1 would cause the return of singular units and a quantity of 2 would cause the return of plural units.
| quantity | the numerical quantity |
| unitSingular | the string for singular units |
| unitSingular | the string for plural units |
Definition at line 691 of file trfUtils.py.
| python.trfUtils.unpackDBRelease | ( | tarball, | |
| dbversion = None ) |
Ensure that the DBRelease tarball has been unpacked.
Extract the dbversion number and look for an unpacked directory. If found then this release is already setup. If not then try to unpack the tarball.
| tarball | The tarball file |
| dbversion | The version number (if not given the look at the tarball name to get it) |
| trfExceptions.TransformSetupException | If the DBRelease tarball is unreadable or the version is not understood |
True if release was unpacked or False if release was already unpacked, dbsetup path) Definition at line 520 of file trfUtils.py.
| python.trfUtils.unpackTarFile | ( | filename, | |
| directory = "." ) |
Unpack a given tarfile.
| filename | Tar file to unpck |
| directory | Directory target for the unpacking |
Definition at line 501 of file trfUtils.py.
| python.trfUtils.ValgrindCommand | ( | defaultOptions = True, | |
| extraOptionsList = None, | |||
| AthenaSerialisedConfigurationFile = "athenaConf.pkl", | |||
| returnFormat = "string" ) |
Definition at line 1577 of file trfUtils.py.
| python.trfUtils.VTuneCommand | ( | defaultOptions = True, | |
| extraOptionsList = None, | |||
| AthenaCommand = ["athena.py", "athenaConf.pkl"], | |||
| returnFormat = "string" ) |
return VTune command @detail This function returns a VTune command for use with Athena.
The command is returned as a string (by default) or a list, as requested using the argument returnFormat. The function will return a default VTune command specification, unless the user suppress them through an option. To append additional options to the command specification the argument extraOptionsList is used. This causes the list of extra specified command options to be appended to the command specification, which will contain the default options unless these are suppressed. The Athena serialised configuration file is specified using the argument AthenaSerialisedConfigurationFile.
Definition at line 1643 of file trfUtils.py.
| python.trfUtils.msg = logging.getLogger(__name__) |
Definition at line 31 of file trfUtils.py.