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 simple 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 an example about 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
/cvmfs/cms.cern.ch
$ ls $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
cmsset_default.csh           
cmsset_default.sh
crab3            
slc5_amd64_gcc481  slc6_mic_gcc481
SITECONF
...
$ 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
/cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_21/bin/slc6_amd64_gcc472/cmsRun 

The CMS Environment and IPython

There is a conflict between the default IPython version 0.13.2 installed on the UI and the older IPython version 0.10 offered by CMSSW ; to switch between them use the var IPYTHONDIR, two different ~/.ipython dirs and a symbolic link:
More... Close
[mmasciov@t3ui17] ~$ mv .ipython .ipython-0.13.2

[mmasciov@t3ui17] ~$ which  ipython

/swshare/cms/slc6_amd64_gcc481/cms/cmssw-patch/CMSSW_7_0_6_patch3/external/slc6_amd64_gcc481/bin/ipython

[mmasciov@t3ui17] ~$ ipython

**********************************************************************

Welcome to IPython. I will try to create a personal configuration directory

where you can customize many aspects of IPython's functionality in:

/shome/mmasciov/.ipython

Initializing from configuration: /swshare/cms/slc6_amd64_gcc481/external/py2-ipython/0.10-cms/lib/python2.7/site-packages/IPython/UserConfig

Successful installation!

Please read the sections 'Initial Configuration' and 'Quick Tips' in the

IPython manual (there are both HTML and PDF versions supplied with the

distribution) to make sure that your system environment is properly configured

to take advantage of IPython's features.

Important note: the configuration system has changed! The old system is

still in place, but its setting may be partly overridden by the settings in

"~/.ipython/ipy_user_conf.py" config file. Please take a look at the file

if some of the new settings bother you.

Please press  to start IPython.

**********************************************************************

Python 2.7.3 (default, Oct 19 2013, 18:04:33)

Type "copyright", "credits" or "license" for more information.

IPython 0.10 -- An enhanced Interactive Python.

?         -> Introduction and overview of IPython's features.

%quickref -> Quick reference.

help      -> Python's own help system.

object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: exit()

Do you really want to exit ([y]/n)? y

[mmasciov@t3ui17] ~$ mv .ipython .ipython-0.10

# by default we want to use .ipython-0.13.2 so we link .ipython to .ipython-0.13.2
[mmasciov@t3ui17] ~$ ln -s .ipython-0.13.2 .ipython

# but now we want to use the ipython-0.10 so we exploit IPYTHONDIR
[mmasciov@t3ui17] ~$ export IPYTHONDIR=~/.ipython-0.10

[mmasciov@t3ui17] ~$ ipython
Python 2.7.3 (default, Oct 19 2013, 18:04:33)
Type "copyright", "credits" or "license" for more information.

IPython 0.10 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: 

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 :

kinit YourCERNAFSName@CERN.CH
aklog cern.ch

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

tokens

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 ; here how to set up your shell environment for using /afs ROOT v5.34

You might define an alias to quickly set up your shell :
alias ROOT_5.34.26='. /afs/cern.ch/sw/lcg/external/gcc/4.8/x86_64-slc6/setup.sh && . /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.26/x86_64-slc6-gcc48-opt/root/bin/thisroot.sh'

How to use /swshare/ROOT ( old ROOT versions, but still working )

The old 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: r31 - 2015-06-18 - FabioMartinelli
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback