Skip to content

GaudiMP: few minor fixes for Python3

While trying to execute a GaussMP application, I noticed the following issues in GMPBase.py:

Traceback (most recent call last):                                                                                                                                                                                 
  File "/cvmfs/lhcb.cern.ch/lib/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap                                                       
    self.run()                                                                                                                                                                                                     
  File "/cvmfs/lhcb.cern.ch/lib/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python3.9/multiprocessing/process.py", line 108, in run                                                              
    self._target(*self._args, **self._kwargs)                                                                                                                                                                      
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/python/GaudiMP/GMPBase.py", line 1278, in Engine                                                                  
    libc.prctl(15, name, 0, 0, 0)                                                                                                                                                                                  
ctypes.ArgumentError: argument 2: <class 'ValueError'>: embedded null character

Solved by wrapping name within ctypes.create_unicode_buffer().

Traceback (most recent call last):
  File "/cvmfs/lhcb.cern.ch/lib/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/cvmfs/lhcb.cern.ch/lib/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/python/GaudiMP/GMPBase.py", line 1073, in Engine
    self.Initialize()
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/python/GaudiMP/GMPBase.py", line 661, in Initialize
    self.processConfiguration()
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/python/GaudiMP/GMPBase.py", line 1033, in processConfiguration
    for key, lst in self.writerDict.iteritems():

Solved by replacing iteritems() with items().

I guess that this code was never executed with Python3 as it is considered a temporary workaround while waiting for Gaussino.

Merge request reports

Loading