create new tag
view all tags

How to work in a CMS environment

Setting up the CMS environment by /cvmfs

/cvmfs is an IT technology developed at CERN to easily distribute the CMSSW releases around the world ; wherever a CMS user will work he/she will find the same /cvmfs mount point with exactly the same files and directories ; partially it can be compared to /afs but it's much less sophisticated ; a /cvmfs technical presentation can be found here but the average CMS user can safely skip the implementation details and simply use /cvmfs as a read-only directory.

In order to access /cvmfs you'll need to activate the UI Grid Environment by :

$ source /swshare/psit3/etc/profile.d/cms_ui_env.sh  # for bash
$ source /swshare/psit3/etc/profile.d/cms_ui_env.csh # for tcsh / csh
The following session shows how to use on a UI the release CMSSW_5_3_21 compiled for slc6_amd64_gcc472 and hosted inside /cvmfs :
$ source /swshare/psit3/etc/profile.d/cms_ui_env.sh
$ echo $VO_CMS_SW_DIR
slc5_amd64_gcc434  slc6_amd64_gcc472
slc5_amd64_gcc461  slc6_amd64_gcc480
slc5_amd64_gcc462  slc6_amd64_gcc481
slc5_amd64_gcc470  slc6_amd64_gcc490
slc5_amd64_gcc472  slc6_amd64_gcc491
slc5_amd64_gcc481  slc6_mic_gcc481
$ cd $VO_CMS_SW_DIR/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_21
# the next source might take some seconds to complete since /cvmfs is a cached network filesystem and its local cache might be empty or outdated.
$ source $VO_CMS_SW_DIR/cmsset_default.sh
$ cmsenv
$ which cmsRun

The ROOT Environment and Jupyter/IPython

In order to use jupyter (formerly known as IPython), you need to use the anaconda distribution of python. A pre-installed anaconda is available at /swshare/anaconda, you can use it by specifying

export PATH=/swshare/anaconda/bin:$PATH
which python
> /swshare/anaconda/bin/python

In order to use the jupyter notebook and PyROOT, you also need to set up ROOT:

source /afs/cern.ch/sw/lcg/external/gcc/4.9/x86_64-slc6-gcc49-opt/setup.sh
source /afs/cern.ch/sw/lcg/app/releases/ROOT/6.06.08/x86_64-slc6-gcc49-opt/root/bin/thisroot.sh

In order to be able to access the notebook from an external network such as your laptop, you need to use sn SSH tunnel

#on T3 UI (e.g. t3ui02)
jupyter notebook

#on laptop
ssh -N -f -L localhost:PORT:localhost:PORT t3ui02.psi.ch
And then point your browser to http://localhost:PORT

The CMS Environment and Jupyter

If you want to use jupyter wirth ROOT via CMSSW, keep in mind that CMSSW supplies its own python, which by default clashes with jupyter. You can override it with

cd CMSSW_8_0_19
export PYTHONPATH=/cvmfs/cms.cern.ch/slc6_amd64_gcc530/lcg/root/6.06.00-ikhhed4/lib:$CMSSW_BASE/python
export PATH=/swshare/anaconda/bin:$PATH

How to access your CERN AFS account

In order to access your CERN AFS account you'll need to obtain an AFS token from the CERN server. Run :

aklog cern.ch

You can test whether you have a valid token using the tokens command


Tokens held by the Cache Manager:

User's (AFS ID 1234) tokens for afs@cern.ch [Expires Nov  7 16:11]
User's (AFS ID 5432) tokens for afs@psi.ch [Expires Nov  7 10:26]

If you want to use this Kerberos ticket also for password-less login into lxplus you'll need

  • create a forwardable ticket
kinit -f YourCERNAFSName@CERN.CH
  • add the following section to your SSH configuration (~.ssh/config)
host lxplus*
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials yes

For more information about Kerberos also have a look at the CERN Kerberos access page.

Warning, important You can use AFS for copying files between PSI and CERN, but do not use AFS for running on software installed at CERN, e.g. in a CMSSW environment spawned by a CERN AFS based grid/cms installation. This will create a lot of traffic, and such jobs will fail on the worker nodes for firewall reasons!!!

How to use /afs/cern.ch/sw/lcg/app/releases/ROOT

All the ROOT versions are available on /afs/cern.ch/sw/lcg/app/releases/ROOT ; check which is the latest 5. release and run that by a sequence of commands like :
$ alias ROOT_5.34.36=' . /afs/cern.ch/sw/lcg/external/gcc/4.8/x86_64-slc6/setup.sh && . /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.36/x86_64-slc6-gcc48-opt/root/bin/thisroot.sh'
$ ROOT_5.34.36
$ root
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/36      5 April 2016   *

How to use /swshare/ROOT ( very very old.. )

The outdated ROOT versions locally available at T3 are :
  • /swshare/ROOT/root_v5.34.18_slc5_amd64 it's compiled for Python 2.4 that's the default Python release on SL5 ( old )
  • /swshare/ROOT/root_v5.34.18_slc5_amd64_py26_pythia6 has been compiled for Python 2.6 that's also available on SL5 as python26 ( old )
  • /swshare/ROOT/root_v5.34.18_slc6_amd64_py26_pythia6 it's compiled for Python 2.6 that's the default Python release on SL6 ( the T3 is SL6 based, probably this is the version you'll use )

You can activate /swshare/ROOT/root_v5.34.18_slc5_amd64(_py26_pythia6) by:

cd /swshare/ROOT/root_v5.34.18_slc5_amd64(_py26)
source bin/thisroot.(c)sh
Do the same for /swshare/ROOT/root_v5.34.18_slc6_amd64
Edit | Attach | Watch | Print version | History: r34 < r33 < r32 < r31 < r30 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r34 - 2016-10-25 - JoosepPata
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback