Posts Tagged ‘lhcb’

How to use gdb inside LHCb environment

Tuesday, March 16th, 2010

If you run a python script that imports GaudiPython (or any LHCb modules for that matter) inside gdb on any lxplus node, you will run into an error like this:


[lxplus223] ~ > gdb python
GNU gdb Red Hat Linux (6.3.0.0-1.162.el4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"
   ...Using host libthread_db library "/lib64/tls/libthread_db.so.1".

(gdb) set args test.py
(gdb) run
Starting program:
   /afs/cern.ch/sw/lcg/external/Python/2.5.4p2/slc4_amd64_gcc34/bin/python test.py
[Thread debugging using libthread_db enabled]
[New Thread 182894205120 (LWP 11117)]
Traceback (most recent call last):
  File "test.py", line 1, in
    import GaudiPython
ImportError: No module named GaudiPython

Program exited with code 01.
(gdb)

This is due to our group-login script (including the “rc” one)
using LbLogin and that reshuffles the paths. When gdb starts
the process to be debugged and if a SHELL variable is present,
it is started with “$SHELL -c”.
When it is perfectly legal for bash (it only starts a new shell),
with (t)csh it starts a new *login* shell corrupting the already
setup paths (PATH, LD_LIBRARY_PATH, PYTHONPATH etc).

So in order to solve this you have to unset SHELL inside
gdb (maybe best to place that in .gdbinit):

unset environment SHELL

Moore hangs after a line with EventPersistencySvc

Wednesday, November 18th, 2009

If you are running Moore on a machine other than lxplus it might hang after a line printing something about “EventPersistencySvc”. If you investigate further (using strace) you’ll see it’s waiting forever in “poll” for a file descriptor. If you check you’ll find that file descriptor to be bound by “bind” to a “AF_INET” port 300XX. So you probaly have a firewall running and that port range is blocked. On SLC5 use (as root)

system-config-securitylevel-tui

and under “customize” add:

30000-30100:tcp, 30000-30100:udp

to solve this problem. (Of course now you have opened a new attack vector for the bad guys ;-) )

CERN at Google Streetview

Tuesday, August 18th, 2009

Since today Google Streetview is available for Switzerland. It covers quite a few streets and among them is the road to CERN.

Here you can see the main entrance:

And here you can see the ATLAS building

… the CERN Globe:

LHCb Experiment:

Lbglimpse a glimpse for LHCb

Thursday, May 28th, 2009

A very usefull tool for working with source code within LHCb is

   Lbglimpse

As a remark for people moving from BaBar to LHCb, this is the tool for cmt most closely bringing the ‘srtglimps’ features. The ‘Lbglimpse’ can be found in $LHCBRELEASES/scripts. It is used as following

   Lbglimpse <string> [<project>] [<version>] [-v]

and you can run this LHCb glimpse on every paths of $CMTPATH to find all files containing <string>
if CMTPATH is not set but CMTPROJECTPATH is set then it will use <project> and <version> to built CMTPATH locally. As an example we could look for the string ‘nies’ in the Moore Trigger project to find all places where the author ‘nies’ is mentioned or what ever:

   Lbglimpse nies Moore v6r0

Have fun hacking the LHCb software stack.

Howto run head version of Moore

Monday, March 2nd, 2009

Here is how to run the head version of Moore (no guarantee it will always work):

You will need a version tag one revision higher than the current. So for
example if Moore v6r0 is current you would go for Moore v6r1.

cd
setenv User_release_area ${PWD}
setenv CMTPROJECTPATH=${User_release_area}:/afs/cern.ch/lhcb/software/nightlies/lhcb1/Mon:
              /afs/cern.ch/lhcb/software/releases:${Gaudi_release_area}:${LCG_release_area}
mkdir -p Moore_<one_rev_higher_than_current e.g.: v6r1>/cmt

create a project.cmt file in this dir:


project Moore_v6r1;

use HLT  HLT_HEAD
use PHYS PHYS_HEAD
use LBCOM LBCOM_vXXrY   #choose HEAD or some version
use REC REC_vXXrY            #for each package
use ONLINE ONLINE_HEAD

build_strategy with_installarea
setup_strategy root

do the following:

setenvMoore v6r1

getpack -u Hlt/Moore   head
cd Hlt/Moore/cmt
cmt config
make
source setup.sh
cd ..
./options/Moore.py

Reverse search on tcsh

Monday, November 24th, 2008

Since we all love the tcsh (at least thats CERN’s point of view) ,

let me remind you that reverse search in tcsh is done by pressing


ALT-p

or for reverse order


ALT-P

Alternative tags for CMT in LHCb

Thursday, November 20th, 2008

So after a long time I finally figured out today how to set alternative
compile options in CMT when using the LHCb framework.

First there are some additonal tags besides the well known tags

for production and debugging code

