How to work in a CMS environment
Setting up the CMS environment by /cvmfs
/cvmfs
is a 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 ; a
/cvmfs
technical presentation can be found
here but the average CMS user can safely skip its implementation details and simply use it as a standard directory.
To use
/cvmfs
at PSI T3 you'll need to activate the basic 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
Assuming executed the previous
source
, the following session shows an example about how to use on a SL6
t3ui*
server the release
CMSSW_5_3_21 compiled for
slc6_amd64_gcc472 and hosted in
/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 each SL6
t3ui1*
server 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
You need to obtain an AFS token from the CERN server. Execute
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.
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, but still working )
Old, but still working
ROOT versions locally installed at T3:
-
/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
OLD DOC
Setting up the CMS environment by /swshare
13-11-2014 - This is the old and deprecated way to run CMSSW at PSI T3
Like in the
/cvmfs
case you'll need to activate the basic 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
but, both interactively or in a batch job, you'll have to override the variable
VO_CMS_SW_DIR
since the default value is nowadays
/cvmfs/cms.cern.ch
:
$ export VO_CMS_SW_DIR=/swshare/cms # for bash
$ setenv VO_CMS_SW_DIR /swshare/cms # for tcsh / csh
the
SGE job template has been updated to cover the
/swshare/cms
case, please have a look to it.
Then:
source $VO_CMS_SW_DIR/cmsset_default.sh # for bash
source $VO_CMS_SW_DIR/cmsset_default.csh # for tcsh / csh
This will make
scram
and other CMS commands available; CMSSW is installed under
$VO_CMS_SW_DIR
. Some additional packages (e.g.
CRAB) are located in the directory above
$VO_CMS_SW_DIR/..
.
Be aware that no new CMSSW releases will be installed in /swshare/cms
so please migrate to /cvmfs
How to access the CERN CVS server
You need to specially authenticate against the CERN CVS server. This can be done either by
kerberos4, kerberos5 or by SSH.
Kerberos is the most convenient solution.
Using SSH
Using SSH, set up CVSROOT:
export CVSROOT=':ext:isscvs.cern.ch:/cvs_server/repositories/CMSSW'
export CVS_RSH=ssh
and then, when you issue CVS commands, you'll be asked for your CERN password. This should be the fastest method.
An example CVS command is:
cvs co -r V00-02-02 QCDAnalysis/UEAnalysis
Using Kerberos
If you want to use Kerberos authentication, you need to obtain a Kerberos5 ticket before you can use the CVS commands. Execute the following
kinit YourCERNAFSName@CERN.CH #all letters in @CERN.CH are uppercase!
and set CVSROOT:
export CVSROOT=':gserver:cmscvs.cern.ch:/cvs_server/repositories/CMSSW'