ATLAS Offline Software
Loading...
Searching...
No Matches
python.trfReports.machineReport Class Reference

Report on the machine where we ran. More...

Inheritance diagram for python.trfReports.machineReport:
Collaboration diagram for python.trfReports.machineReport:

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

 python (self, fast=False)

Detailed Description

Report on the machine where we ran.

Definition at line 580 of file trfReports.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Member Function Documentation

◆ python()

python.trfReports.machineReport.python ( self,
fast = False )

Definition at line 582 of file trfReports.py.

582 def python(self, fast = False):
583 machine = {}
584 # Get the following from the platform module
585 attrs = ['node', 'platform']
586 for attr in attrs:
587 try:
588 machine[attr] = getattr(platform, attr).__call__()
589 except AttributeError as e:
590 msg.warning('Failed to get "{0}" attribute from platform module: {1}'.format(attr, e))
591
592 attrs = ['linux_distribution']
593 for attr in attrs:
594 try:
595 machine[attr] = getattr(distro, attr).__call__()
596 except (AttributeError,NameError) as e:
597 msg.warning('Failed to get "{0}" attribute from platform module: {1}'.format(attr, e))
598
599 # Now try to get processor information from /proc/cpuinfo
600 try:
601 with open('/proc/cpuinfo') as cpuinfo:
602 for line in cpuinfo:
603 try:
604 k, v = [ l.strip() for l in line.split(':') ]
605 if k == 'cpu family' and 'cpu_family' not in machine:
606 machine['cpu_family'] = v
607 elif k == 'model' and 'model' not in machine:
608 machine['model'] = v
609 elif k == 'model name' and 'model_name' not in machine:
610 machine['model_name'] = v
611 except ValueError:
612 pass
613 except Exception as e:
614 msg.warning('Unexpected error while parsing /proc/cpuinfo: {0}'.format(e))
615 try:
616 with open('/etc/machinefeatures/hs06') as hs:
617 machine['hepspec'] = hs.readlines()[0].strip()
618 except IOError:
619 pass
620 return machine
621
622

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