PyROOT setup in athena

Hi All,

I’m not sure if this is the correct place to post this question as it falls on the overlap of quite a few areas. My basic problem is that the default version of PyROOT that is setup in newer versions of Athena seems unable to handle ROOT.map<string,int> objects properly.

By this I mean that if I set up athena 15.6.13,32 on lxplus then run my python programme I see the following warnings:

Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored

when I import root, and it falls over when I try the line:

for name,id in trigger_conf_tree.LVL1NameMap:

where trigger_conf_tree.LVL1NameMap is <ROOT.map<string,int> object at 0xafc8e70>. With the line:

import PyCintex; PyCintex.Cintex.Enable()

included the crash error message is:

Traceback (most recent call last):
File “D4PD_maker.py”, line 242, in
sys.exit(slim())
File “D4PD_maker.py”, line 159, in slim
trigger_configuration_map= DTT.PrepareTriggerConfiguration_Map(trigger_list, tc_chain)
File “/afs/cern.ch/user/t/tamsett/testarea/15.6.13/R32/D4PDs/DPD_Trigger_Tools.py”, line 126, in PrepareTriggerConfiguration_Map
for name,id in trigger_conf_tree.LVL1NameMap:
TypeError: int& map<string,int>::operator[](const string& __k) =>
could not convert argument 1

Without PyCintex, the message is slightly different (and there is a segmentation violation first). In previous versions of Athena (say 15.6.1,32) I did not see this problem. In addition if I do not setup Athena, yet setup pytroot on lxplus with the same root version by doing:

source /afs/cern.ch/sw/lcg/contrib/gcc/4.3/x86_64-slc5-gcc43-opt/setup.sh
export ROOTSYS=/afs/cern.ch/sw/lcg/app/releases/ROOT/5.22.00j/x86_64-slc5-gcc43-opt/root
export PATH=/afs/cern.ch/sw/lcg/external/Python/2.5.4p2/x86_64-slc5-gcc43-opt/bin:$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:/afs/cern.ch/sw/lcg/external/Python/2.5.4p2/x86_64-slc5-gcc43-opt/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$PYTHONPATH:$ROOTSYS/lib

I also do not see this problem. The reason this is an issue is that I want to run PyROOT jobs using prun, and the only way I currently know of setting up the grid job so that pyroot runs as I want is by using the --athenaTag=15.6.13,32 option, and the previous version of athena which works (15.6.1,32) is being removed from the grid.

If this is not the correct place to ask this, could someone suggest a better forum?

Thanks in advance,

Matthew

Hi,

I’ve managed to fix this with the help of my office mate (cheers Justin). The first thing I had to do was add a Loader.C of the form of that used in the previous post:

[code]#include
#include

#ifdef CINT
#pragma link C++ class map<string, int>+;
#else
template class std::map<std::string, int>;
#endif[/code]

The second thing I had to do was add the standard line:

I had to add “++” rather than just “+” or the programme fails. The third, and maybe key thing is that I had to comment out the line:

Why I had to do this I don’t know. However, with these three changes the code now runs, admittedly it has some ugly warning and complier messages at the start.

Cheers

Matthew

Matthew,

the important thing is to not mix Reflex and CINT dictionaries. When enabling Cintex in an ATLAS environment, the class loader sees a whole lot of Reflex dictionaries that it will automatically load based on the class name only. Apparently such clashed for you in the initial setup, but no longer after the modifications that you made.

Cheers,
Wim