slc4_amd64_gcc34
slc4_amd64_gcc34_db

one is for code coverage the other for performance tests

tag slc3_ia32_gcc344_cov
tag slc3_ia32_gcc344_pro

Most important is where all this stuff is set,

it’s in

 GaudiPolicy/cmt/requirements

Problem with the XXX_cov and XXX_pro is that there are no
supported prebuild binaries by CERN. So it’s all or nothing either
you build everything on your own or you are stuck. You can work
around that with a little hack:
getpack the GaudiPolicy package to your local cmtuser directory
and just add your additional flags to a supported tag.

If you just want to alter the cppflags for one package you would
just add something like this to the package’s requirements file:

macro_append cppflags " -g "

or

macro_append cppflags "" Linux " -g " Windows " -foo -bar"

Where Linux and Windows would act as a switch for different
compilation setups.and the quoted strings would be the appended
options. Note the first empty qoutes in the second example it’s just
the empty standard case.

Update:

As Stefan Roiser pointed out to me over at the cmt mailing list,
one possibility would be to produce your own requirements file

/my/dir/to/cmt/requirements

put your macro_append etc into there and set an enviornment variable

CMTUSERCONTEXT=/my/dir/to/cmt

Then your requirements file should be processed last, thus changing
appending your compiler flags etc as a last step of the configuration before
executing the make.

Also on the cmt mailing list Grigory Rybkin explained, that if you ever wonder
why your cppflags or any other macro behave weird you could check with

cmt show macro cppflags

Example output for package Moore on a Linux machine:

# Package CMT v1r20p20070208 defines macro cppflags as '-pipe -ansi -pedantic -W -Wall -Wwrite-strings
 -Wpointer-arith -Woverloaded-virtual ' for tag 'Linux'
# Package GaudiPolicy v8r5 defines macro cppflags as ' -fmessage-length=0 -Df2cFortran -fPIC -shared
 -D_GNU_SOURCE -Dlinux -Dunix -pipe -ansi -Wall -Wextra -pthread ' for default tag
# Package GaudiConf v10r13 appends to macro cppflags : ' -DAPPNAME=\"${package}\"
 -DAPPVERS=\"${version}\" ' for default tag
# Package RichKernel v7r17 appends to macro cppflags : ' -DRICHDEBUG ' for tag 'Linux&debug'
# Package LHCbKernel v9r2 remove from macro cppflags : '-DGOD_NOALLOC' for default tag
#
# Selection :
cppflags=' -fmessage-length=0 -Df2cFortran -fPIC -shared -D_GNU_SOURCE -Dlinux -Dunix -pipe -ansi
 -Wall -Wextra -pthread  -DAPPNAME=\"${package}\" -DAPPVERS=\"${version}\" -DRICHDEBUG '

And then use the “-e” option of make via brodcast, like:

cppflags=MYFLAGS cmt br make -e

it orders make to give environment precedence over variables from makefiles.

LHC Beam Monitor

Monday, September 15th, 2008

Thats currently my favourit LHC status web page:

http://ab-dep-op.web.cern.ch/ab-dep-op/vistar.php?usr=LHC

Especially last Thursday it was very usfull, since all webcast pages have been unavailably.

The LHC Rap Video :-)

Friday, August 1st, 2008

So after the colleauges at SLAC already had their infamous rap video:

LHC now has its own:

Here seems to be the origin of this video.

Run LHCb HLT on MDF files

Friday, July 11th, 2008

Here is an option file on how to run Moore_v4r2 on MDF files.


#pragma print off
#include "$STDOPTS/LHCbApplication.opts"
#include "$STDOPTS/DstDicts.opts"
//#include "$HLTSYSROOT/options/L0.opts"
#include "$HLTSYSROOT/options/L0FromRaw.opts"
#include "$HLTSYSROOT/options/Hlt1.opts"
#include "$HLTSYSROOT/options/Hlt2.opts"
#include "$STDOPTS/DC06Conditions.opts"
#pragma print on

ApplicationMgr.EvtMax =  10000;
EventSelector.PrintFreq = 1;
ApplicationMgr.OutputLevel = 10;

ApplicationMgr.HistogramPersistency = "NONE";

ApplicationMgr.ExtSvc +=  [ "ToolSvc" , "AuditorSvc" ] ;
ApplicationMgr.AuditAlgorithms = 1;

MessageSvc.Format = "% F%40W%S%7W%R%T %0W%M";
ToolSvc.SequencerTimerTool.OutputLevel = 4;

EventPersistencySvc.CnvServices      = {"LHCb::RawDataCnvSvc"};
EventSelector.PrintFreq              = 100;
EventSelector.Input   = {
  "DATAFILE='PFN:file:///local_home/snies/DC06_L0_v1_lumi2.mdf' SVC='LHCb::MDFSelector'"
};